Re: Store multiple dictionaries in a file

2005-06-30 Thread Larry Bates
You might want to take a look at the shelve module. -Larry Philipp H. Mohr wrote: > Hello, > > I would like to store multiple dictionaries in a file, if possible one per > line. My code currently produces a new dictionary every iteration and > passes it on to another peace of code. In order to b

Re: Python for everything?

2005-06-30 Thread Larry Bates
mmit to learning one language extremely well instead of jumping all over with different languages that you can remember only poorly. When new version of Python ships, you just learn what is new. If you try to keep up with C, C++, Visual Basic, ... it gets to be impossible. Hope information helps.

Re: Newbie backreference question

2005-06-30 Thread Larry Bates
a='test string' print a.split()[:-1] I'm assuming that you want the last space separated word? Larry Bates paulm wrote: > Hi, > In perl I can do something like: > > $a = 'test string'; > $a =~ /test (\w+)/; > $b = $1; > print

Re: Windows installation - questions about DLLs

2005-07-01 Thread Larry Bates
Take a look at py2exe it provides a way to "collect" all necessary files together for you. Add Inno Installer to the mix and you can create setup.exe insallation programs that don't require a Python install to distribute software. -Larry Bates Guillaume Hiron wrote: >

calldll compiled for Python 2.4 for Windows

2005-07-01 Thread Larry Bates
ilable on my machine. Thanks in advance for any assistance. Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Lisp development with macros faster than Python development?..

2005-07-06 Thread Larry Bates
t and then it is fixed in 100's (or 1000's) of existing programs that use it. -Larry Bates [EMAIL PROTECTED] wrote: > I've been reading the beloved Paul Graham's "Hackers and Painters". > He claims he developed a web app at light speed using Lisp and lots > of

Re: Windows Cmd.exe Window

2005-07-07 Thread Larry Bates
-" t=raw_input("Press return to continue") sys.exit(2) # # set sys.excepthook # sys.excepthook=Myexcepthook # # create an uncaught divide by zero exception # a=1/0 -Larry Bates Giles Brown wrote: > For my sins I'm a MS Windows user at work and apart

Re: Options to integrate Python modules into native windows applications

2005-07-07 Thread Larry Bates
pywin32 and COM is good. Seems to work for me. Other methods (services, sockets, pipes, etc.) can also work well, but it depends on what you want to do and how you wish to communicate between the modules. Larry Bates Philippe C. Martin wrote: > Hi, > > I am looking for the pros an

Upgrading from Python 2.2 to 2.4 (can't find _ssl.pyd)

2005-07-07 Thread Larry Bates
Anybody have a copy they can share? Thanks in advance, Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Upgrading from Python 2.2 to 2.4 (can't find _ssl.pyd)

2005-07-07 Thread Larry Bates
Never mind. Seems that the standard distribution at www.python.org has it included (I was using ActiveState). FYI, Larry Larry Bates wrote: > Well I'm still on my "quest". I've been putting this > off for quite some time because I KNEW it was going to > be hard

Re: cursor positioning

2005-07-11 Thread Larry Bates
While not "curses" based this class will update screen as you want. You could use it as a basis upon which to do a curses version with your cursor positioning. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/299207 -Larry Bates Mage wrote: > Dear All, >

Re: Building a function call?

2005-07-13 Thread Larry Bates
"x=", x, " y=", y return def doanother(x, y, z): print "x=", x, " y=", y, " z=", z return xdict={'dothat': dothat, 'doanother': doanother} s='dothat' t=(1,2) xdict[s](*t) results in: x= 1

Re: String Manipulation

2005-07-13 Thread Larry Bates
x27;) # # Strip out the punctuation characters # for line in ifp: for punctuation in punctuations: line=line.replace(punctuation,'') ofp.write(line) # # I'll leave the other part for homework but # you will need to use the .find method of the string # ifp.close() ofp.c

2.4 Recent File list not working

2005-07-13 Thread Larry Bates
seems to do any good. Has anyone else had this problem? Any ideas how I might fix it? Thanks in advance for your assistance. Regards, Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Date & time in a Zip File

2005-07-13 Thread Larry Bates
When I add files to my .ZIP files using python zipfile module the date/time that is stored in mine is the one that comes from the file's attributes. I'm not sure I understand why you think yours are not. -Larry Bates Tim Williams (gmail) wrote: > Using zipfile.Zipfile > > H

Re: Native ODBC access for python on linux?

2005-07-14 Thread Larry Bates
lways better performing and support more features because ODBC is basically a lowest common denominator approach. The native API can provide access to all the (even unique) features of the particular database IMHO-For Python to MySQL on Linux use the native interface is the way to go. Larry Bates [

Re: GUI - Windows: Where to get started

2005-07-27 Thread Larry Bates
First you need to pick up a copy of Python Programming for Win32 book. It is a good starting place for GUI as well as COM and writing services. It was well worth the price to me. -Larry Ernesto wrote: > Hi all, > > Would anyone know a good place to start for learning how to build > simple GUI'

Re: can list comprehensions replace map?

2005-07-27 Thread Larry Bates
n(x)-len(y))*[None],y) I would probably wrap into function: def foo(x,y): if len(x) > len(y): return zip(x,y+(len(x)-len(y))*[None]) return zip(x+(len(x)-len(y))*[None],y) Larry Bates David Isaac wrote: > Newbie question: > > I have been generally open to the

