Gajim 0.8

2005-08-19 Thread asterix
Gajim 0.8 is now available. Gajim is a Jabber client for GTK+/GNOME. Home Page: http://gajim.org Downloads: http://www.gajim.org/downloads.php New in Gajim 0.8: # Avatars (JEP-0153) # Chat state notifications aka. typing notification (JEP-0085)

Re: while c = f.read(1)

2005-08-19 Thread Bengt Richter
On 18 Aug 2005 22:21:53 -0700, Greg McIntyre [EMAIL PROTECTED] wrote: I have a Python snippet: f = open(blah.txt, r) while True: c = f.read(1) if c == '': break # EOF # ... work on c Is some way to make this code more compact and simple? It's a bit spaghetti. This is what

Re: while c = f.read(1)

2005-08-19 Thread Robert Kern
Greg McIntyre wrote: I have a Python snippet: f = open(blah.txt, r) while True: c = f.read(1) if c == '': break # EOF # ... work on c Is some way to make this code more compact and simple? It's a bit spaghetti. That's not spaghetti. Not even close. In any case,

Re: certificate-based authentication (Martin v. L?wis)

2005-08-19 Thread Martin v. Löwis
I'm using Python version 2.2 - the SafeTransport class in it's xmlrpclib doesn't have a 'get_host_info' method. Which version were you referring to? I was looking at the HEAD revision in CVS. That feature was apparently released with Python 2.3. Still, httplib supports client certificates

Re: while c = f.read(1)

2005-08-19 Thread Donn Cave
Quoth Greg McIntyre [EMAIL PROTECTED]: | I have a Python snippet: | | f = open(blah.txt, r) | while True: | c = f.read(1) | if c == '': break # EOF | # ... work on c | | Is some way to make this code more compact and simple? It's a bit | spaghetti. Actually I'd make it a

Re: while c = f.read(1)

2005-08-19 Thread John Machin
Greg McIntyre wrote: I have a Python snippet: f = open(blah.txt, r) while True: c = f.read(1) if c == '': break # EOF That could read like this if not c: break # EOF # see below for comments on what is true/false # ... work on c Is some way to make this code more

Re: while c = f.read(1)

2005-08-19 Thread John Machin
Bengt Richter wrote: On 18 Aug 2005 22:21:53 -0700, Greg McIntyre [EMAIL PROTECTED] wrote: I have a Python snippet: f = open(blah.txt, r) while True: c = f.read(1) if c == '': break # EOF # ... work on c Is some way to make this code more compact and simple? It's a bit

Re: Implementing class methods in C

2005-08-19 Thread Adriaan Renting
I think you'd need to write a C++ class that has the methods you want to implement in C++, then wrap that with SWIG, then inherit from that, though multiple inheritance if you also need functions from a base Python class. The PyQt people use SIP I think, instead of SWIG, might be useful to look

Re: time.clock() problem under linux (precision=0.01s)

2005-08-19 Thread Adriaan Renting
One of the limits of at least IBM compatible PC's is that in general they are not more accurate as about 1/64 th of a second if I recall correctly. I think this is the default tick size of the BIOS clock. Next to that the BIOS clock itself doesn't need to be very accurate, I can easily drift

Re: python html

2005-08-19 Thread [EMAIL PROTECTED]
Steve Young wrote: Hi, I am looking for something where I can go through a html page and make change the url's for all the links, images, href's, etc... easily. If anyone knows of something, please let me know. Thanks. BeautifulSoup or PyMeld Lorenzo --

Database of non standard library modules...

2005-08-19 Thread Jon Hewer
Is there an online database of non standard library modules for Python? Quite often people who email this list are after a module to do a certain task. If it doesn't exist I think that an online database, to which people could add details of modules, and which people could search, would be an

Re: Database of non standard library modules...

2005-08-19 Thread Robert Kern
Jon Hewer wrote: Is there an online database of non standard library modules for Python? http://cheeseshop.python.org/pypi -- Robert Kern [EMAIL PROTECTED] In the fields of hell where the grass grows high Are the graves of dreams allowed to die. -- Richard Harter --

Problem (or even bug?) with Tkinter

