Why not create a list of lists ?
blx = [] # Create an empty list
for i in range(10):
blx.append( [1,2,3,4] )
# Print all the lists:
print blx
# Print the 4th list:
print blx[3]
Is there a python release that will run under DOS ?
Yes.
http://members.lycos.co.uk/bdeck/pythond.htm
540k limit
I haven't tried, but my guess is that Python is not better than perl on memory usage.
I think the DOS Python version is compiled with a Dos extender, and is not subject to the 640...
mmmm... strange.
I did not play with UDP under Python, but odds are that UDP works under Windows with Python.
(There are several UDP-based Python program which run under Windows.)
Basically, you use the example below:
http://python.org/doc/current/lib/socket-example.html
Except that you use...
If the system says "Permission denied", it's either because the user you are logged in does not have the rights to delete this file, or this file is still in use by another program.
Changing this file to "not protected" state involves either granting you rights on this file...
And at O'Reilly, I also read:
« It’s a highly adaptable (and scalable), full-featured, object-oriented programming language that’s suitable for a wide variety of jobs. It's stable and mature, has large and powerful standard libraries, and integrates extremely well with C, C++, or Java code, and...
It is commonly admitted that developping in Python is faster than in Java or C++ because these languages are more verbose.
Bruce Eckel, member of the ANSI C++ Comitee, author of several books ("Thinking in Java","Thinking in C++"...) wrote: "I feel Python was designed...
He didn't quote the value.
This should be:
def lookupHdw( barcode ):
(hdwLook, success) = conn.Execute("SELECT emp FROM table1 WHERE CPU = '" + barcode+ "'")
Response.Write( hdwLook.Fields("emp").Value )
And for security reason, he'd better protect his...
I found this link in my archives: http://www.e-coli.net/pyado.html
Note that instead of ADO, you can also use ODBC to access databases:
http://sebsauvage.net/python/snyppets/index.html#odbc
You can also manipulate SQL Server 2000 from Python using SQL-DMO COM objects (and script whatever you...
Ok. Got it.
When you say:
class clic:
list=[]
y=clicbox()
You're saying: "list and y are class attributes, not objects attributes."
This means that there will be only 1 list object shared among all clic class instances.
And it's the same for y.
That's why crap.printclic(0)...
Hello !
First remark:
You'd better move the re.compile() out of your loop so that the regular expression is not recompiled for each line of the input file.
Second remark:
I think regular expressions are overkill here.
string.find() or .startwith() methods would be better suited for what you...
Take a look at those modules:
glob, listdir or os.path.walk+fnmatch to get the list of files.
open to read files.
re for regular expressions.
You will achieve what you want with these modules.
Each time a new process starts, it inherits its environnement from the application which started it.
Thus your Python script inherits the environement of the system.
But altering it (by manipulating os.environ) will only alter its local copy of the system environement, not the system...
If you want to track how many time "open_try.py" has been run, you should put the following lines at the beginning of "open_try.py":
counterfilename = 'open_try.count'
try:
file=open(counterfilename,'r')
counter = int(file.readline())
file.close()
counter +=...
Sure !
You need the win32all module.
You have the choice:
- You can download it separetely and install it over Python (see http://starship.python.net/crew/mhammond/win32/ or http://www.python.org/windows/win32/)
- or use a Pyhton distribution which already includes the win32all modules (like...
Why not give a try at the SMTP Python module ?
http://python.org/doc/current/lib/module-smtplib.html
It's easy to use:
http://python.org/doc/current/lib/SMTP-example.html
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.