Re: How to protect Python source from modification

2005-09-13 Thread Frank Millman
Magnus Lycka wrote: [snip lots of interesting stuff] > > > There is the question of where state should be maintained. If on the > > server, I would have to keep all the client/server connections open, > > and maintain the state of all the sessions, which would put quite a > > load on the server.

Re: How to protect Python source from modification

2005-09-13 Thread Frank Millman
Dennis Lee Bieber wrote: > On 13 Sep 2005 01:00:37 -0700, "Frank Millman" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > 2. I am a great believer in 'field-by-field' validation when doing data > > entry, instead of filling in the entire form, submitting it, and then > >

Re: improvements for the logging package

2005-09-13 Thread Thomas Heller
"Vinay Sajip" <[EMAIL PROTECTED]> writes: > Thomas Heller wrote: >> Yes, it seems so. Although I would have expected the documentation to >> inform me about incompatible changes in the api. > > It does, in the "in-development" version of the documentation. Sorry it > was not in the 2.4 releases :

Re: Tkinter add_cascade option_add

2005-09-13 Thread Eric Brunel
On Tue, 13 Sep 2005 22:31:31 -0600, Bob Greschke <[EMAIL PROTECTED]> wrote: > Root.option_add("*?*font", "Helvetica 12 bold") > > Want to get rid of the "font =": > Widget.add_cascade(label = "File", menu = Fi, font = "Helvetica 12 bold") > > Does anyone know what ? should be to control th

Re: p2exe using wine/cxoffice

2005-09-13 Thread Thomas Heller
James Stroud <[EMAIL PROTECTED]> writes: > Hello, > > My department has switched from vmware to wine/cxoffice. I have been > playing with this all morning, and I've gotten this far. If someone > has done this, could you point me in the right direction > > > euler 65% winpy > Enthought Edition buil

Where is the document of python-mode.el

2005-09-13 Thread JackPhil
I searched in the python-mode.el, sf.net, python.org, and found nothing Best regards -- http://mail.python.org/mailman/listinfo/python-list

Re: Static freeze

2005-09-13 Thread Martin v. Löwis
Grzegorz Dostatni wrote: > Is there a way to tell freeze to create a statically linked executable? > Freeze commandline does not appear to have that option. I'm sure that in a > day or two I can figure out the Makefile it generates and perhaps > substitute the object files to create what I need, bu

Re: regexps with unicode-aware characterclasses?

2005-09-13 Thread Martin v. Löwis
Stefan Rank wrote: > > > re.compile('|'.join([x.encode('utf8') for x in unicode.uppercase])) This would (almost) work, but it would be terribly inefficient (time linear to the number of alternatives). You can realistically do uppers = [u'['] for i in range(sys.maxunicode): c = unichr(i) i

Re: Unexpected Behavior Iterating over a Mutating Object

2005-09-13 Thread Fredrik Lundh
Dave Hansen wrote: > Again, iterating over an item that is mutating seems like a Bad > Idea(tm) to me. But I was curious: is this the intended behavior, or > does this fall under what C programmers would call 'undefined > behavior.' a C programmer wouldn't have much problem with this, of course,

Re: python/SSL/Certificate.

2005-09-13 Thread Martin v. Löwis
Vanessa PARISSE wrote: > In my website, the user connect in HTTPS whith a client certificate. > I would like to get the email in the certificate. > I'm trying to get the client certificate presented to the server. What does that have to do with Python? Are you trying to use Python on the client si

Re: retrieve data using FTP in Python

2005-09-13 Thread Fredrik Lundh
"swarna pulavarty" wrote: > I am new to this Python group and to Python . I need to retrieve data > from an arbitrary URL and save it to a file. if you have an URL, you can use the urllib module: urllib.urlretrieve(url, filename) > Can anyone tell me how to retrieve "any" data using FTP mod

Re: retrieve data using FTP in Python

2005-09-13 Thread Steve Holden
swarna pulavarty wrote: > Hi all, > > I am new to this Python group and to Python . I need to retrieve data > from an arbitrary URL and save it to a file. > Can anyone tell me how to retrieve "any" data using FTP modules in > Python ? And also, Can you suggest me some books and online reference