Re: Hiding

2005-07-29 Thread Larry Bates
ymedia to play such files. Here are some links that might be of interest: http://www.win32com.de/index.php?option=com_content&task=view&id=141&Itemid=259 http://pymedia.org/tut/ Larry Bates Jay wrote: > Well, im not no expert on the python programming language but i just > want

Re: Printing to printer

2005-08-12 Thread Larry Bates
I adapted some code from David Boddie into a Python class to write directly to Linux print queues. I have used it in one project and it worked just fine. I've attached a copy for your use. You are free to use it as you wish, with no guarantees or warranties. Hope it helps. Larry Bates

Re: UCALC equivalent

2005-08-12 Thread Larry Bates
Python has built in eval function and doesn't require a library. Larry Bates Dark Cowherd wrote: > http://www.ucalc.com/mathparser/index.html > > There is a great library called UCALC which allows you to set up an > expression and evaluate it > for e.g. you an define an exp

Re: class-call a function in a function -problem

2005-08-16 Thread Larry Bates
Try something like: class ludzik: # # Define an __init__ method that gets called when # you instantiate the class. Notice also that I've # allowed you to set x, and y parameters if you like. # If you don't pass them they default to 1 and 2 as # in your example. #

Re: Save Binary data.

2005-08-19 Thread Larry Bates
them back apart anyway so keeping them as individual files is a benefit. Larry Bates GMane Python wrote: > Hello All. > I have a program that downloads 'gigabytes' of Axis NetCam photos per day. > Right now, I set up the process to put the images into a queue, and every 30 &g

Re: Netware Python?

2005-08-19 Thread Larry Bates
s/clements/clements.html http://forge.novell.com/modules/xfmod/project/?jythonnwkit http://www.novell.com/products/openenterpriseserver/ Larry Bates GMane Python wrote: > Hello all. Looking, I have not found a version of Python which runs on > Netware by Novell. I wonder, since Java the

Re: trying to check the creation date of a file

2005-08-19 Thread Larry Bates
use os.stat docs are here: http://docs.python.org/lib/module-stat.html Larry Bates David Fickbohm wrote: > People, > > I am trying to determine the creation date of files in a folder. > I am using the following code to find the folder and confirm that files > exist in the fold

Re: Exploring outlook using python

2005-08-24 Thread Larry Bates
You should download source for spambayes plug-in for Outlook (written in Python) located at: http://spambayes.sourceforge.net/windows.html You might finds LOTS of good information for your project. -Larry Bates Subir wrote: > Hi, > > I am new to this group. I am trying to

Re: Fighting Spam with Python

2005-08-25 Thread Larry Bates
Before you do too much work you should probably check out: http://spambayes.sourceforge.net/ There has already been a lot of work done on this project. FYI, Larry David MacQuigg wrote: > Are you as mad about spam as I am? Are you frustrated with the > pessimism and lack of progress these last

