Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by sebsauvage

  1. sebsauvage

    Text field decleration

    See the struct module. http://docs.python.org/lib/module-struct.html The unpack() method should do the trick.
  2. sebsauvage

    How to put Variable Value in a List Name?

    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]
  3. sebsauvage

    Newbie to python

    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...
  4. sebsauvage

    UDP Sockets

    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...
  5. sebsauvage

    os.remove() -> Permission denied

    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...
  6. sebsauvage

    A problem in choosing language

    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...
  7. sebsauvage

    A problem in choosing language

    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...
  8. sebsauvage

    Database lookup problem

    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...
  9. sebsauvage

    Python ADO

    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...
  10. sebsauvage

    Can someone please help me?>

    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)...
  11. sebsauvage

    Module to Innumberate the drives???

    Usenet is your friend :-) http://mail.python.org/pipermail/python-list/2001-May/040745.html
  12. sebsauvage

    Regular Expression Syntax

    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...
  13. sebsauvage

    Formatted output in python

    You may also have be interested in the Pretty-printer module. http://python.org/doc/current/lib/module-pprint.html
  14. sebsauvage

    file contents searching

    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.
  15. sebsauvage

    adding a path to windows path environment

    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...

Part and Inventory Search

Back
Top