Re: Windows Python 2.4: Unbuffered flag causes SyntaxError oninteractive sessions?

2005-09-13 Thread Lonnie Princehouse
Will do -- http://mail.python.org/mailman/listinfo/python-list

Tkinter add_cascade option_add

2005-09-13 Thread Bob Greschke
Root.option_add("*?*font", "Helvetica 12 bold") Want to get rid of the "font =": Widget.add_cascade(label = "File", menu = Fi, font = "Helvetica 12 bold") Does anyone know what ? should be to control the font of the cascade menus (the labels on the menu bar)? "*Menu*font" handles the pa

Re: high performance hyperlink extraction

2005-09-13 Thread Bryan Olson
Adam Monsen wrote: > The following script is a high-performance link ( href="...">...) extractor. [...] > * extract links from text (most likey valid HTML) [...] > import re > import urllib > > whiteout = re.compile(r'\s+') > > # grabs hyperlinks from text > href_re = re.compile(r''' >

Re: Unexpected Behavior Iterating over a Mutating Object

2005-09-13 Thread Steve Holden
Delaney, Timothy (Tim) wrote: > Dave Hansen wrote: > > >>Again, iterating over an item that is mutating seems like a Bad >>Idea(tm) to me. > > > Absolutely. It can be safe to do it, but only if the iterator in > question supports it, and all modifications occur through the iterator > (this is h

Re: appended crontab entries with py script

2005-09-13 Thread Mike Meyer
rbt <[EMAIL PROTECTED]> writes: > How can I safely append a crontab entry to a crontab file > progammatically with Python? Well, one way would be to invoke the system crontab utility and use an "editor" that passes the file to your program, and reads the results back. > I need to handle crontabs

Re: SQL SERVER : how to access it from Python

2005-09-13 Thread could ildg
Use ADO.If you ever used vb, using ado in py is just the same.If you don't know about ado, you can refer to this url:http://www.mayukhbose.com/python/ado/what-is-ado.php On 9/14/05, Chavez Gutierrez, Freddy <[EMAIL PROTECTED]> wrote: Hi all. I like to access a SQL SERVER from a Python 2.4

Python Bindings for Dirac, (sorta announcement)

2005-09-13 Thread Michael Sparks
Hi, We're in the process of creating python bindings for Dirac. We currently have /decode/ of dirac functioning nicely, so I've packaged up the bindings separately from the rest of the Kamaelia project for those that are interested and would want a play. (Encoding will naturally follow next) To

Re: logging into one file problem

2005-09-13 Thread Vinay Sajip
Maksim Kasimov wrote: [Example snipped] Will the following do what you want? Don't add handlers in each module. Just add a handler to the root logger in the main script. Thus: module1.py: import logging logger = logging.getLogger('module1') #now use the logger in your code module2.py: import l

Re: Manging multiple Python installation

2005-09-13 Thread Andy Leszczynski
Jeremy Jones wrote: > I guess I'm still having a hard time understanding "what does it > matter?". I was under impression that configure embeds the prefix in the build itself. I was concerned to have to preform the configure/make every time I change the destination path. It turns out that the

Re: What XML lib to use?

2005-09-13 Thread Robert Kern
[EMAIL PROTECTED] wrote: > I have also heard excellent things about ElementTree; I haven't used it > myself though (largely because I can't find any resources on doing XML > canonicalization with it). You can use lxml which is an implementation of the ElementTree API using libxml2 and libxslt und

Re: improvements for the logging package