Re: Python / web

2005-09-01 Thread Larry Bates
an it would be to do in WebLogic or WebSphere. With flexibility comes complexity. For less complex needs there are other more lightweight things like CherryPy. Hope info helps. Larry Bates Robert wrote: > Hi, > I know general Python pretty well and interested in using Python for a > w

Re: Add lists to class?

2005-09-01 Thread Larry Bates
empty list. You can then do things like: a.one.append(something) a.three.append(something) Larry Bates BBands wrote: > I have a list with some strings in in it, 'one', 'two' 'three' and so > on. I would like to add lists to a class with those names. I have no

Re: Cleaning strings with Regular Expressions

2005-09-06 Thread Larry Bates
May not be what you are looking for, but this works: import os s='setAttr ".ftn" -type "string" ' \ '/assets/chars/boya/geo/textures/lod1/ppbhat.tga";' fname=os.path.basename(s.split()[-1]) BTW-It does depend on the file/path being the last it

Re: job scheduling framework?

2005-09-08 Thread Larry Bates
Google turned up these links that might be of interest: http://www.foretec.com/python/workshops/1998-11/demosession/hoegl/ http://www.webwareforpython.org/Webware/TaskKit/Docs/QuickStart.html http://www.slac.stanford.edu/BFROOT/www/Computing/Distributed/Bookkeeping/SJM/SJMMain.htm Larry Bates

Re: Help! Python either hangs or core dumps when calling C malloc

2005-09-08 Thread Larry Bates
Question: Why not just use Python to read the file? f=open(filename, 'rb') fcontents=f.read() If you need to manipulate what is in fcontents you can use struct module and/or slicing. Larry Bates Lil wrote: > Hi Everyone! I've been trying to figure out this weird bug in my &

Re: python script under windows

2005-09-09 Thread Larry Bates
Making a Python program into a service isn't all that "tedious". Get a copy of Mark Hammonds "Python Programming on Win32" which contains excellent examples on how to do this. I've written several and after the first one, it is quite easy to do. -Larry Bates

Re: simple problem with os.rename() parameters - path with spaces

2005-09-09 Thread Larry Bates
Are you sure the source directory exists and you have rights to rename it? Because the rename works for me. But you may want to look at shutil.move and/or use forward slashes (they work under Windows) -Larry Bates Tom wrote: > I'm having a problem using a path with spaces as a para

Re: nested tuples

2005-09-09 Thread Larry Bates
The first question is why do you need tuples? But this works: import csv filename=r'C:\test.txt' fp=open(filename,'r') reader=csv.reader(fp) tlines=tuple([tuple(x) for x in reader]) fp.close() Larry Bates Luis P. Mendes wrote: > Hi, > > I'm trying to so

Re: How to handle very large MIME Messages with the email package?

2005-09-12 Thread Larry Bates
h better way to send 100Mb files. Larry Bates [EMAIL PROTECTED] wrote: > Looking at the email package, it seems all the MIMExxx classes takes > string but not file object as the payload. I need to handle very large > MIME messages say up to 100M. And possibly many of them. Is email > pa

Re: OCR librarys

2005-09-12 Thread Larry Bates
You need to specify a "platform" you will be running on. I've had good experience with ExperVision's RTK toolkit on Windows. It is not free, but it is very, very good. Sometimes software is actually worth paying for ;-). Larry Bates Timothy Smith wrote: > i'm l

Re: Python and SMB, again...

2005-09-13 Thread Larry Bates
You might want to take a look at Webdrive (www.webdrive.com). It does what I "think" you are describing for ftp, http, https, and WebDAV. -Larry Bates Atila Olah wrote: > On 1997/06/05 Peter Henning wrote: > >>SMB, ldap, imap4rev1 >> >>Is there an SMB librar

Re: p2exe using wine/cxoffice

2005-09-13 Thread Larry Bates
I know Thomas Heller monitors this list but you should probably post this to gmane.comp.python.py2exe as it is the py2exe newsgroup. FYI, Larry Bates James Stroud wrote: > Hello, > > My department has switched from vmware to wine/cxoffice. I have been playing > with this all morni

