text
stringlengths
226
34.5k
Project Gutenberg Python problem? Question: I am trying to process various texts by regex and NLTK of python -which is at <http://www.nltk.org/book->. I am trying to create a random text generator and I am having a hard time with a problem. First, here is my algorithm: 1. Enter a sentence as input -this is called tr...
How do I include a Django app in my PYTHONPATH? Question: I want to be able to import things from applications in my project without referring to my project name. My folder structure is like so; I have a project called djangoproject1, and inside I have a folder called apps, and then I have my individual apps in that f...
What is the Python equivalent of Ruby's "inspect"? Question: I just want to quickly see the properties and values of an object in Python, how do I do that in the terminal on a mac (very basic stuff, never used python)? Specifically, I want to see what `message.attachments` are in [this Google App Engine MailHandler ex...
What is Cloud Computing ? and Why? Question: > **Possible Duplicates:** > [What is Cloud computing?](http://stackoverflow.com/questions/108037/what- > is-cloud-computing) > [What is cloud computing?](http://stackoverflow.com/questions/1830142/what- > is-cloud-computing) Sorry for asking some Simple Question. But...
Indentation Error python Question: I'm using twisted API and was going through this example. I inserted one print statement print "in getdummydata" with correct indentation. code is as below: from twisted.internet import reactor, defer def getDummyData(x): """ This function is a ...
Python and OpenMP C Extensions Question: I have a C extension in which I'd like to use OpenMP. When I import my module, though, I get an import error: ImportError: /home/.../_entropysplit.so: undefined symbol: GOMP_parallel_end I've compiled the module with -fopenmp and -lgomp. Is this because my P...
Trying to parse an XML file with Python - what am I doing wrong? Question: I'm working with XML and Python for the first time. The ultimate goal is to send a request to a REST service, receive a response in XML, and parse the values and send emails depending on what was returned. However, the REST service is not yet in...
Python: virtualenv - gtk-2.0 Question: To add gtk-2.0 to my virtualenv I did the following: $ virtualenv --no-site-packages --python=/usr/bin/python2.6 myvirtualenv $ cd myvirtualenv $ source bin/activate $ cd lib/python2.6/ $ ln -s /usr/lib/pymodules/python2.6/gtk-2.0/ <http://sta...
error while trying to connect with a cisco 2600 router through python in windows Question: The code i have given is import telnetlib HOST="X" user ="X" password="X" en_password="x" tn=telnetlib.Telnet(HOST) Traceback (most recent call last): File ...
wxPython and py2app, CreateActCtx error 0x00000008 (Not enough disk space available) Question: I've been developing an application that uses wxPython as the GUI librar, and py2exe so that I can easily distribute it, however I have just now tested py2exe and the following error appears when the executable is launched. ...
Django - make file I/O thread safe Question: I want to read and write python-source-files from the file system in a thread- safe way. open("n2.py","w").write(my_new_py_class) from myproject import n2 #do something with n2 I assume that this is not thread-safe, since a request2 could modify ...
Any quick Python GUI to display live images from Camera Question: I am trying to display live images from my 1394 camera. Currently my code is able to obtain images in a loop from the camera and I was looking for any quick GUI that will update dynamically (as a separate thread). I can do this in PyQt maybe using QThrea...
How to make python 3 print() utf8 Question: How to make python 3 (3.1) to print("Some text") to stdout in utf8 ... or how to output raw bytes.. Test.py > > TestText = "Test - āĀēĒčČ..šŠūŪžŽ" # this is UTF-8 > TestText2 = b"Test2 - > \xc4\x81\xc4\x80\xc4\x93\xc4\x92\xc4\x8d\xc4\x8c..\xc5\xa1\xc5\xa0\xc5\xa...
Python: 'Private' module in a package Question: I have a package `mypack` with modules `mod_a` and `mod_b` in it. I intend the the package itself and `mod_a` to be imported freely: import mypack import mypack.mod_a However, I'd like to keep `mod_b` for the exclusive use of `mypack`. That's beca...
Tell pydev to exclude an entire package from analysis? Question: Today I'm on a mission to remove little red X's from my django project in pydev. Mostly, this involves fixing import problems with pydev. I'm using [South](http://south.aeracode.org/) for database migrations. South (if you don't know) generates python mo...
Creating a simple XML file using python Question: What are my options if I want to create a simple XML file in python? (library wise) The xml I want looks like: <root> <doc> <field1 name="blah">some value1</field1> <field2 name="asdfasd">some vlaue2</field2> </doc> <...
ctypes.windll.user32.GetCursorInfo() - how can I manage this to work? [Python] Question: I have to get the information about the current mouse cursor from windows but I'm not managing to work this command... what should I do? Can someone post one example? Answer: What information are you trying to get out of the Get...
Python matplotlib: memory not being released when specifying figure size Question: I'm using matplotlib to generate many plots of the results of a numerical simulation. The plots are used as frames in a video, and so I'm generating many of them by repeatedly calling a function similar to this one: from p...
Python: How exactly can you take a string, split it, reverse it and join it back together again? Question: How exactly can you take a string, split it, reverse it and join it back together again without the brackets, commas, etc. using python? Answer: >>> tmp = "a,b,cde" >>> tmp2 = tmp.split(',') >>> tmp...
UDP client and server with Twisted Python Question: I want to create a server and client that sends and receives UDP packets from the network using Twisted. I've already written this with sockets in Python, but want to take advantage of Twisted's callback and threading features. However, I need help though with the des...
Is this a problem with the Django tutorial or a package problem, or is it me? Question: I'm using Ubuntu 10, python 2.6.5 I'm following this tutorial: <http://www.djangobook.com/en/2.0/chapter02> I followed all of the steps using cut-and-paste. The following directory structure was automatically created: ...
How to write stereo wav files in Python? Question: The following code writes a simple sine at frequency 400Hz to a mono WAV file. How should this code be changed in order to produce a **stereo** WAV file. The second channel should be in a different frequency. import math import wave import struct...
Alternative to Passing Global Variables Around to Classes and Functions Question: I'm new to python, and I've been reading that using `global` to pass variables to other functions is considered noobie, as well as a bad practice. I would like to move away from using global variables, but I'm not sure what to do instead....
ImportError: no module named _jcc Question: I'm trying to install pylucene on python 2.7 (windows) since four days. It requires JCC to build and install. After thousands and thousands different errors I handled myself, at last JCC sucessfully builded and installed. At least, that was what I thought. After that, I tried...
Sql Alchemy > TypeError: 'instancemethod' object does not support item assignment Question: Here's what I've got: from sqlalchemy import * from sqlalchemy.orm import * from web.models.card import * connectionString = "postgresql://www:www@localhost/prod" databaseEngine = create_engine(con...
How to create a simple mesh in Blender 2.50 via the Python API Question: I would like to create a simple mesh in Blender (2.50) via the Python API but the examples from the API documentation don't work yet. I tried the following but it's [from API 2.49](http://www.blender.org/documentation/249PythonDoc/Mesh-module.htm...
Problem decrypting PGP in python with pyme without user interaction Question: I am trying to decrypt messages using pyme (a python wrapper from gpgme). It works fine if I type in the password when it prompts but I cannot get the passphrase callback to work. Here is the code import pyme.core def ...
how to shift a datetime object by 12 hours in python Question: Datetime objects hurt my head for some reason. I am writing to figure out how to shift a date time object by 12 hours. I also need to know how to figure out if two date time object's differ by say 1 minute or more. Answer: The [`datetime`](http://docs.pyt...
Python: why does my list change after I've retrieved it from an object Question: Simple question, I've scaled down a problem I'm having where a list which I've retrieve from an object is changing when I append more data to the object. Not to the list. Can anyone help my understand the behavior of python? ...
How to integrate Sikuli scripts into Selenium? Question: I'm extensively using [Selenium](http://seleniumhq.org/) for integration testing. Works great for all normal stuff (HTML/AJAX), but no go when I'm trying to test third party ActiveX, Java applets and Flash components. The solution I've found for this is [Sikuli]...
How to manipulate the response object in django-piston? Question: I have some existing python code that uses django-piston which returns a dictionary as its response. For example: from piston.handler import BaseHandler class FooHandler(BaseHandler): allowed_methods = ('GET',) ...
How would I go about downloading a file from a submitted link then reuploading to my server for streaming? Question: I'm working on a project where a user can submit a link to a sound file hosted on another site through a form. I'd like to download that file to my server and make it available for streaming. I might hav...
Run custom Django management command over SSH Question: I have a Django application with a custom management command in one of the apps. If I log in over SSH I can run it without any problems with > python manage.py sitedir/mycommand However, if I try to run the command as a oneliner from my local box like this: > s...
Why is the Python script unreliable when run from rc.local on first boot? Question: The script below works great when logged in as root and run from the command line, but when run at first boot using /etc/rc.local in Ubuntu 10.04, it fails about 25% of the time- the system root, mysql root and some mysql user passwords...
Python bizarre class problem Question: I have the following piece of code where I try to override a method: import Queue class PriorityQueue(Queue.PriorityQueue): def put(self, item): super(PriorityQueue, self).put((item.priority, item)) However, when I run it I get `TypeErr...
How do I add basic authentication to a Python REST request? Question: I have the following simple Python code that makes a simple post request to a REST service - params= { "param1" : param1, "param2" : param2, "param3" : param3 } xmlResults = urllib.urlopen(MY_APP_PATH, u...
IronPython, importing Modules Question: I follow the example from the best answer here to a T, compiling with Pyc.py. <http://stackoverflow.com/questions/2139202/build-python-scripts-and-call- methods-from-c> I get an exception at `pyScope = pyEngine.ImportModule("MyClass");` no module named MyClass ...
How to clear cookies in WebKit? Question: i'm currently working with PyWebKitGtk in python (http://live.gnome.org/PyWebKitGtk). I would like to clear all cookies in my own little browser. I found interesting method webkit.HTTPResponse.clearCookies() but I have no idea how to lay my hands on instance of HTTPResponse obj...
py2exe problems Question: c:\python26\setup.py py2exe Trying to run py2exe and when I get to command prompt I run the line above. However as opposed to converting my file it try's to open it. What am I doing wrong? Answer: You must create your own `setup.py` and then run it with py2exe: c:\m...
Propagating Clips Error Messages in PyClips Question: I'm finding it very difficult to develop with PyClips, because it appears to replace useful error messages thrown by Clips with a generic "syntax error" message. This makes debugging very laborious and practically impossible on large codebases when using PyClips. C...
python 2.6.x theading / signals /atexit fail on some versions? Question: I've seen a lot of questions related to this... but my code _works_ on python 2.6.2 and _fails_ to work on python 2.6.5. Am I wrong in thinking that the whole atexit "functions registered via this module are not called when the program is killed b...
Python set error reporting level like in PHP Question: How can I set error reporting and warning outputs in Python like in PHP `error_reporting(E_LEVEL)`? Answer: A vaguely related option might be the setting of level in the [`logging`](http://docs.python.org/library/logging.html) module of the Python standard librar...
Efficient way to store dictionary (hash) in file with python? Question: I'm implementing a Unix userland tool that needs to store a hash on the disk. The hash will be read every run of the program, pretty frequently. The hash needs to store "name:path" values only. I looked at the [bsddb](https://docs.python.org/2/lib...
Python ssl problem with multiprocessing Question: I want to send data from a client to the server in a TLS TCP socket from multiple client subprocesses so I share the same ssl socket with all subprocesses. Communication works with one subprocess, but if I use more than one subprocesses, the TLS server crashes with an `...
Using Python quick insert many columns into Sqlite\Mysql Question: If Newdata is list of x columns, How would get the number unique columns-- number of members of first tuple. (Len is not important.) Change the number of "?" to match columns and insert using the statement below. csr = con.cursor() cs...
Prototype for python? Question: I just learned Prototype for Javascript. It's super convenient: using the $ shortcut, accessing xml elements is not painful any more! The question: is there a Prototype-like extension for Python? Answer: Python has [lxml](http://codespeak.net/lxml/) which has the `xpath` method wherei...
Python subprocess timeout? Question: Is there any argument or options to setup a timeout for Python's subprocess.Popen method? Something like this: `subprocess.Popen(['..'], ..., timeout=20)` ? Answer: I would advise taking a look at the [Timer class](http://docs.python.org/2/library/threading.html#threading.Timer)...
Is this a good reason to check types in Python? Question: I know that checking types in Python is bad and you should probably never do it. But I can't seem to find the disadvantage to this. class O(object): def __init__(self, name): '''Can only be called in derived classes.''...
Getting pdb in Emacs to use Python process from current virtualenv Question: I am debugging some python code in emacs using pdb and getting some import issues. The dependencies are installed in one of my bespoked virtualenv environments. Pdb is stubbornly using /usr/bin/python and not the python process from my virtua...
How do you convert a stringed dictionary to a Python dictionary? Question: I have the following string which is a Python dictionary stringified: some_string = '{123: False, 456: True, 789: False}' How do I get the Python dictionary out of the above string? Answer: Use [**`ast.literal_eval`**](htt...
i got this error: "ImportError: cannot import name python" How do I fix it? Question: File "G:\Python25\Lib\site-packages\PyAMF-0.6b2-py2.5-win32.egg\pyamf\util\__init__.py", line 15, in <module> ImportError: cannot import name python How do I fix it? If you need any info to know how to fix this problem,...
WxPython - Resize WxFrame when adding new content? Question: Pretty much exactly as it sounds. I have buttons in a `Wx.Frame` that are created on the fly and I'd like the parent frame to increase in height as I add new buttons. The height is already being acquire from the total number of buttons multiplied by an intege...
Is there some website that has examples of every method in the python standard library? Question: For example, c++ have [cplusplus.com/reference](http://cplusplus.com/reference) which contain all of c++ standard library complete with definitions and more importantly examples, so I was wondering if there is such a websi...
Python meta-debugging Question: Heyo, Just started writing an assembler for the imaginary computer my class is creating wire-by-wire since the one the TA's provided sucks hard. I chose python even though I've never really used it that much (but know the basic syntax) and am loving it. My favorite ability is how I can...
Do you think/write differently in vim and emacs? Question: In many scripts that I write, I often construct programs in a "functional style". That is to say, I basically define a lot of functions at the beginning, and then later apply these functions. This results in a sequence of nested function calls, wherein I type o...
Python programming Question: My assignment ask to make a function call readFasta that accepts one argument: the name of a fasta format file (fn) containing one or more sequences. The function should read the file and return a dictionary where the keys are the fasta headers and the values are the corresponding sequences...
Connect Sphinx autodoc-skip-member to my function Question: I want to use [sphinx's autodoc-skip- member](http://sphinx.pocoo.org/ext/autodoc.html#event-autodoc-skip-member) event to select a portion of the members on a certain python class for documentation. But it isn't clear from the sphinx docs, and I can't find a...
creating xml tree from a textfile with Python Question: I need to avoid creating double branches in an xml tree when parsing a text file. Let's say the textfile is as follows (the order of lines is random): branch1:branch11:message11 branch1:branch12:message12 branch2:branch21:message21 branch2:branch22:message2...
Is there a way to run a python script that is inside a zip file from bash? Question: I know there is a way to import modules which are in a zip file with python. I created kind of custom python package library in a zip file. I would like to put as well my "task" script in this package, those are using the library. The...
On Google App Engine (GAE), how do I search on the Key/ID field? Question: I've got this code (Java, GAE): // Much earlier: playerKey = KeyFactory.keyToString(somePlayer.key); // Then, later... PersistenceManager pm = assassin.PMF.get().getPersistenceManager(); Key targetKey = K...
How to make a .exe for Python with good graphics? Question: I have a Python application and I decided to do a .exe to execute it. This is the code that I use to do the .exe: # -*- coding: cp1252 -*- from distutils.core import setup import py2exe, sys, os sys.argv.append('py2exe') ...
Run Python CGI Script on Windows XP Question: This exact question has been asked before but I am at my wits end! I've spend 4 hours trying to get a SIMPLE Python CGI script to work on Windows XP but I get errors. Please save my sanity! Python Script register.py #!c:/Python30/python.exe -u print...
Python function to solve Ax = b by back substitution Question: Okay, for my numerical methods class I have the following question: Write a Python function to solve Ax = b by back substitution, where A is an upper triangular nonsingular matrix. MATLAB code for this is on page 190 which you can use as a pseudocode guide...
Python text validation: a-z and comma (",") Question: I need to check that some text only contains lower-case letters a-z and a comma (","). What is the best way to do this in Python? Answer: import re def matches(s): return re.match("^[a-z,]*$", s) is not None Which gives you: ...
Namespaces in C# vs imports in Java and Python Question: In the Java and Python world, you look at a source file and know where all the imports come from (i.e. you know in which file the imported classes are defined). For example: In Java: import javafoo.Bar; public class MyClass { priv...
How to reload modules in django shell? Question: I am working with Django and use Django shell all the time. The annoying part is that while the Django server reloads on code changes, the shell does not, so every time I make a change to a method I am testing, I need to quit the shell and restart it, re-import all the m...
How can I selectively mask arbitrary data being sent over an insecure link? Question: I'm using an offsite error logging package for my python web application. When I send an error I include the contents of (among other things) the POST variable and some template data. Some of this data must not be sent to the error lo...
free implementation of counting user sessions from a web server log? Question: Web server log analyzers (e.g. Urchin) often display a number of "sessions". A session is defined as a series of page visits / clicks made by an individual within a limited, continuous time segment. The attempt is made to identify these segm...
Making all variables in a scope global or importing a module inside another module Question: I have a package with two modules in it. One is the `__init__` file, and the other is a separate part of the package. If I try `from mypackage import separatepart`, the code in the `__init__` module is run, which will run unnee...
How can I replace the class by monkey patching? Question: How can I replace the ORM class - so it should not cause recursion !!! _Problem_ : original class has the super call, when its got replaced - it causes self inheritance and causes maximum recursion depth exceed exception. i.e. class orm is calling super(orm...
How to submit web forms using Python? Question: First of all, sorry if this question is a little vague and rambling! I'm ok with Python, but I've never done anything HTTP related before. I'm trying to automate submitting a web form, and from reading some of [this page](http://www.jmarshall.com/easy/http/) I understand...
how to read password protected excel in python Question: I'm new to python programming, and I am trying to read a password protected file using python, the code is shown below: import sys import win32com.client xlApp = win32com.client.Dispatch("Excel.Application") print "Excel library ve...
get rhythmbox information from other user Question: I have Rhythmbox running on my desktop, and I want to be able to control it from remotely via a web interface. I'm having problems accessing it, however, because `rhythmbox-client` is complaining that the user (www-data) that is trying to access it doesn't a) have as ...
How to check if a word is an English word with Python? Question: I want to check in a Python program if a word is in the English dictionary. I believe nltk wordnet interface might be the way to go but I have no clue how to use it for such a simple task. def is_english_word(word): pass # how to I...
How to open SQL Compact database read only Question: There is a SQL Compact v3.1 database that I want to quickly read. I'm doing this in python so I don't have access to managed code. I've noticed that if I use adodbapi the database file actually gets modified just by opening it. And sadly when I add 'File mode=Read O...
How can you select a random element from a list, and have it be removed? Question: Let's say I have a list of colours, `colours = ['red', 'blue', 'green', 'purple']`. I then wish to call this python function that I hope exists, `random_object = random_choice(colours)`. Now, if random_object holds 'blue', I hope `colo...
Mapping Languages to Paradigms Question: I recently read Eric Steven Raymond's article "How To Become A Hacker" and I like his suggestion of learning 5 key languages (he suggests Python, C/C++, Lisp, Java, and Perl) as a way of covering the main programming paradigms in use today. His advice is that it's not so import...
python mechanize javascript submit button problem! Question: im making some script with mechanize.browser module. one of problem is all other thing is ok, but when submit() form,it not working, so i was found some suspicion source part. in the html source i was found such like following. im thinking, loginCheck(thi...
permissive equality test on string Question: I'm a python newbie with a problem too hard to tackle. I have a string defining a path, were all the spaces have been converted to underscores. How can I find if it corresponds to a real path? e.g. a string like `/some/path_to/directory_1/and_to/directory_2` with a real ...
uploading records of list of files in parallel using python to DB Question: I have a list of files each file have mass of records separting by \n , i need to proccess those records in parallel and upload them to some sql server could someone provide an idea what is the best way to do this with python Answer: The best...
IOError: request data read error Question: I seem to be getting an IOError: request data read error quite a lot when i'm doing an Ajax upload. For example out of every 5 file uploads it errors out on atleast 3. Other people seem to have had the same issue. Eg. * <http://stackoverflow.com/questions/2641665/django-up...
More pythonic way to write this? Question: I have this code here: import re def get_attr(str, attr): m = re.search(attr + r'=(\w+)', str) return None if not m else m.group(1) str = 'type=greeting hello=world' print get_attr(str, 'type') # greeting print get...
Python and C interaction - callback function Question: I'm trying to make a key logger for Mac OS for one of my research projects. I have a C code which will grab keystroke and write them to a text file. (The following code I have taken out some not important stuff) What I need to do now is just like PyHook, instead o...
Best way to change the value of "settings" from within a Python test case? Question: I'm writing unit tests in Python for the first time, for a Django app. I've struck a problem. In order to test a particular piece of functionality, I need to change the value of one of the app's settings. Here's my first attempt: ...
dynamic values in kwargs Question: I have a layer which helps me populating records from the form to tables and viceversa, it does some input checking, etc. Now several methods of this layer which are called several times in different parts of the webform take the same parameters, so I wanted to pack them at the begin...
Python, using subprocess.Popen to make linux command line call? I'm getting "[Errno 2] No such file or directory" Question: I'm trying to follow the info I can find about subprocess.Popen as I want to make a linux command line call.. I am trying as below but am getting the error "[Errno 2] No such file or directory". I...
Extension Crashing Python on Import? Question: I have a python extension that is built and installed through distutils (using mingw on windows). However on import of this module the interpreter crashes. Is there anyway to debug and figure out why it crashes? I did look around online and couldn't find anything specific...
Python: replacing method in calendar module Question: I'm trying to replace two methods in calendar module: import calendar c = calendar.HTMLCalendar(calendar.MONDAY) def ext_formatday(self, day, weekday, *notes): if day == 0: return '<td class="noday">&nbsp;</td>' ...
Best way to generate xml? Question: I'm creating an web api and need a good way to very quickly generate some well formatted xml. I cannot find any good way of doing this in python. Note: Some libraries look promising but either lack documentation or only output to files. Answer: [ElementTree](http://docs.python.org...
How to get the duration of a video in Python? Question: I need to get the video duration in Python. The video formats that I need to get are [MP4](http://en.wikipedia.org/wiki/MPEG-4_Part_14), Flash video, [AVI](http://en.wikipedia.org/wiki/Audio_Video_Interleave), and MOV... I have a shared hosting solution, so I have...
Python Asymmetric Encryption: Using pre-generated prv/pub keys Question: Ok first off yes I have searched google and stackoverflow and done some reading (over 4 hours JUST in this sitting) have not found what I need for these reasons: * Many of them suggest just launching an exe like gpg.exe (http://stackoverflow.co...
Is there a python equivalent of ruby's "Pathname" module? Question: Ruby has this really handy module called [Pathname](http://ruby- doc.org/core/classes/Pathname.html). Is there a python equivalent to it? Answer: `pathlib` is the answer to all your python path woos. Example functionality: from pathl...
Python and ADNS, falling in infinite loop somewhere Question: I have written some code that queries adns. Problem with this code is that it gets stuck, how? Let me explain it: * Say my dnslist is ["8.8.4.4", "8.8.8.8", "208.67.220.220", "208.67.222.222", "192.168.50.1"] * It would pop a dns from the list and quer...
Python doctest example failure Question: This is probably a silly question. I am experimenting with python doctest, and I try to run [this](http://docs.python.org/library/doctest.html#simple-usage-checking- examples-in-a-text-file) example ending with if __name__ == "__main__": import doctest ...
How to distinguish between a sequence and a mapping Question: I would like to perform an operation on an argument based on the fact that it might be a map-like object or a sequence-like object. I understand that no strategy is going to be 100% reliable for type-like checking, but I'm looking for a robust solution. Bas...
How to write tag deleter script in python Question: I want to implement a file reader (folders and subfolders) script which detects some tags and delete those tags from the files. The files are .cpp, .h .txt and .xml And they are hundreds of files under same folder. I have no idea about python, but people told me tha...
m2crypto: python 2.7 compatibility and which version of OpenSSL to use? Question: We've been using M2crypto with Python 2.6 for Windows (32-bit) for some time with great success. We used one of the user contributed setups to install M2crypto in our development environments. We would like to move to Python 2.7, but noti...
programmatically find and replace content dynamically in a string in python Question: i need to find and replace patterns in a string with a dynamically generated content. lets say i want to find all strings within '' in the string and double the string. a string like: `my 'cat' is 'white'` should become my `'catcat'...
Importing assemblies into IronPython from another assembly Question: I have an IronPython 2.6/2.7 script I am writing which imports a lot of assemblies. In other words, at the top of the script it does this... clr.AddReference( "System.Xml" ) import System.Xml Except it doesn't do this for 1 a...
How to bulk insert data to mysql with python Question: Currently i'm using Alchemy as a ORM, and I look for a way to speed up my insert operation, I have bundle of XML files to import for name in names: p=Product() p.name="xxx" session.commit() i use above code to insert my ...