2005-09-13 Thread Vinay Sajip
Thomas Heller wrote: > Yes, it seems so. Although I would have expected the documentation to > inform me about incompatible changes in the api. It does, in the "in-development" version of the documentation. Sorry it was not in the 2.4 releases :-( http://www.python.org/dev/doc/devel/lib/minimal

retrieve data using FTP in Python

2005-09-13 Thread swarna pulavarty
Hi all,   I am new to this Python group and to Python . I need to retrieve data from an arbitrary URL and save it to a file. Can anyone tell me how to retrieve "any" data using FTP modules in Python ? And also, Can you suggest me some books and online references to get familiar with Python and esp

Re: Unexpected Behavior Iterating over a Mutating Object

2005-09-13 Thread Raymond Hettinger
[Dave Hansen] > It seems when an item is 'remove'd from data, the rest of the list > 'shifts' over one, so what was 'next' now occupies the slot of the > 'remove'd item. When the next 'item' is selected from 'data', the > _desired_ 'next' item is skipped. So when 'data' has several > consecutive

Re: Simplifying imports?

2005-09-13 Thread George Sakkis
"Terry Hancock" <[EMAIL PROTECTED]> wrote: > On Tuesday 13 September 2005 12:46 pm, George Sakkis wrote: > > Or even better, forget about the braindead java restriction of one > > class per file and organize your code as it makes more sense to you. > > While this is good sound Python advice, there

Create and display an email

2005-09-13 Thread Adam Endicott
I've got a wxPython based windows GUI application that takes some input and creates a PDF file output. At the end, I need to create an email message with this pdf file attached ready for the user to just hit "send". I don't want to actually send the email automatically, I just want to pop up a mess

Re: Unexpected Behavior Iterating over a Mutating Object

2005-09-13 Thread Scott David Daniels
Dave Hansen wrote: > ... data = [ 'First', 'Second DEL', 'Third', 'Fourth', >'Fifth DEL', 'DEL Sixth', 'Seventh DEL', 'Eighth DEL', >'Ninth DEL', 'Tenth', 'Eleventh', 'Twelfth'] bfr = [] for item in data: > if item.find('DEL') >= 0: > bfr.appe

Re: time.strptime() for different languages

2005-09-13 Thread Adam Monsen
One way I'm able to do further date parsing in other locales is to switch the locale for LC_TIME, bust the _strptime regular expressions manually, then call strptime() again. Here's a function to bust the cache. This works for me, but your mileage may vary. def bust_strptime_cache(): import _s

Re: Windows Python 2.4: Unbuffered flag causes SyntaxError oninteractive sessions?

2005-09-13 Thread Terry Reedy
"Lonnie Princehouse" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Weird. Did you build Python yourself? The 2.4.1 release on python.org > is from March 30. > I just tried ActiveState's 2.4.1... the same thing happens. Please report this on the SourceForge bug list, including t

Re: which is more 'pythonic' / 'better' ?

2005-09-13 Thread Steven Bethard
Peter Hansen wrote: > def meth(self, things=None): > self.things = things or [] > [snip] > > The alternative is fine too, but insisting on it would be pedantic, and > if you have more than one of these it is definitely less readable (and, > therefore, not Pythonic): > > def meth(self, thin

First release of Shed Skin, a Python-to-C++ compiler.

2005-09-13 Thread Mark Dufour
>You have achieved so much with the first release of Shed Skin that it's >strange to see you apparently trying to argue that exceptions aren't >necessary when in fact they are such a fundamental part of Python's >philosophy. To be honest, I am a relative newcomer to Python, and Shed Skin is the

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

2005-09-13 Thread Jeffrey E. Forcier
Erik: Thanks, that was it! Figured it was something along those lines, but like I said, I didn't know specifically what was going on or what to look for. Larry: That recipe could be useful, thanks a lot :) And thanks for the quick replies, too, you guys are awesome. Regards, Jeff -- http://ma

Re: What XML lib to use?

2005-09-13 Thread uche . ogbuji
""" I'm confused, I want to read/write XML files but I don't really understand what library to use. I've used DOM-based libraries in other languages, is PyXML the library to use? """ There are many options (some say too many): http://www.xml.com/pub/a/2004/10/13/py-xml.html Try out Amara Binder

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 Python do

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

2005-09-13 Thread Erik Max Francis
Jeffrey E. Forcier wrote: > Doing multiple print statements inside a for loop, using the 'comma at > the end eats the newline' variant, results in zero output until the > loop completes its entire iteration. sys.stdout is line buffered. Put an intervening sys.stdout.flush() in between your prin

Re: Unexpected Behavior Iterating over a Mutating Object

2005-09-13 Thread Larry Bates
You are correct if you remove items from a list that you are iterating over you get the results you see. You either need to iterate over the list in reverse order or better yet create a new list from the old one with the items removed. In Python 2.4 you can do: data = [ 'First', 'Second DEL', 'T

Printing w/o newlines inside loops - odd behavior

2005-09-13 Thread Jeffrey E. Forcier
This is a difficult issue to search for, and Googling (and reviewing the pertinent Python docs) has not found me anything useful. It's also not a super important issue, but regardless of whether it's avoidable, I still want to know what the heck is going on. Doing multiple print statements inside

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 morning, and I've g

Re: which is more 'pythonic' / 'better' ?

2005-09-13 Thread Peter Hansen
Ken Seehart wrote: > Will McGugan wrote: >> I would actualy use the following for this particular case.. >> >> text = line[n:n+1] or 'nothing' > Hey are you a perl programmer? That looks perlish to me. A python > programmer would never use "or" that way (even though it works). :) I don't thin

RE: Unexpected Behavior Iterating over a Mutating Object

2005-09-13 Thread Delaney, Timothy (Tim)
Dave Hansen wrote: > Again, iterating over an item that is mutating seems like a Bad > Idea(tm) to me. Absolutely. It can be safe to do it, but only if the iterator in question supports it, and all modifications occur through the iterator (this is how Java does it). In a Python for loop, the actu

p2exe using wine/cxoffice

2005-09-13 Thread James Stroud
Hello, My department has switched from vmware to wine/cxoffice. I have been playing with this all morning, and I've gotten this far. If someone has done this, could you point me in the right direction euler 65% winpy Enthought Edition build 1057 Python 2.3.3 (#51, Feb 16 2004, 04:07:52) [MSC v

Unexpected Behavior Iterating over a Mutating Object

2005-09-13 Thread Dave Hansen
OK, first, I don't often have the time to read this group, so apologies if this is a FAQ, though I couldn't find anything at python.org. Second, this isn't my code. I wouldn't do this. But a colleague did, got an unexpected result, and asked me why. I think I can infer what is occurring, and I

Re: which is more 'pythonic' / 'better' ?

2005-09-13 Thread Ken Seehart
Will McGugan wrote: > gabor wrote: > >> hi, >> >> there are 2 versions of a simple code. >> which is preferred? >> >> >> === >> if len(line) >= (n+1): >> text = line[n] >> else: >> text = 'nothing' >> === >> >> >> === >> try: >> text = line[n] >> except IndexError: >> text = 'nothi

Re: Premature wakeup of time.sleep()

2005-09-13 Thread Peter Hansen
Bengt Richter wrote: > On Mon, 12 Sep 2005 19:33:07 -0400, Peter Hansen <[EMAIL PROTECTED]> wrote: > > >>Steve Horsley wrote: >> >>>I think the sleep times are quantised to the granularity of the system >>>clock, shich varies from os to os. From memory, windows 95 has a 55mS >>>timer, NT is les

Re: Windows Python 2.4: Unbuffered flag causes SyntaxError on interactive sessions?

2005-09-13 Thread Michael Hoffman
Lonnie Princehouse wrote: > Weird. Did you build Python yourself? No. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows Python 2.4: Unbuffered flag causes SyntaxError on interactive sessions?

2005-09-13 Thread Lonnie Princehouse
Weird. Did you build Python yourself? The 2.4.1 release on python.org is from March 30. I just tried ActiveState's 2.4.1... the same thing happens. -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows Python 2.4: Unbuffered flag causes SyntaxError on interactive sessions?

2005-09-13 Thread Irmen de Jong
Michael Hoffman wrote: > Lonnie Princehouse wrote: > >> C:\>python -u >> Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] >> on win32 >> Type "help", "copyright", "credits" or "license" for more information. >> > print 'hello' >> >> >> File "", line 1 >> print 'hello

distutils equivalent of config.status?

2005-09-13 Thread skip
I like that configure always generates a config.status file for me. That way if I need to reconfigure an app with slightly different settings I can just grep config.status for "configure", paste, then tweak. Does/can distutils do that for me? I'd like it to be something either automatic or at le

Re: How to protect Python source from modification

2005-09-13 Thread Bryan Olson
bruno modulix wrote: > Frank Millman wrote: >>I am writing a multi-user accounting/business system. Data is stored in >>a database (PostgreSQL on Linux, SQL Server on Windows). I have written >>a Python program to run on the client, which uses wxPython as a gui, >>and connects to the database

SQL SERVER : how to access it from Python

2005-09-13 Thread Chavez Gutierrez, Freddy
Title: SQL SERVER : how to access it from Python Hi all. I like to access a SQL SERVER from a Python 2.4 script running on WinXP. I need to run store procedures and to query some tables. Where should I start to investigate this topic? Thanks for your help. Regards, Freddy Chavez. -- http

Re: Using Python with COM to communicate with proprietary Windows software

2005-09-13 Thread Joakim Persson
On Tue, 13 Sep 2005 10:15:18 +0200, Thomas Heller <[EMAIL PROTECTED]> wrote: >> This _shouldn't_ be too difficult -- I know which methods must be >> implemented (basically just some kind of event handling to deal with >> randomly arriving log points, should be implemented as "onMsg()" on my >> COM

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 library? I want to be able to access SMB sha

Re: Windows Python 2.4: Unbuffered flag causes SyntaxError on interactive sessions?

2005-09-13 Thread Michael Hoffman
Lonnie Princehouse wrote: > C:\>python -u > Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] > on win32 > Type "help", "copyright", "credits" or "license" for more information. > print 'hello' > > File "", line 1 > print 'hello' > ^ > SyntaxError: i