Re: Unexpected Behavior Iterating over a Mutating Object

2005-09-13 Thread Larry Bates
ot x.endswith('DEL')] This also is much easier to read (IMHO) than the loops, etc. of the original code. In Python 2.4 list comprehensions are also quite efficient. Larry Bates Dave Hansen wrote: > OK, first, I don't often have the time to read this group, so > apologies if this

Re: Printing w/o newlines inside loops - odd behavior

2005-09-13 Thread Larry Bates
Take a look at this recipe which is part of the latest Python Cookbook. I think it will help you. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/299207 Larry Bates Jeffrey E. Forcier wrote: > This is a difficult issue to search for, and Googling (and reviewing > the pertinent

Re: Python CSV writer confusion.

2005-09-15 Thread Larry Bates
(not tested): import csv . . . outfile=open(r'D:\path\to\filename_sort1.csv', 'w') CSVwriter=csv.writer(outfile, dialect='excel', delimiter='|') CSVwriter.writerows(images) Larry Bates > > > if __name__ == '__main__': > images = read_i

Re: Creating Pie Chart from Python

2005-09-15 Thread Larry Bates
ReportLab Graphics. -Larry Bates Thierry Lam wrote: > Let's say I have the following data: > > 500 objects: > -100 are red > -300 are blue > -the rest are green > > Is there some python package which can represent the above information > in a pie chart? &

Re: Accessing shared library file...

2005-09-15 Thread Larry Bates
You need to tell us what library file (.dll) are you accessing on Windows. The interface to whatever the .dll is used for will most likely be completely different on Linux. -Larry Bates Ernesto wrote: > I'm in the process of moving a Python application from Windows to > Linux. This

Re: encryption with python?

2005-09-16 Thread Larry Bates
I've successfully used this toolkit to implement AES encryption in a recent project. http://www.amk.ca/python/code/crypto -Larry Bates Robert Kern wrote: > Ed Hotchkiss wrote: > >>What's the best module for encryption with python, anyone out there >>using py

Re: Lines of Strings

2005-09-16 Thread Larry Bates
If these were the lines what would the output look like? >From your example it doesn't appear that any of the lines would be eliminated. Larry Bates Reem Mohammed wrote: > Hi > > Suppose we have data file like this one (Consider all lines as strings ) > > 1 2 3 3 4 4

Re: dictionary to file

2005-09-16 Thread Larry Bates
You don't define what you mean by "a lot". Python can read a tremendous amount of information from files in a very short amount of time so I wouldn't try to prematurely optimize this. Just read the information and see how long it takes. If it is really a long time, then look for alternatives. It

Re: very high-level IO functions?

2005-09-19 Thread Larry Bates
te a class with a interator that can read the data from the file/table and return the PROPER data types as lists, tuples, or dictionaries that are easy to manipulate. -Larry Bates York wrote: > Hi, > > R language has very high-level IO functions, its read.table can read a > total .csv

Re: very high-level IO functions?

2005-09-19 Thread Larry Bates
t;value2" # "1","2","3" # "2","4","5" # "3","6","7" table=csv.DictReader(fp) for record in table: # # Record is a dictionary with keys as fieldnames # and values of the data in each record #

Re: Object default value

2005-09-20 Thread Larry Bates
The prints can be done by defining an __str__ method on the class, but I don't think you will get the type(obj) to work the way you want. class obj(object): __default=1 y=2 def __str__(self): return str(self.__default) myobj=obj() print "myobj=", myobj print "myobj.y=", myobj

Re: What am I doing wrong?

2005-09-21 Thread Larry Bates
f, folders = None): self.folders=folders or [] -Larry Bates keithlackey wrote: > I'm relatively new to python and I've run into this problem. > > > DECLARING CLASS > > class structure: > def __init__(self, folders = []): >

Re: Access CSV data by column name..