2005-08-19 Thread Matt Hammond
Here's a strange one in Tkinter that has me stumped: (I'm running python 2.4 on Suse Linux 9.3 64bit) I'm trying to make a set of Entry widgets with Label widgets to the left of each one, using the grid layout. If I make and grid the Label *before* the Entry then the Entry widget doesn't seem

global interpreter lock

2005-08-19 Thread km
Hi all, is true parallelism possible in python ? or atleast in the coming versions ? is global interpreter lock a bane in this context ? regards, KM -- http://mail.python.org/mailman/listinfo/python-list

Re: global interpreter lock

2005-08-19 Thread Paul Rubin
km [EMAIL PROTECTED] writes: is true parallelism possible in python ? or atleast in the coming versions ? is global interpreter lock a bane in this context ? http://poshmodule.sf.net -- http://mail.python.org/mailman/listinfo/python-list

Re: how do i add a new path into sys.path?

2005-08-19 Thread Steve Holden
James Sungjin Kim wrote: Steve Holden wrote: sys.path.append(rC:\Temp) In this case, do I need to save the refined path, i.e, the original paths + the new path (rC:\Temp), by using some command in order to use it permanently. if yes, it would be greatly appreciated to noitce the

Re: Python jobs (was Re: Python for Webscripting (like PHP))

2005-08-19 Thread Steve Holden
Aahz wrote: In article [EMAIL PROTECTED], Steve Holden [EMAIL PROTECTED] wrote: There's informal evidence that the Python secret is getting out. Sharpen up your resumes, guys, you may not have to limit Python to home usage soon :-) OTOH, the big sucking sound from Google and Yahoo

Re: global interpreter lock

2005-08-19 Thread Robin Becker
Paul Rubin wrote: km [EMAIL PROTECTED] writes: is true parallelism possible in python ? or atleast in the coming versions ? is global interpreter lock a bane in this context ? http://poshmodule.sf.net Is posh maintained? The page mentions 2003 as the last date. -- Robin Becker --

Re: Database of non standard library modules...

2005-08-19 Thread Steve Holden
Robert Kern wrote: Jon Hewer wrote: Is there an online database of non standard library modules for Python? http://cheeseshop.python.org/pypi While cheeseshop might resonate with the Monty Python fans I have to say I think the name sucks in terms of explaining what to expect. If I ask

Re: global interpreter lock

2005-08-19 Thread Paul Rubin
Robin Becker [EMAIL PROTECTED] writes: http://poshmodule.sf.net Is posh maintained? The page mentions 2003 as the last date. Dunno, and I suspect not. I've been wondering about it myself. -- http://mail.python.org/mailman/listinfo/python-list

Python on Palm??

2005-08-19 Thread Kalle Anke
Is there some implementation of Python that runs on Palm OS? I've found Python to Palm Pilot Port http://www.isr.uci.edu/projects/sensos/python/ and Pippy http://sourceforge.net/projects/pippy which both seem to be based on Python 1.5 Is there some implementation that implements later

Re: while c = f.read(1)

2005-08-19 Thread en.karpachov
On 18 Aug 2005 22:21:53 -0700 Greg McIntyre wrote: I have a Python snippet: f = open(blah.txt, r) while True: c = f.read(1) if c == '': break # EOF # ... work on c Is some way to make this code more compact and simple? It's a bit spaghetti. import itertools f =

Re: while c = f.read(1)

2005-08-19 Thread Paul Rubin
[EMAIL PROTECTED] writes: import itertools f = open(blah.txt, r) for c in itertools.chain(*f): print c # ... The f is iterable itself, yielding a new line from the file every time. Lines are iterable as well, so the itertools.chain iterates through each line and yields a

VIAGRRÁ-Good for your life

2005-08-19 Thread Xavier Burger
Hello, Welto PharmcyByMail ST0RE- Save huge 70% on all the 0rders with us.come We are there whionly stoch gives this great deal to you! VlALLlS VALy other drugplAGRRA ClUUM and mans in our sho r NEW PRlCESCheck out ou Have a nice day. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem (or even bug?) with Tkinter