Re: PyGTK or wXPython?

2005-09-13 Thread Paul McNett
Jarek Zgoda wrote: > I would use wx, if it wasn't so dog slow on linux. Qt and GTK are much > faster, but each one has disadvantages. Finally, you get 3 GUI toolkits, > of which each claims to be "cross-platform", but each is working at > acceptable level of WTF only on one system (wx on Windows,

Re: wxPython StyledTextCtrl and tabs?

2005-09-13 Thread Lonnie Princehouse
That's exactly what I was looking for. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Windows Python 2.4: Unbuffered flag causes SyntaxError on interactive sessions?

2005-09-13 Thread Lonnie Princehouse
>From the cmd shell on both Windows 2k and XP, I'm getting this weird syntax error in conjunction with the unbuffered flag. It works fine without -u. Has anyone else encountered it? This didn't happen with Python 2.2... C:\>python -u Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit

Re: wxPython StyledTextCtrl and tabs?

2005-09-13 Thread MrJean1
Maybe the SetUseTabs() method helps. See this page and the summary at the top. Disclaimer: untested. /Jean Brouwers Lonnie Princehouse wrote: > Does anyone know of a way to make the wxPython StyledTextCtrl expand > tabs into spaces?

Re: high performance hyperlink extraction

2005-09-13 Thread felipevaldez
pretty nice, however, u wont capture the more and more common javascripted redirections, like click me nor http://www.yahoo.com";> nor http://www.yahoo.com"; name=x> . im guessing it also wont handle correctly thing like: click but you probably already knew all this stuff, didnt