2005-09-21 Thread Larry Bates
'c:\test.txt','r') inputfile=csv.DictReader(fp) for record in inputfile: print record fp.close() {'city': 'Atlanta', 'name': 'James R. Smith', 'zip': '30301', 'telephone': '4045551212', '

Re: Performance Issues of MySQL with Python

2005-02-09 Thread Larry Bates
this area, YET. I hope my random thoughts are helpful. Larry Bates sandy wrote: Hi All, I am a newbie to MySQL and Python. At the first place, I would like to know what are the general performance issues (if any) of using MySQL with Python. By performance, I wanted to know how will the speed be, wh

Re: Datatype of non-negative values

2005-02-09 Thread Larry Bates
What exactly do you want to happen when result would be negative? I'll guess be zero: pseudocode: x=value x=max(x-something, 0) That way if it goes negative, it sticks to zero. Larry Bates Dirk Hagemann wrote: Hi, Is there a datatype in python which allows no negative values? I subtract se

Re: two questions - no common theme

2005-02-09 Thread Larry Bates
sted) also. Larry Bates Sean McIlroy wrote: And now for a pair of questions that are completely different: 1) I'd like to be able to bind callbacks to presses of the arrow buttons on the keyboard. How do you say that in Tkinter? 2) The function 'listdir' in os.path returns a list of a

Re: Newbie: SWIG or SIP?

2005-02-09 Thread Larry Bates
orked with .DLLs from many different manufacturers. Tricky part is having a full definition of API to dll (e.g. argument types) and using struct module to communicate between Python and the .DLL. Larry Bates Brent W. Hughes wrote: I have a third-party DLL and it's associated .h file. The DLL w

Re: Commerical graphing packages?

2005-02-11 Thread Larry Bates
ReportLab has pretty good Graphics Module. About the only thing it needs is Python Imaging Library (which you would probably want anyway). Larry Bates Erik Johnson wrote: I am wanting to generate dynamic graphs for our website and would rather not invest the time in developing the code to

Re: dos box appears when clicking .pyc

2005-02-12 Thread Larry Bates
Change the association for .pyc files to pythonw.exe from python.exe. Larry Bates Philippe C. Martin wrote: Hi, For a few months now, I have been used .pyc script under XP without getting the "DOS" box. I just re-installed the scripts on another XP box and am now getting the DOS box ! So

Re: Tuple index

2005-02-20 Thread Larry Bates
Tuples don't have all the nice methods that lists have so convert it to a list. tuple=('a','b','c','d') l=list(tuple) now you can do: list.index('c') which returns 2 Remember index returns -1 when nothing is found. Larry Bates Steve

Re: A few q's on python files.

2005-02-21 Thread Larry Bates
this takes some getting accustomed to. Larry Bates Joseph Quigley wrote: > hiya, > i'm new to python (by a week) but am learning fast (that's what I like > about python--it's simplicity). I got disgusted with C and C++ (i was > learning) probably because of a bad co

Re: web status display for long running program

2005-02-25 Thread Larry Bates
Not exactly on point, but this is what I use in many of my programs to show progress on long running console apps. Larry Bates class progressbarClass: def __init__(self, finalcount, progresschar=None): import sys self.finalcount=finalcount self.blockcount=0

Re: Splitting strings - by iterators?

2005-02-25 Thread Larry Bates
) I don't think I would never read 400,000 lines as a single string and then split it. Just a suggestion. Larry Bates Jeremy Sanders wrote: > I have a large string containing lines of text separated by '\n'. I'm > currently using text.splitlines(True) to break the text

Re: Splitting strings - by iterators?

2005-02-25 Thread Larry Bates
, 25 Feb 2005 10:57:59 -0600, Larry Bates wrote: > > >>How did you get the string in memory in the first place? > > > They're actually from a generated python script, acting as a saved file > format, something like: > > interpret(""" > lots of l

Re: Controlling Pc From Server?

2005-02-28 Thread Larry Bates
egitimate reason for people to be at that site. Hope info helps. Larry Bates [EMAIL PROTECTED] wrote: > Hello Kartic & NG, > > Thank you for your prompt answer. In effect, I'm trying to work on > a NT network of 6 PC (plus the server). Sorry to not have been clearer. >

Re: Working with dbase files