2005-08-19 Thread Eric Brunel
On Fri, 19 Aug 2005 09:53:20 +0100, Matt Hammond [EMAIL PROTECTED] wrote: Here's a strange one in Tkinter that has me stumped: (I'm running python 2.4 on Suse Linux 9.3 64bit) I'm trying to make a set of Entry widgets with Label widgets to the left of each one, using the grid layout. If I

Re: Implementing class methods in C

2005-08-19 Thread BranoZ
[EMAIL PROTECTED] wrote: Am I misunderstanding the purpose of PyObject* self? No. I think you do everything right, but it still doesn't work. I have tried to implement it in Python: _test.py: def func2(self, *args): print type(self)

Re: Database of non standard library modules...

2005-08-19 Thread Thomas Heller
Steve Holden [EMAIL PROTECTED] writes: Robert Kern wrote: Jon Hewer wrote: Is there an online database of non standard library modules for Python? http://cheeseshop.python.org/pypi While cheeseshop might resonate with the Monty Python fans I have to say I think the name sucks in terms of

Re: Python for Webscripting (like PHP)

2005-08-19 Thread paron
Yes the stdlib offers all the basic functions, but why work so hard? Get CherryPy (http://www.cherrypy.org) and relax a bit. You'll be able to concentrate on Python for the backend, HTML for the frontend, without a lot of directory-diddling. Also, check out

Re: while c = f.read(1)

2005-08-19 Thread Robert Kern
[EMAIL PROTECTED] wrote: import itertools f = open(blah.txt, r) for c in itertools.chain(*f): print c # ... The f is iterable itself, yielding a new line from the file every time. Lines are iterable as well, so the itertools.chain iterates through each line and yields a

Re: Database of non standard library modules...

2005-08-19 Thread Alessandro Bottoni
Robert Kern wrote: Jon Hewer wrote: Is there an online database of non standard library modules for Python? http://cheeseshop.python.org/pypi Actually, there are many other Python source code and apps repositories. Here a few links, just in case you was not aware of them:

Re: while c = f.read(1)

2005-08-19 Thread en.karpachov
On 19 Aug 2005 03:43:31 -0700 Paul Rubin wrote: [EMAIL PROTECTED] writes: import itertools f = open(blah.txt, r) for c in itertools.chain(*f): But that can burn an unlimited amount of memory if there are long stretches of the file with no newlines. There's no real good way around

Re: Python for Webscripting (like PHP)

2005-08-19 Thread Jon Hewer
I like the look of cheeryPy - snyone know if its easy to get it running on top of Apache? Thanks On 19 Aug 2005 04:10:23 -0700, paron [EMAIL PROTECTED] wrote: Yes the stdlib offers all the basic functions, but why work so hard? Get CherryPy (http://www.cherrypy.org) and relax a bit. You'll be

Re: Python for Webscripting (like PHP)

2005-08-19 Thread Jon Hewer
'cherryPy' even On 8/19/05, Jon Hewer [EMAIL PROTECTED] wrote: I like the look of cheeryPy - snyone know if its easy to get it running on top of Apache? Thanks On 19 Aug 2005 04:10:23 -0700, paron [EMAIL PROTECTED] wrote: Yes the stdlib offers all the basic functions, but why work so

Re: Python for Webscripting (like PHP)

2005-08-19 Thread paron
Yes, there's a tutorial about that -- there are several options depending on the URL structure you want to expose, and your version of Apache. None of them are torturous, though. Start at http://www.cherrypy.org/wiki/CherryPyProductionSetup and follow the links down. Ron --

Re: Python for Webscripting (like PHP)

2005-08-19 Thread Jon Hewer
Ah cool, thanks, i hadn't spotted that page :) On 19 Aug 2005 04:51:06 -0700, paron [EMAIL PROTECTED] wrote: Yes, there's a tutorial about that -- there are several options depending on the URL structure you want to expose, and your version of Apache. None of them are torturous, though.

Re: Database of non standard library modules...

2005-08-19 Thread Richie Hindle
[Steve] While cheeseshop might resonate with the Monty Python fans I have to say I think the name sucks in terms of explaining what to expect. If I ask someone where I can find a piece of code and the direct me to the cheese shop, I might look for another language. +1 -- Richie Hindle

Re: Database of non standard library modules...

2005-08-19 Thread A.M. Kuchling
On Fri, 19 Aug 2005 10:33:16 +0100, Steve Holden [EMAIL PROTECTED] wrote: While cheeseshop might resonate with the Monty Python fans I have to say I think the name sucks in terms of explaining what to expect. If I ask someone where I can find a piece of code and the direct me to the

Re: how do i add a new path into sys.path?

2005-08-19 Thread Peter Hansen
Steve Holden wrote: The method I outlined works only for the duration of a single program run, because the sys.path variable is set up each time you run the Python interpreter. You need to look at the suggestions you've had for setting the PYTHONPATH environment variable to effect changes

Re: Python on Palm??

2005-08-19 Thread Peter Hansen
Kalle Anke wrote: Is there some implementation of Python that runs on Palm OS? I've found Python to Palm Pilot Port http://www.isr.uci.edu/projects/sensos/python/ and Pippy http://sourceforge.net/projects/pippy which both seem to be based on Python 1.5 Is there some implementation

Adobe COM with Python

2005-08-19 Thread Andy W
I'm wanting to automate Adove Acrobat Reader using Com thru Python and win32com, but i can't find any documentation for the Adobe stuff? Has anyone done anything with Acrobat COM ? I've searched Google groups and the web but am unable to find anything. Thanks Andy --

Re: up to date books?

2005-08-19 Thread Magnus Lycka
John Salerno wrote: These all seem to be focused on Java though. I think C# is close enough to Java when it comes to the issues discussed here, that you can read the texts and more or less think C# when you read Java... gene tani wrote: Start here:

Re: up to date books?

2005-08-19 Thread Magnus Lycka
John Salerno wrote: Just one more quick question: I'm basically learning programming for fun, and I'm concentrating on C# right now. Python seems interesting, but I was wondering if I should even bother. Would it supplement C# in any way, or can C# do everything Python can? Python is an

Save Binary data.

2005-08-19 Thread GMane Python
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 or so seconds, 'pop' them from the queue and save them to disc. I save them as individual files. I think that I'd like to modify

Re: Problem (or even bug?) with Tkinter

2005-08-19 Thread Matt Hammond
Thanks for that. I've tested your script and it seems to have the same problem, so I'll post your example across in comp.lang.tcl as you suggest. Seems I'm running tcl/tk 8.4.9, and wish 8.4 cheers Matt I suspect a bug at tcl level. So can you execute the following tcl script: ---

Re: python html

2005-08-19 Thread Walter Dörwald
Steve Young wrote: Hi, I am looking for something where I can go through a html page and make change the url's for all the links, images, href's, etc... easily. If anyone knows of something, please let me know. Thanks. You might try XIST (http://www.livinglogic.de/Python/xist) Code might

Netware Python?

2005-08-19 Thread GMane Python
Hello all. Looking, I have not found a version of Python which runs on Netware by Novell. I wonder, since Java there is a Java for Netware, is this where Jython would come in as useful, to be able to use a Python script where Java is installed? I'm interested in the threaded heartbeat program

Re: Adobe COM with Python

2005-08-19 Thread Benjamin Niemann
Andy W wrote: I'm wanting to automate Adove Acrobat Reader using Com thru Python and win32com, but i can't find any documentation for the Adobe stuff? Has anyone done anything with Acrobat COM ? I've searched Google groups and the web but am unable to find anything. I have not hacked

Re: while c = f.read(1)

2005-08-19 Thread Antoon Pardon
Op 2005-08-19, Donn Cave schreef [EMAIL PROTECTED]: Quoth Greg McIntyre [EMAIL PROTECTED]: | I have a Python snippet: | | f = open(blah.txt, r) | while True: | c = f.read(1) | if c == '': break # EOF | # ... work on c | | Is some way to make this code more compact and

Re: Adobe COM with Python

2005-08-19 Thread Andy W
What i want to do is use, python COM to fireup Adobe and print the pdf file to a printer. import win32com.client import pythoncom pythoncom.CoInitializeEx(pythoncom.COINIT_APARTMENTTHREADED) acro = win32com.client.DispatchEx('PDF.PdfCtrl.1') The above does not work, Do i need to install the

Newbie Question

2005-08-19 Thread Tom Strickland
I have a file that contains many lines, each of which consists of a string of comma-separated variables, mostly floats but some strings. Each line looks like an obvious tuple to me. How do I save each line of this file as a tuple rather than a string? Or, is that the right way to go? Thank

RE: Adobe COM with Python

2005-08-19 Thread Tim Golden
[Andy W] | What i want to do is use, python COM to fireup Adobe and | print the pdf | file to a printer. If that's all you want to do, have a look at this: http://timgolden.me.uk/python/win32_how_do_i/print.html Or you could try for a Ghostscript solution. (Additionally, I seem to remember

Re: Database of non standard library modules...

2005-08-19 Thread Jeff Schwab
Steve Holden wrote: Robert Kern wrote: Jon Hewer wrote: Is there an online database of non standard library modules for Python? http://cheeseshop.python.org/pypi While cheeseshop might resonate with the Monty Python fans I have to say I think the name sucks in terms of explaining

Re: Module Name Conflicts

2005-08-19 Thread Rocco Moretti
[EMAIL PROTECTED] wrote: I have a java program in a package called 'cmd'. This of course conflicts with the builtin python package of the same name. The thing is, I need to be able to import from both of these packages in the same script. I can import either one first, but any future attempt

Re: GIS Related Scripting Issue

2005-08-19 Thread Dan Patterson
you might want to try http://forums.esri.com/forums.asp?c=93 and post in the geoprocessing section with code details Fredrik Lundh [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Mike Rose wrote: I am currently using ArcGIS 9.1 and was referred to this list to ask my question. I am

Re: Adobe COM with Python

2005-08-19 Thread Andy W
I wanting to print the PDF to a printer which is set to print to file, so efectively i end up with a ps file. so 1 pdf becomes 1 ps file Tim Golden wrote: [Andy W] | What i want to do is use, python COM to fireup Adobe and | print the pdf | file to a printer. If that's all you want

Re: global interpreter lock

2005-08-19 Thread Grant Edwards
On 2005-08-20, km [EMAIL PROTECTED] wrote: is true parallelism possible in python? No, not for some values of true parallelism. or atleast in the coming versions? Not that I'm aware of. is global interpreter lock a bane in this context? In what context? -- Grant Edwards

Re: python html

2005-08-19 Thread Fuzzyman
I do exactly that in my Python CGI proxy (approx). I wrote a very simple parser called scraper.py that makes it easy. It won't choke on bad html either. http://www.voidspace.org.uk/python/recipes.shtml All the best, Fuzzyman http://www.voidspace.org.uk/python --

RE: Adobe COM with Python

2005-08-19 Thread Tim Golden
[Andy W] | I wanting to print the PDF to a printer which is set to print | to file, | so efectively i end up with a ps file. | | so 1 pdf becomes 1 ps file It't not quite clear to me what you *want* to do as opposed to what actually happens when you try. If I understand, you have a PDF file,

Dr. Dobb's Python-URL! - weekly Python news and links (Aug 18)

2005-08-19 Thread Cameron Laird
QOTW: It seems to me that Java is designed to make it difficult for programmers to write bad code, while Python is designed to make it easy to write good code. -- Magnus Lycka Code attracts people that like to code. Tedious, repetitive c.l.py threads attract people that like to write tedious,

Re: Implementing class methods in C

2005-08-19 Thread nmichaud
If you implement _test in C, works none of the above. The only difference I can see is that: type(_test.func2) type 'function' is for Python implemented function and type(_test.func2) type 'builtin_function_or_method' for C implementation I would really like to know the answer too.

Re: Newbie Question

2005-08-19 Thread Gabriel Cooper
look into the csv module. (for comma-separated-value text files.) Tom Strickland wrote: I have a file that contains many lines, each of which consists of a string of comma-separated variables, mostly floats but some strings. Each line looks like an obvious tuple to me. How do I save each line

RE: Newbie Question

2005-08-19 Thread Michael . Coll-Barth
Tom, Well, as one newbie to another, I tried this; x = '22,44,66,88,asd,asd,23,43,55' y = eval(x) y (22, 44, 66, 88, 'asd,asd', '23,43,55') given that x some how comes from a single line in your file. BTW, do you get the tutor list as well? My guess is that the 'experts' over here might

Re: Save Binary data.

2005-08-19 Thread Larry Bates
Images are binary data, don't do anything to them just save them to files on disk in their binary format. The extra processing of pickling them isn't going to help. Directories with large numbers of files was a problem in FAT16 and FAT32 filesystems but not really a problem in NTFS or Linux (at

Re: Netware Python?

2005-08-19 Thread Larry Bates
I'm not really up on Netware, but I believe that Netware's Open Enterprise Server is based on Suse Linux as the underlying OS, so Python should run there just fine. Google turned up the following that you might want to review:

Re: Save Binary data.

2005-08-19 Thread Benjamin Niemann
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 or so seconds, 'pop' them from the queue and save them to disc. I save them as individual files.

Re: Python jobs (was Re: Python for Webscripting (like PHP))

2005-08-19 Thread Gregory Piñero
I'd love Python work, just like everyone else here. On a related topic, what's the policy/etiquette of posting a resume on here, or mentioning what kind of work you're looking for? And what's the policy in general for most newsgroups and mailing lists? -Greg On 8/19/05, Steve Holden [EMAIL

Re: global interpreter lock

2005-08-19 Thread Gregory Piñero
KM, I eagerly await the answer to this question as well. I'd love to see this explained in laymen's terms. From what I understand of this issue, your best bet for getting parrelism is to use whatever the OS provides and just have multiple python instances running... but then I didn't understand

stdin - stdout

2005-08-19 Thread max(01)*
hi. i was wondering, what's the simplest way to echo the standard input to the standard output, with no modification. i came up with: ... while True: try: raw_input() except EOFError: break ... but i guess there must be a simpler way. using bash i simply do 'cat', *sigh*!

Re: stdin - stdout

2005-08-19 Thread limodou
2005/8/19, max(01)* [EMAIL PROTECTED]: hi. i was wondering, what's the simplest way to echo the standard input to the standard output, with no modification. i came up with: ... while True: try: raw_input() except EOFError: break ... but i guess there must be a

Re: global interpreter lock

2005-08-19 Thread Bryan Olson
km wrote: Hi all, is true parallelism possible in python ? or atleast in the coming versions ? is global interpreter lock a bane in this context ? No; maybe; and currently, not usually. On a uniprocessor system, the GIL is no problem. On multi- processor/core systems, it's a big loser.

Re: Newbie Question

2005-08-19 Thread BranoZ
[EMAIL PROTECTED] wrote: x = '22,44,66,88,asd,asd,23,43,55' y = eval(x) y (22, 44, 66, 88, 'asd,asd', '23,43,55') And now, a question for the experts. I'm no expert, just experienced. Does anyone have a pointer as to why my code might be dangerous? Well, the smallest problem you have

BeautifulSoup

2005-08-19 Thread Steve Young
I tried using BeautifulSoup to make changes to the url links on html pages, but when the page was displayed, it was garbled up and didn't look right (even when I didn't actually change anything on the page yet). I ran these steps in python to see what was up: from BeautifulSoup import

Re: stdin - stdout

2005-08-19 Thread Dan Sommers
On Fri, 19 Aug 2005 15:26:27 GMT, max(01)* [EMAIL PROTECTED] wrote: ps: in perl you ca do this: ... while ($line = STDIN) { print STDOUT ($line); } ... import fileinput import sys for line in fileinput.input(): sys.stdout.write(line) Regards, Dan -- Dan Sommers

Re: Newbie Question

2005-08-19 Thread Sion Arrowsmith
Tom Strickland [EMAIL PROTECTED] wrote: I have a file that contains many lines, each of which consists of a string of comma-separated variables, mostly floats but some strings. Each line looks like an obvious tuple to me. How do I save each line of this file as a tuple rather than a string? Or,

Re: Newbie Question

2005-08-19 Thread gry
Yes, eval of data from a file is rather risky. Suppose someone gave you a file containing somewhere in the middle: ... 22,44,66,88,asd,asd,23,43,55 os.system('rm -rf *') 33,47,66,88,bsd,bsd,23,99,88 ... This would delete all the files in your directory! The csv module mentioned above is the

Re: stdin - stdout

2005-08-19 Thread gry
import sys for l in sys.stdin: sys.stdout.write(l) -- George -- http://mail.python.org/mailman/listinfo/python-list

Re: while c = f.read(1)

2005-08-19 Thread Steven Bethard
Antoon Pardon wrote: But '', {}, [] and () are not nothing. They are empty containers. And 0 is not nothing either it is a number. Suppose I have a variable that is either None if I'm not registered and a registration number if I am. In this case 0 should be treated as any other number. This

Re: Python for Webscripting (like PHP)

2005-08-19 Thread Florian Lindner
Florian Lindner wrote: Hello, I've been using Python a lot for scripting (mainly scripts for server administration / DB access). All these scripts were shell based. Now I'm considering using Python (with mod_python on Apache 2) for a web project, just how I've used PHP in some smaller

Re: stdin - stdout

2005-08-19 Thread Steven Bethard
max(01)* wrote: i was wondering, what's the simplest way to echo the standard input to the standard output, with no modification. import sys for line in iter(sys.stdin.readline, ''): sys.stdout.write(line) Note that this uses the second form of iter(), which calls its first argument

Re: determine variable type

2005-08-19 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: trying to determine a variable type, specifically that a variable is an integer. i tried using type(var) but that only seemed to produce a response in the command line. You mean that if you do type(var) at the Python prompt, it gives you a reply, but if you have a

Re: Some questions

2005-08-19 Thread Magnus Lycka
Thomas Ganss wrote: My blind guess would have been that Tkinter was *not* the GUI of choice for *J*ython. With Jython you'd probably use Swing or SWT. It's certainly less coding to get something working in Jython/Swing than with Java/Swing, but I suspect that there is a cost in runtime

Re: certificate-based authentication (Martin v. Löwis)

2005-08-19 Thread Dennis . Hoffman
The standard xmlrpclib should work fine. You need to inherit from the SafeTransport class, overriding get_host_info to return the x509_info. You then pass an instance of your transport to the ServerProxy. Ok - I have upgraded to the newer version of xmlrpclib that has the 'get_host_info'

Re: stdin - stdout

2005-08-19 Thread Steven Bethard
gry@ll.mit.edu wrote: import sys for l in sys.stdin: sys.stdout.write(l) This is fine if you don't need the reads and writes of lines to run in lockstep. File iterators read into a buffer, so you'll probably read 4096 bytes from stdin before you ever write a line to stdout. If

Idempotent XML processing

2005-08-19 Thread Michael Ekstrand
Hello all, In my current project, I am working with XML data in a protocol that has checksum/signature verification of a portion of the document. There is an envelope with a header element, containing signature data; following the header is a body. The signatures are computed as cryptographic

Re: __del__ pattern?

2005-08-19 Thread Bryan Olson
BranoZ wrote: [EMAIL PROTECTED] wrote: For a reasonably portable solution, leave the lock file open. On most systems, you cannot delete an open file,.. On most UNIXes, you can delete an open file. Even flock-ed. This is BTW also an hack around flock. Yes, sorry; my bad. Use file

sequence slicing documentation

2005-08-19 Thread Steven Bethard
In trying to work out what's different between the start, stop and step of slice.indices() and the start, stop and step of sequence slicing[1] I found that some of the list slicing documentation[2] is vague. I'd like to submit a documentation fix, but I want to make sure I have it right.

Re: while c = f.read(1)

2005-08-19 Thread Donn Cave
In article [EMAIL PROTECTED], Antoon Pardon [EMAIL PROTECTED] wrote: ... But '', {}, [] and () are not nothing. They are empty containers. Oh come on, empty is all about nothing. And 0 is not nothing either it is a number. Suppose I have a variable that is either None if I'm not registered

Re: Idempotent XML processing

2005-08-19 Thread Will McCutchen
In my current project, I am working with XML data in a protocol that has checksum/signature verification of a portion of the document. ... the server sends me XML with empty elements as full open/close tags, but toxml() serializes them to the XML empty element (Element/), so the checksum

Re: __del__ pattern?

2005-08-19 Thread BranoZ
Bryan Olson wrote: Use file that is writeable by A and B in a directory that is writeable only by root. Is that portable? I have the feeling that you are asking if it works on Windows. No idea! I have only user experience with Windows. On UNIX it is as portable as 'flock', which means

Re: global interpreter lock

2005-08-19 Thread Donn Cave
In article [EMAIL PROTECTED], Bryan Olson [EMAIL PROTECTED] wrote: km wrote: Hi all, is true parallelism possible in python ? or atleast in the coming versions ? is global interpreter lock a bane in this context ? No; maybe; and currently, not usually. On a uniprocessor

Re: Python for Webscripting (like PHP)

2005-08-19 Thread Jeff Reavis
You might want to check out spyce. It uses a server page model (like jsp and php) so you can embed python in html. It has the standard stuff you would need for making a web site (session support, etc) and also contains features like custom tags. http://spyce.sourceforge.net/ --

Re: Idempotent XML processing

2005-08-19 Thread Robert Kern
Michael Ekstrand wrote: Hello all, In my current project, I am working with XML data in a protocol that has checksum/signature verification of a portion of the document. There is an envelope with a header element, containing signature data; following the header is a body. The signatures

Re: BeautifulSoup

2005-08-19 Thread Paul McGuire
Steve - Is there a chance you could post a before and after example, so we can see just what you are trying to do instead of talking conceptually all around it and making us guess? If you are just doing some spot translations of specific values in an HTML file, you can probably get away with a

python classes taught

2005-08-19 Thread araki
anyone know of any college/school that is teaching the python language? -- http://mail.python.org/mailman/listinfo/python-list

Re: BeautifulSoup

2005-08-19 Thread Paul McGuire
Here's a pyparsing program that reads my personal web page, and spits out HTML with all of the HREF's reversed. -- Paul (Download pyparsing at http://pyparsing.sourceforge.net.) from pyparsing import Literal, quotedString import urllib LT = Literal() GT = Literal() EQUALS = Literal(=)

Python 2.1 Bible Source

2005-08-19 Thread SuppressedPen
Hi Everyone! Just started with Python 2 weeks ago and I can't put it down it's to easy and to powerful, I'm sure the goons will be after us for having it soon, Hi Hi. Was wondering if anyone might know where I can find the source code for PYTHON 2.1 BIBLE book. Apparently it was online until

Re: Idempotent XML processing

2005-08-19 Thread Michael Ekstrand
On Aug 19, 2005, at 12:11 PM, Will McCutchen wrote: In my current project, I am working with XML data in a protocol that has checksum/signature verification of a portion of the document. ... the server sends me XML with empty elements as full open/close tags, but toxml() serializes them to

ANN: PyDev 0.9.7.99 released

2005-08-19 Thread Fabio Zadrozny
Hi All, PyDev - Python IDE (Python Development Enviroment for Eclipse) version 0.9.7.99 has just been released. Check the homepage (http://pydev.sourceforge.net/) for more details. Details for Release: 0.9.7.99 OK, what's with the strange release version number?... Well, this version

[Jython-users] ANN: PyDev 0.9.7.99 released

2005-08-19 Thread Fabio Zadrozny
Hi All, PyDev - Python IDE (Python Development Enviroment for Eclipse) version 0.9.7.99 has just been released. Check the homepage (http://pydev.sourceforge.net/) for more details. Details for Release: 0.9.7.99 OK, what's with the strange release version number?... Well, this version

A script to run all of my project's pyunit tests

2005-08-19 Thread travislspencer
Hey All, I am trying to write a script that runs all of my pyunit tests for me. Ideally, I would like to be able to drop a new module into my project's test subdirectory, and the testing script will pick it up automatically. At the moment, I have it working but it is kinda a kludge because every

  1   2   >