Re: Premature wakeup of time.sleep()

2005-09-13 Thread Bengt Richter
On Mon, 12 Sep 2005 19:33:07 -0400, Peter Hansen <[EMAIL PROTECTED]> wrote: >Steve Horsley wrote: >> I think the sleep times are quantised to the granularity of the system >> clock, shich varies from os to os. From memory, windows 95 has a 55mS >> timer, NT is less (19mS?), Linux and solaris 1mS

Re: What XML lib to use?

2005-09-13 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: > I have also heard excellent things about ElementTree; I haven't used it > myself though (largely because I can't find any resources on doing XML > canonicalization with it). ElementTree/cElementTree is really easy to use and Pythonic. -- Michael Hoffman -- http://mail

Re: PyGTK or wXPython?

2005-09-13 Thread Jarek Zgoda
TPJ napisał(a): >>Beside this, wxPython (and wxWidgets) is often told to be more complete, >>better documented and better supported than GTK/PyGTK. > > Is wxPython often told to be more documented? By who? By me, for example. But I don't mind using wxWidgets C++ API documentation as wxPython ref

Re: help in simplification of code [string manipulation]

2005-09-13 Thread John
Thanks for your replies... Solved my problem. --j Christophe wrote: > John a écrit : > > How could I simplify the code to get libs out of LDFLAGS > > or vice versa automatically in the following python/scons code? > > > > if sys.platform[:5] == 'linux': > > env.Append (CPPFLAGS = '-D__LINUX')