2005-02-28 Thread Larry Bates
On MS Windows use built in ODBC support to xBase files which supports read and write access. Larry Bates Stan Cook wrote: > Does anyone know how I can access and read data from a dbase (.dbf) file? > > Regards, > > Stan -- http://mail.python.org/mailman/listinfo/python-list

Re: ZoDB's capabilities

2005-02-28 Thread Larry Bates
There is a VERY large website that uses Zope/ZODB that takes up to 9000 hits per second when it gets busy. ZODB is very fast and holds up well under load. You should probably look at Plone. It is CMS already built on top of Zope. Might safe you a LOT of work. Larry Bates Almad wrote

Re: binutils "strings" like functionality?

2005-03-03 Thread Larry Bates
Take a look at python's struct module in the standard library. Many people use it to manipulate binary objects at the byte level with great success. Larry Bates cjl wrote: > Hey all: > > I am working on a little script that needs to pull the strings out of a > binary file, an

Re: enum question

2005-03-04 Thread Larry Bates
t;> x.value=11 error, x not in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> x.value=8 >>> Larry Bates M.N.A.Smadi wrote: > does python support a C-like enum statement where one can define a > variable with prespesified range of values? > > thanks > m.smadi -- http://mail.python.org/mailman/listinfo/python-list

Re: programmatically calling a function

2005-03-07 Thread Larry Bates
I see lots of others have made suggestions, but here is a method that I use frequently: define a dictionary that contains references to your functions: def foo(): . . whatever it does . def bar(): . . whatever it does . xfer={'foo', foo, 'bar', bar} Then you can write for fname in fnames:

py2exe error: 2.4.2.4: No such file or directory

2005-03-07 Thread Larry Bates
hon22\\lib\\site-packages\\wxPython'] error: 2.4.2.4: No such file or directory The only thing that I can think of is that perhaps I've upgraded my wxWindows version. I checked and 2.4.2.4 is the version, but I don't know why py2exe is looking for such a directory. Anybody out there have a clue? Thanks in advance, Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe error: 2.4.2.4: No such file or directory

2005-03-08 Thread Larry Bates
Thomas, Right on the mark. Thanks for the help. Larry Bates Thomas Heller wrote: > Larry Bates <[EMAIL PROTECTED]> writes: > > >>I had occasion to look back at a project I did over a year ago >>and needed to make one small change. I use py2exe to package >

Re: os.walk(entire filesystem)

2005-03-09 Thread Larry Bates
d Windows tries to read a directory and errors. Just follow what Peter Hansen has suggested and write a wrapper function that calls os.walk repeatedly for all the actual drives in your system that are readable at all times. It isn't all that hard. Larry Bates rbt wrote: > More of an OS

Re: modifiable config files in compiled code?

2005-03-10 Thread Larry Bates
es that are required to registry or my .INI file. 4) Have Inno Installer compile everything together into setup.exe viola' you have a single file that can be installed on any computer that will run without Python installation. -Larry Bates [EMAIL PROTECTED] wrote: > Hi All, > > I

Re: Logging global assignments

2005-03-11 Thread Larry Bates
are > probably doomed to failure. > > Is there any way of injecting some of my code into the process of > global name binding, or some other means of "capturing" global > assignments ? Suggestion: Use ConfigParser to set your globals instead and you can track yo

Re: pre-PEP: Print Without Intervening Space

2005-03-11 Thread Larry Bates
bs-mode: nil >sentence-end-double-space: t >fill-column: 70 >End: I also don't miss a no-space option on print. I've always believed that print statements with commas in them were for simple output with little or no regard for formatting (like for debugging statements). If I want precisely formatted output I use '%' formats or I build the output line manually with joins or some other mechanism. The ''.join(seq) or ''.join([fn(x) for x in seq]) says exactly what is being done to create the output string. I fail to see why your proposed solution of: for x in seq: print fn(x),, print is clearer than: print ''.join([fn(x) for x in seq]) Also your statement: print 'The phone number is (',,extension,,')', number,,'.' requires three double commas and can already be written more clearly as: print 'The phone number is ('+extension+') '+number'.' or even more clearly (as you stated) print 'The phone number is (%s) %s' % (extension, number) Just my 2 cents. Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: executing non-Python conde

2005-03-11 Thread Larry Bates
control you want and/or if it is a Windows GUI .exe. Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: PythonWin

2005-03-14 Thread Larry Bates
;) f.SetOFNTitle("Open Text File") result=f.DoModal() if result == win32con.IDCANCEL: sys.exit() print "path selected=", f.GetPathName() print "Filename selected=", f.GetFileName() Hope it helps. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing C readable bitfield structs?

2005-03-16 Thread Larry Bates
> struct.pack is in the Standard Library and allows you to do what you want. You may find that you must also do some "bit twiddling" using << shift functions and | bit or function if you want to pack tighter than on 4 bit boundaries. Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: ConfigParser

2005-03-17 Thread Larry Bates
tartswith('password_')] passwordentries.sort() # If you want to process them in order or to get list of passwords passwordlist=[INI.get(section, pk) for pk in passwordentries] Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create datetime object from DbiDate (win32.odbc)?

2005-03-17 Thread Larry Bates
time object manually. However, if > I try dir(d), where d is a DbiDate object, I get an empty list, so I > cannot even see how to extract the elements. > > Does anyone know if this is possible, and if so, how? > > Many thanks > > Frank Millman > I've always used

Re: create/access dynamic growth list

2005-03-18 Thread Larry Bates
ll take a shot. fp=open(conf_data, 'r') macro_lines=fp.readlines() fp.close() After this macro_lines will be a list with one line per element such that macro_list[0] is the first line, macro_list[1] the second, etc. Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Building web graphics with Python

2004-11-29 Thread Larry Bates
ReportLab Graphics module can produce graphics and then save into many formats via Python Imaging Library (PIL). Larry Bates Steven Feil wrote: I am wondering if there is a light weight Python library for producing web graphics on-the-fly. There is a C-language library called gd that can be used

Re: disk based dictionaries

2004-12-02 Thread Larry Bates
/adytumsolutions/HowToLoveZODB_PartII/HowToLoveZODB_PartI http://www.h7.dion.ne.jp/~harm/ZODB-Tutorial.py Larry Bates Shivram U wrote: Hi, I want to store dictionaries on disk. I had a look at a few modules like bsddb, shelve etc. However would it be possible for me to do the following hash[1] = [1, 2, 3] where

Re: Display Adapter Information from Registry?

2004-12-03 Thread Larry Bates
This eliminates the need to have Python (and any extensions) installed on the target machines. I (and many others) do this for all my Windows software that is to be distributed. Hope information helps. Larry Bates Omer Ahmad wrote: Hi All, I've been working with python for about 6 months now, and

Re: Sorting in huge files

2004-12-07 Thread Larry Bates
mysql database if you want other processing on the records. The alternative is a good high-speed sort like Syncsort, etc. Good Luck, Larry Bates Paul wrote: Hi all I have a sorting problem, but my experience with Python is rather limited (3 days), so I am running this by the list first. I have a large

Re: Python 2.3.5 ?

2004-12-07 Thread Larry Bates
Just because 2.4 arrives doesn't mean that ALL work is stopped on 2.3. It is quite common to have releases overlap. The very newest release is put out (2.4) , but bugs are still being fixed in older (2.3). Larry Bates Luis M. Gonzalez wrote: I'm confussed... Python 2.4 (final) hs bee

Re: Clarification of two concepts (or maybe one?)

2004-12-11 Thread Larry Bates
necessary python .dlls. 2) Something to create a distribution. On Windows a popular choice seems to be Inno Installer. It creates a single setup.exe file that can be distributed and is very flexible. Hope info helps. Larry Bates Syscon, Inc. Fredrik Lundh wrote: Eddie Parker wrote: What I’m

Re: Fun with Outlook and MAPI

2004-12-11 Thread Larry Bates
messages. http://motion.technolust.cx/related/send_jpg.py Here is a link to a class that wraps everything up very nicely. You should be able to be sending SMTP emails with it in 10-15 minutes. It supports binary attachments as well. FYI, Larry Bates Chris wrote: I'm trying to send an e-mail th