Re: time.strptime intolerant on weekday string length?

2005-09-13 Thread Fredrik Lundh
> why bother parsing the day name at all? (just split the string at the first > command and use strptime on the rest) msg = msg.replace("command", "comma") -- http://mail.python.org/mailman/listinfo/python-list

Dr. Dobb's Python-URL! - weekly Python news and links (Sep 13)

2005-09-13 Thread Diez B. Roggisch
QOTW: "In my view, the doctrinaire', indeed religious, adherence to OO purity has harmed our discipline considerably. Python was a nice breath of fresh air when I discovered it exactly because it does not have this slavish committment to an exclusively OO model." -- Tim Daneliuk "[W]hen you add a

Re: What XML lib to use?

2005-09-13 Thread mekstran
On Tue, 13 Sep 2005 19:23:50 +0200 Kalle Anke <[EMAIL PROTECTED]> wrote: > I'm confused, I want to read/write XML files but I don't really > understand what library to use. > > I've used DOM-based libraries in other languages, is PyXML the > library to use? PyXML will do the job. I'm currently usi

Re: Python for ARM7?

2005-09-13 Thread Ken Seehart
Sybren Stuvel wrote: > Ken Seehart enlightened us with: > >>1. How do I know whether to use sharprom or modern? > > If it works, use it. That makes sense :) >>2. What do I do with ipk files? I surfed around and found that in >>one example, the command is "ipkg install foo.ipk", but ipkg doesn

Re: What XML lib to use?

2005-09-13 Thread Ramdas
You can try xml.dom and xml.sax. Both are inbuilt libraries with Python standard package. You can read and write xml files with these very easily. There are number of third party modules for Python that manipulate XML. But the above are the basic ones. -- http://mail.python.org/mailman/listinfo/p

Re: What XML lib to use?

2005-09-13 Thread Ramdas
You can try xml.dom and xml.sax. Both are inbuilt libraries with Python standard package. You can read and write xml files with these very easily. There are number of third party modules for Python that manipulate XML. But the above are the basic ones. -- http://mail.python.org/mailman/listinfo/p

Re: Detailed traceback

2005-09-13 Thread Fernando Perez
Echo wrote: > I have been working on handling unhanded exceptions and making a > detailed print out of the traceback after the exception. I found that > traceback.extract_tb worked nice and was quite simple. > > During my searching around I found out that it might be possible to > get the variabl

Re: Simplifying imports?

2005-09-13 Thread Terry Hancock
On Tuesday 13 September 2005 12:46 pm, George Sakkis wrote: > "Terry Hancock" <[EMAIL PROTECTED]> wrote: > > On Monday 12 September 2005 10:09 pm, [EMAIL PROTECTED] wrote: > > > I like to keep my classes each in a separate file with the same name of > > > the class. > > Apparently "foo" is already

Re: Python and file locking - NFS or MySQL?

2005-09-13 Thread Christopher DeMarco
Thanks for the reply; I somehow missed this entire thread in python-list. I'm going to give it a whirl, after digging a bit into the status quo of Linux' NFSv3 implementation. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Database Scripts

2005-09-13 Thread Chuck
Hi, thanks for (all) of your help. BTW, where is the DB-API docs for python? Thanks, --Chuck -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and file locking - NFS or MySQL?

2005-09-13 Thread Christopher DeMarco
Fredrik Lundh wrote: >os.link(tempfile, lockfile) # atomic! Fredrik, thanks for replying - I monitored python-list but didn't see anything. Gotta get a proper Usenet feed... Are you sure os.link() will be atomic over NFS? -- http://mail.python.org/mailman/listinfo/python-list

high performance hyperlink extraction

2005-09-13 Thread Adam Monsen
The following script is a high-performance link (...) extractor. I'm posting to this list in hopes that anyone interested will offer constructive criticism/suggestions/comments/etc. Mainly I'm curious what comments folks have on my regular expressions. Hopefully someone finds this kind of thing as

Re: Simplifying imports?