Re: predict directory write permission under windows?

2004-12-13 Thread Larry Bates
My method isn't elegant, but I use tempfile to create a tempfile in the directory (inside a try block). If it works, closing the file makes it go away. Larry Bates Syscon, Inc. Qiangning Hong wrote: I want to know if I can write files into a directory before I actually perferm the write be

Re: Accessing DB2 with Python

2004-12-16 Thread Larry Bates
I just tried the link at it works from here. Site has source and Windows binary versions of software. Looks loke it is being maintained. Windows binary for Python 2.3 was added in September 2004. No 2.4 binary. Larry Bates Syscon, Inc. Shawn Milo wrote: Is anyone doing this? I would like to

Re: Permission

2004-12-17 Thread Larry Bates
will be precise. Permisssion denied means that you don't have permission to rename this file. Normally this is a rights issue. BTW-os.rename works on XP. Larry Bates Syscon, Inc. -g00t©- wrote: --( oo )-- I don't know if there's a beginner board, just tell me if it&#x

Re: expression form of one-to-many dict?

2004-12-17 Thread Larry Bates
Steven, Suggestion: It is a bad idea to name any variable "map". When you do, you destroy your ability to call Python's map function. Same goes for "list", "str", or any other built-in function. If you haven't been bitten by this you will, I was. Larry

Re: Emailing in Python

2004-12-14 Thread Larry Bates
Great class for making this very easy located here: http://motion.sourceforge.net/related/send_jpg.py And is supports list of binary attachments that is pretty tricky by hand. Larry Bates Syscon, Inc. Philippe Reynolds wrote: Hi, I'm learning python...one of my tasks is to send out emails

Re: how to pass globals across modules (wxPython)

2004-12-20 Thread Larry Bates
self.mainFrame.Show() self.SetTopWindow(self.mainFrame) return True This might not be the "best" way, but seems to work and models what wxWindows appears to do internally. Larry Bates Syscon, Inc. Martin Drautzburg wrote: My wxPython program starts execution in mainFrame.py like this

Re: Lowest hassle Python web server?

2005-03-23 Thread Larry Bates
thon than Java? > - Is there anything similar to JSP in Java? > > Thanks, > KanZen > You might want to take a look a Medusa. It is the basis for the web server that is bundled in Zope. http://www.nightmare.com/medusa/ Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Pattern matching from a text document

2005-03-24 Thread Larry Bates
CSV module (for reading comma delimited files) or you might just be able to use simple .split() method (for tab delimited files). Hope info helps. Regards, Larry Bates Ben wrote: > I'm currently trying to develop a demonstrator in python for an > ontology of a football team. At presen

Re: Grouping code by indentation - feature or ******?

2005-03-25 Thread Larry Bates
ually the introduction of functions/classes that divide the deeply nested grouping into more manageable and debuggable pieces. Larry Bates Tim Tyler wrote: > What do you guys think about Python's grouping of code via indentation? > > Is it good - perhaps because it saves space a

Re: Grouping code by indentation - feature or ******?

2005-03-25 Thread Larry Bates
ng, but it is consistent with other languages that allow single-line blocks this freedom and I don't have a problem with "you can put one line after the colon but not more than one" rule. Larry Bates James Stroud wrote: > On Friday 25 March 2005 08:39 am, Ivan Van Laningham wrote

Re: Suggest more finesse, please. I/O and sequences.

2005-03-25 Thread Larry Bates
d, count in wordsLst: outFile.write("%7s : %i\n" % (word, count)) I guess you assumed all your words were less than 7 characters long (which I copied). But there are many other "good" ways I'm sure. Larry Bates Qertoip wrote: > Would you like to suggest me any improvem

Re: breaking up is hard to do

2005-03-25 Thread Larry Bates
'trace': 0, 'debuglevel': 2, 'outputfile': 'outfile.txt'} F=foo(**global_dict) Then if your nesting goes deeper, just pass **kwargs to functions or classes that are lower down. Hope this helps. Larry Bates bbands wrote: > I've a 2,000 line and g

<    1   2   3   4   5   6   7   8   9   10   >