2005-09-13 Thread Steven D'Aprano
On Mon, 12 Sep 2005 20:09:31 -0700, chapolim-colorado wrote: > I like to keep my classes each in a separate file with the same name of > the class. The problem with that is that I end up with multiple imports > in the beginning of each file, like this: > > from foo.Bar import Bar > from foo.Blah

Re: Unfortunate newbie questions!

2005-09-13 Thread Chris Lasher
I would have to say that never having done any OO programming before in my life, I found _Learning_Python_ by Lutz & Ascher had a great couple of chapters on it. The diagrams about inheritance and subclassing really helped a lot and they describe the purpose of using OOP quite well. I see you alrea

Re: time.strptime intolerant on weekday string length?

2005-09-13 Thread Fredrik Lundh
Robert wrote: >A certain DAV server reports a time stamp as "Tues, 30 Aug 2005 20:48:31" > ( but not "Tue, ..." as usual) > I also don't see how to alter the pattern for strptime to be tolerante for > more long weekday strings? > Any ideas? why bother parsing the day name at all? (just split t

Re: First release of Shed Skin, a Python-to-C++ compiler.

2005-09-13 Thread A.B., Khalid
Mark Dufour wrote: > Thank you so much for your efforts! Don't mention it. > I will try to download your patches this afternoon on a roommate's Windows > computer, and try to see if I can fix the remaining tests. > Okay. An update. - Test (124, 'small factorization program by Rohit Krishna Ku

Re: which is more 'pythonic' / 'better' ?

2005-09-13 Thread Terry Reedy
"gabor" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > i'm sorry ;) it was a list of strings... > > the code was something like: > > for line in open('x.y'): > line = line.split('\t') > > a better naming would be better it seems :) Like 'fields', for a list of fields ;-? Or your

wxPython StyledTextCtrl and tabs?

2005-09-13 Thread Lonnie Princehouse
Does anyone know of a way to make the wxPython StyledTextCtrl expand tabs into spaces? (yes, I'm trying to use it to edit Python code :P) -- http://mail.python.org/mailman/listinfo/python-list

Re: Simplifying imports?

2005-09-13 Thread George Sakkis
"Terry Hancock" <[EMAIL PROTECTED]> wrote: > On Monday 12 September 2005 10:09 pm, [EMAIL PROTECTED] wrote: > > I like to keep my classes each in a separate file with the same name of > > the class. The problem with that is that I end up with multiple imports > > in the beginning of each file, lik

Re: PyGTK or wXPython?

2005-09-13 Thread Peter Decker
On 9/13/05, Grant Edwards <[EMAIL PROTECTED]> wrote: > Anyway, there are some lighter-weight wrappers that make the > API more Pythonic and hide the nasty stuff like the id and flag > parameters. I tried "wax" a while back and it looked > promising. I looked at Wax, too, but as of last spring it

Subject: Re: Unfortunate newbie questions!

2005-09-13 Thread CPIM Ronin
Thanks Colin and Alessandro! Alessandro, I've found most of your references and am going through them! RC From: "Colin J. Williams" <[EMAIL PROTECTED]> To: python-list@python.org Subject: Re: Unfortunate newbie questions! Date: Mon, 12 Sep 2005 15:06:58 -0400 CPIM Ronin wrote: Hi Folks, I'm

Re: Ctypes Install in Linux

2005-09-13 Thread Ernesto
THANKS !!! -- http://mail.python.org/mailman/listinfo/python-list

What XML lib to use?

2005-09-13 Thread Kalle Anke
I'm confused, I want to read/write XML files but I don't really understand what library to use. I've used DOM-based libraries in other languages, is PyXML the library to use? -- http://mail.python.org/mailman/listinfo/python-list

Re: FTP Error: Windows AS/400

2005-09-13 Thread Peter A.Schott
I've used DOS FTP to hit AS/400 systems before and usually have to completely qualify the file name or ensure that I'm in the correct directory. When you use command-line FTP to get the file, do these commands mimic your commands? What version of python are you using? If you issue PWD on the FTP

Re: Launching Python programs from Linux shell script

2005-09-13 Thread Magnus Lycka
Ernesto wrote: > Thanks! How do you add Python in Linux to the path? This works out of the box in most modern Linux distributions. If you're open to suggestions, I'd suggest that you have a look at Ubuntu. It's a user friendly Linux distribution with rather close ties to the Python community.

Re: How to protect Python source from modification

2005-09-13 Thread Magnus Lycka
Frank Millman wrote: > Hi all > > I am writing a multi-user accounting/business system. Good! > The client program contains all the authentication and business logic. Not good. You lose...if it's *only* in the client. Of course, there is no such thing as a safe system, and you need a pragmatic

time.strptime intolerant on weekday string length?

2005-09-13 Thread Robert
A certain DAV server reports a time stamp as "Tues, 30 Aug 2005 20:48:31" ( but not "Tue, ..." as usual) This produces the error below. >>> time.strptime("Tue, 30 Aug 2005 20:48:31","%a, %d %b %Y %H:%M:%S") (2005, 8, 30, 20, 48, 31, 1, 242, -1) >>> time.strptime("Tues, 30 Aug 2005 20:48:31","%a,

Re: How to protect Python source from modification

2005-09-13 Thread Bugs
Thanks Frank, I appreciate the feedback. -- http://mail.python.org/mailman/listinfo/python-list

Re: FTP Windows AS/400

2005-09-13 Thread Brendan Bispham
Hi Tim, On Tuesday 13 September 2005 17:31, Tim G. wrote: > I cannot get the script to switch from native to IFS. Yes you can... > Traceback (most recent call last): > File "C:\Python24\Tools\scripts\ftp400.py", line 9, in ? > ftp.cwd(path) It's the cwd which is having a problem > here

FTP Windows AS/400

2005-09-13 Thread Tim G.
I am trying to execute a win python script that connects to an AS/400; changes from the native lib to the IFS file system; then, changes to a directory in IFS; gets a file. Any help would be greatly appreciated. I cannot get the script to switch from native to IFS. I get the following error: Tr

Re: make sure entire string was parsed

2005-09-13 Thread Steven Bethard
Paul McGuire wrote: > I still don't know the BNF you are working from Just to satisfy any curiosity you might have, it's the Penn TreeBank format: http://www.cis.upenn.edu/~treebank/ (Except that the actual Penn Treebank data unfortunately differs from the format spec in a few ways.) > 1. I'm s

Sorting Unix mailboxes

2005-09-13 Thread [EMAIL PROTECTED]
I'm writing a program in python to sort the mail in standard Unix email boxes. In my "prof of concept" example I am coping a letter to a second mailbox if the letter was send from a particular email address. When I read the destination mailbox with cat, I can see that something is getting copied to

Re: Simplifying imports?

2005-09-13 Thread chapolim-colorado
bruno modulix wrote: >Let me guess: you have a C++ or Java background ? You're right, I come from Java :). I'm still learning the Pythonic approach. Thank you guys Chapolim -- http://mail.python.org/mailman/listinfo/python-list

http://www.paysatwarning.com

2005-09-13 Thread bayvision
http://www.paysatwarning.com -- http://mail.python.org/mailman/listinfo/python-list

FTP Error: Windows AS/400

2005-09-13 Thread Tim G.
I am trying to use Win Python to ftp files from an AS/400 IFS directory down to my Windows machine. I seem to get stuck when I am trying to send a command to the AS/400 to switch file systems from native to IFS and then to issue a cd to my folder. I get the error below. If anyone has had experie

Re: py2app without a mac?

2005-09-13 Thread Robert Kern
Gregory Piñero wrote: > That's an interesting idea, Tony. My program uses things like wxPython, > PythonCard, etc, so would distutils know to package that stuff? Do you > know what distutils commands I would use? If not, I'll look it up later > today. Sure. bdist_mpkg, which is provided with py

Re: improvements for the logging package

2005-09-13 Thread Mike C. Fletcher
[EMAIL PROTECTED] wrote: >Vinay> Well, it seems a little too late now, for unittest, threading, > logging >Vinay> and probably a few more. > >Correct, as I indicated. > > ... >Vinay> What would you suggest for threading, unittest etc. in terms of >Vinay> binding more unix_like_

  1   2   >