Re: reading timestamp from vid file (avi)

2005-03-09 Thread flupke
Lucas Raab wrote: flupke wrote: Hi, i capture a movie from mividv to an avi containing the dv video. I found a program that reads the timestamp from the avi so you know the exact date and time the video was shot. However, the source of that program is not available and it doesn't allow to batch

thread end and make main program end also?

2005-03-09 Thread martinnitram
Dear all, Following are some codes: from myClass import * # some user define classes, which will catch the exception within its function thread_function(): myClass myclass while (1): returnValue = myclass.myfunction(); print "Return Value %s" % returnValue

Re: capturing text from a GUI window

2005-03-09 Thread Myles Strous
Earl Eiland wrote: > This sounds like just what I need. What is COM, and where do I get it? Also worth checking out: Simon Brunning's WinGuiAuto - control/query of windows and controls, including the function getEditText to read the text in an edit control. See http://www.brunningonline.net/simo

Re: BaseHTTPServer.BaseHTTPRequestHandler and HTTP chunking

2005-03-09 Thread Steve Holden
Andy Leszczynski wrote: Does BaseHTTPServer.BaseHTTPRequestHandler support HTTP protocol chunking? No. Hardly any HTTP 1.1 features are supported. regards Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: looking for case insesitive dictionary

2005-03-09 Thread Michael Spencer
Andy Leszczynski wrote: so e.g. x={} x['a']=1 x['A']=2 print x['a'] #prints 2 Thx, A. http://www.google.com/search?&q=python+case+insensitive+dictionary Michael -- http://mail.python.org/mailman/listinfo/python-list

looking for case insesitive dictionary

2005-03-09 Thread Andy Leszczynski
so e.g. x={} x['a']=1 x['A']=2 print x['a'] #prints 2 Thx, A. -- http://mail.python.org/mailman/listinfo/python-list

BaseHTTPServer.BaseHTTPRequestHandler and HTTP chunking

2005-03-09 Thread Andy Leszczynski
Does BaseHTTPServer.BaseHTTPRequestHandler support HTTP protocol chunking? Thanks, Andy -- http://mail.python.org/mailman/listinfo/python-list

SimpleHTTPRequestHandler handling long lasting requests problem

2005-03-09 Thread Andy Leszczynski
I need a HTTP server handling long lasting requests e.g. 10-30 seconds. Below is a pice of the code. In order to make the server reponsive while handling othere requests I use SocketServer.ThreadingMixIn. However the problem is the it does not work out. I checked thet a new thread is created fo

Re: read() / readline() / readlines()

2005-03-09 Thread Dave Lajoie
Fyi, I found the answer ( at least one that still works )   def PrintThread(myThread):    while myThread.isAlive() == True:    line = p.stdout.readline()[:-1]    if line == "":    continue    if line == '\0':    break    print line   Dave. -

hotshot load error

2005-03-09 Thread Charles Hartman
I've used profile before, but wanted to get more information so I thought I'd try hotshot instead. It works fine when used like profile. But when I run it using this line, prof = hotshot.Profile('ScanHot.prof', lineevents=1) though it runs all right, when I try to load the resulting file I get

Re: os.walk(entire filesystem)

2005-03-09 Thread Grumman
Tobiah wrote: When I do os.walk('/') on a Linux computer, the entire file system is walked. On windows, however, I can only walk one drive at a time (C:\, D:\, etc.). If this is a personal utility for one computer, and if you run XP on that computer, then you have the ability to mount secondar

Usage example for ANSI.py from the pexpect package

2005-03-09 Thread Eric Myers
Hello folks: (This message is also posted on the help forum at the pexpect sourceforge page, but all indentation in the code got stripped away when I submitted the post.) For some time I've wanted to make use of the ANSI.py module in the pexpect package to handle screen-based telnet sessions in P

Re: How to allow events during long processing routine?

2005-03-09 Thread Brent W. Hughes
Thanks, M.E.Farmer. I continue to be impressed with how quickly and nicely one can get help here. Brent "M.E.Farmer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Survey says. > ...wxYield() > > ;) > M.E.Farmer > -- http://mail.python.or

Re: python cvs interface?

2005-03-09 Thread corey
Ah, unfortunately it looks like this program uses something called gcvs, a gtk cvs interface written in C++, for interfacing to low level cvs routines. So it probably won't work for me. Oh well. Anyone else have any suggestions? -- http://mail.python.org/mailman/listinfo/python-list

email.Message.set_charset and Content-Transfer-Encoding

2005-03-09 Thread David Bolen
I've noticed that using set_charset() on an email.Message instance will not replace any existing Content-Transfer-Encoding header but will install one if it isn't yet present. Thus, if you initially create a message without a charset, it defaults to us-ascii, and creates both Content-Type and Cont

Re: capturing text from a GUI window

2005-03-09 Thread Earl Eiland
On Tue, 2005-03-08 at 14:27, [EMAIL PROTECTED] wrote: > Earl Eiland wrote: > > Anyone know how to capture text from GUI output? I need to process > > information returned via a GUI window. > > > > Earl > > Assuming Windows, then these guys have an interesting tool: > http://www.skesoft.com/te

Re: os.walk(entire filesystem)

2005-03-09 Thread Larry Bates
I don't think what you want would even work. You can't walk A: unless a floppy is present, O/S will bark at you. You can't walk D: (cdrom drive) unless a CDROM is present. What about network drives??? Unlike Linux where these directories appear to be empty if nothing is mounted Windows tries to

Re: os.walk(entire filesystem)

2005-03-09 Thread Tobiah
When I do os.walk('/') on a Linux computer, the entire file system is walked. On windows, however, I can only walk one drive at a time (C:\, D:\, etc.). If this is a personal utility for one computer, and if you run XP on that computer, then you have the ability to mount secondary drives on to

Re: PythonWin line spacing

2005-03-09 Thread Neil Hodgson
Thomas Philips: > I've just downloaded and installed ActivePython and am trying to > customize the PythonWin editor. Its line spacing seems to default to 2, > and consequently, I cannot see many lines of code on a screen. How do I > set the line spacing to 1? I presume you are talking about th

Re: An Odd Little Script

2005-03-09 Thread Michael Hoffman
Michael Hoffman wrote: Greg Lindstrom wrote: I have a file with varying length records. All but the first record, that is; it's always 107 bytes long. What I would like to do is strip out all linefeeds from the file, read the character in position 107 (the end of segment delimiter) and then re

Re: os.walk(entire filesystem)

2005-03-09 Thread Peter Hansen
rbt wrote: More of an OS question than a Python question, but it is Python related so here goes: When I do os.walk('/') on a Linux computer, the entire file system is walked. On windows, however, I can only walk one drive at a time (C:\, D:\, etc.). Is there a way to make os.walk() behave on Wi

Re: Unicode BOM marks

2005-03-09 Thread "Martin v. LÃwis"
Steve Horsley wrote: It is my understanding that the BOM (U+feff) is actually the Unicode character "Non-breaking zero-width space". My understanding is that this used to be the case. According to http://www.unicode.org/faq/utf_bom.html#38 the application should now specify specific processing,

Re: distutils: binary distribution?

2005-03-09 Thread "Martin v. Löwis"
Stefan Waizmann wrote: I would like the distutils are creating a binary distribution only - means create the distribution file with *.pyc files WITHOUT the *.py files. Any ideas? You will need to create your own command. You can either specialize the build command, to not copy the source code (mor

Re: How to allow events during long processing routine?

2005-03-09 Thread M.E.Farmer
Survey says. ...wxYield() ;) M.E.Farmer -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a short-circuiting dictionary "get" method?

2005-03-09 Thread Jeff Epler
untested def my_getter(m, i, f): try: return m[i] except (KeyError, IndexError): return f() my_getter(d, 'x', bigscaryfunction) my_getter(d, 'y', lambda: scaryinlineexpresion) pgp04VRKFqQL1.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python

Re: An Odd Little Script

2005-03-09 Thread Benji York
Greg Lindstrom wrote: I have a task which -- dare I say -- would be easy in Perl but would rather do in Python (our primary language at Novasys). I have a file with varying length records. All but the first record, that is; it's always 107 bytes long. I intuit that you are dealing with EDI

Re: An Odd Little Script

2005-03-09 Thread M.E.Farmer
Greg Lindstrom wrote: > Hello- > > I have a task which -- dare I say -- would be easy in > Perl but would rather do in Python (our primary > language at Novasys). I have a file with varying length records. All > but the first record, that is; it's always 107 bytes long. What I would > like to d

Re: An Odd Little Script

2005-03-09 Thread James Stroud
This might be hack-ish, more elegant solutions are likely to exist, but this is the general idea: LINEFEED = "\n" # or whatever EOR = "?"# or whatever def fixEOR(filename): f = open(filename,"r+") byte = True # loops through whole file while True: # loops through record

Re: Recognizing the Arrival of a New File

2005-03-09 Thread Chris Green
Greg Lindstrom <[EMAIL PROTECTED]> writes: > Hello- > I am writing an application where I need to recognize when a file > arrives in a given directory. Files may arrive at any time during the > course of the day. Do I set up a cron job to poll the directory every > few minutes? Write a daemo

Share a accomodation at PyCon from march 22-27?

2005-03-09 Thread Gregoire Weber
Hi Guys, is someone interested in sharing accomodation during the upcoming PyCon? I'll be there from the 22 to 27th of march (five nights). Gregoire -- http://mail.python.org/mailman/listinfo/python-list

Re: Web framework

2005-03-09 Thread Phil Jackson
"Gianluca Sartori" <[EMAIL PROTECTED]> writes: > What web framework do you suggest to develop with? I tend to use mod_python. Phil -- http://mail.python.org/mailman/listinfo/python-list

Re: An Odd Little Script

2005-03-09 Thread Terry Hancock
On Wednesday 09 March 2005 04:06 pm, Greg Lindstrom wrote: > Hello- > > I have a task which -- dare I say -- would be easy in > Perl but would rather do in Python (our primary > language at Novasys). I have a file with varying length records. All > but the first record, that is; it's always

Re: An Odd Little Script

2005-03-09 Thread Michael Hoffman
Greg Lindstrom wrote: I have a file with varying length records. All but the first record, that is; it's always 107 bytes long. What I would like to do is strip out all linefeeds from the file, read the character in position 107 (the end of segment delimiter) and then replace all of the end o

Re: python cvs interface?

2005-03-09 Thread corey
Thanks, that looks promising, I'll take a look! -- http://mail.python.org/mailman/listinfo/python-list

Re: Web framework

2005-03-09 Thread Fred Pacquier
"Gianluca Sartori" <[EMAIL PROTECTED]> said : > Hi guys, > What web framework do you suggest to develop with? I had a look both at > Nevow and Quixote. These seemes to be the most appreciated by the > community. Anyway, I had no luck looking for a complete and coherent > documentation. Snakelets

[wxPython] How to allow events during long processing routine?

2005-03-09 Thread Brent W. Hughes
I'm running some code that takes a long time to finish. I would like the user to be able to do other things while it is running. It seems to me there is a function I can call to tell wxPython to process any pending messages or events. I would call this perhaps every 1000 times through my loo

An Odd Little Script

2005-03-09 Thread Greg Lindstrom
Hello- I have a task which -- dare I say -- would be easy in Perl but would rather do in Python (our primary language at Novasys). I have a file with varying length records. All but the first record, that is; it's always 107 bytes long. What I would like to do is strip out all linefeeds fr

Re: [perl-python] a program to delete duplicate files

2005-03-09 Thread Terry Hancock
On Wednesday 09 March 2005 06:56 am, Xah Lee wrote: > here's a large exercise that uses what we built before. > > suppose you have tens of thousands of files in various directories. > Some of these files are identical, but you don't know which ones are > identical with which. Write a program that

Re: enum question

2005-03-09 Thread Terry Hancock
On Friday 04 March 2005 02:54 pm, M.N.A.Smadi wrote: > does python support a C-like enum statement where one can define a > variable with prespesified range of values? No, but in most situations where I would've used an enum, I use a trivial class like this: class states: ON, OFF, UNKNOWN,

[German] Deutsche Python Newsgroup ist eingerichtet

2005-03-09 Thread Christian Helmbold
(This posting will be interesting for german speaking folks only.) Hallo, die deutsche Pyhton-Newsgroup de.comp.lang.python wurde endlich eingerichtet. Vielen Dank an alle, die fuer die Einrichtung gestimmt haben! Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: python cvs interface?

2005-03-09 Thread Jeff Reavis
Corey, WinCvs can use python for macros, you might want to look at their code: http://cvs.sourceforge.net/viewcvs.py/cvsgui/cvsgui/PythonLib/cvsgui/ You may also want to look at viewcvs, which is written in Python. -jjr -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a short-circuiting dictionary "get" method?

2005-03-09 Thread Michael Spencer
Dave Opstad wrote: In this snippet: d = {'x': 1} value = d.get('x', bigscaryfunction()) the bigscaryfunction is always called, even though 'x' is a valid key. Is there a "short-circuit" version of get that doesn't evaluate the second argument if the first is a valid key? For now I'll code around

Re: Web framework

2005-03-09 Thread Jeff Reavis
You may also want to look at Spyce. It is similar to JSP,PHP, or ASP. There are some good docs and examples at the site. http://spyce.sourceforge.net/ -jjr -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode BOM marks

2005-03-09 Thread Steve Horsley
Francis Girard wrote: Le lundi 7 Mars 2005 21:54, "Martin v. LÃwis" a Ãcrit : Hi, Thank you for your very informative answer. Some interspersed remarks follow. I personally would write my applications so that they put the signature into files that cannot be concatenated meaningfully (since the si

Re: popen2.Popen3 doesn't work well for me

2005-03-09 Thread Steven Bethard
alexrait1 wrote: It does but that's not what I want. I need a class which I can query for process termination for instance... Is there a way to overcome this problem with Popen3? If you're using Python 2.4 you should look into the subprocess module. I think these docs might be what you're looking

Re: Running doctests with unittest

2005-03-09 Thread Jim Sizelove
Thomas Heller wrote: I'm trying to integrate some doctest tests with unittest. The tests must be exposed as one or more subclasses of unittest.TestCase, so I'm collecting them with a call to doctest.DocTestSuite(), and then add them to a TestCase class I have created. The tests seem to run, but th

Re: popen2.Popen3 doesn't work well for me

2005-03-09 Thread alexrait1
It does but that's not what I want. I need a class which I can query for process termination for instance... Is there a way to overcome this problem with Popen3? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.4 removes None data type?

2005-03-09 Thread Jarek Zgoda
Jacek Generowicz napisał(a): Implication: A long standing wart in Python now gone. Its time to gloat. Are there any really evil glitches LEFT in Python? Python 2.4 (#1, Dec 1 2004, 14:23:15) [GCC 3.2.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. True, False

os.walk(entire filesystem)

2005-03-09 Thread rbt
More of an OS question than a Python question, but it is Python related so here goes: When I do os.walk('/') on a Linux computer, the entire file system is walked. On windows, however, I can only walk one drive at a time (C:\, D:\, etc.). Is there a way to make os.walk() behave on Windows as it

Re: Best way to make a list unique?

2005-03-09 Thread Michael Spencer
Marc Christiansen wrote: Michael Spencer <[EMAIL PROTECTED]> wrote: Nice. When you replace None by an object(), you have no restriction on the elements any more: Thanks for the suggestion, Marc. Note that if there is no need to access the middle of the collection, then the implementation is simpl

Re: Second argument to super().

2005-03-09 Thread Steven Bethard
Tobiah wrote: What is the purpose of the second argument to super()? You probably want to check the docs[1] again. They give an example: class C(B): def meth(self, arg): super(C, self).meth(arg) What is meant by the returning of an 'unbound' object when the argument is omitted. If you

python cvs interface?

2005-03-09 Thread corey
Hi everyone, this should be a quick question. I'm writing some scripts to take some file and move them into a CVS repository, but it's pretty slow, because it uses system calls to execute the CVS commands. Has anyone ever made a python to CVS interface library that I could use? I've been trying t

Re: Error on xpath-ing a DOM with namespaces

2005-03-09 Thread Piet
> NSS = {u'wsdl': u'http://schemas.xmlsoap.org/wsdl/'} > #""processorNss" = "namespace bindings to be used by the processor" > ctx = Context(wsdl_doc, processorNss=NSS) > Evaluate(u'wsdl:description/wsdl:documentation', context=ctx) > """ > > Should give you a start. Thanks a lot. I found a soluti

Re: Is there a short-circuiting dictionary "get" method?

2005-03-09 Thread Steven Bethard
Bill Mill wrote: On 9 Mar 2005 10:05:21 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Maybe this can help: value = d.get('x', lambda: bigscaryfunction()) def test(): print 'gbye' ... d = {} z = d.get('x', lambda: test()) z at 0x008D6870> So this seems to be merely an obfuscation of: z = d.g

Re: Problematic behavior of the import statement when several module files have the same name.

2005-03-09 Thread Steven Bethard
Xif wrote: Hello Everyone! Here's a problem with relative imports: Suppose I have a package called some_package (in a separate directory included in the PYTHONPATH, with an __init__.py file etc.) This package has a module inside the directory, called "database", and therefore residing in the file

Re: running programs from within python

2005-03-09 Thread Steven Bethard
M.N.A.Smadi wrote: > am getting an error in the script as follows: > > NameError: global name 'os' is not defined > > however i dont get the same error when running from the python CLI. > (and yes i am importing the os module) > Steven Bethard wrote: > Can you give the full exception message (i.e.

PythonWin line spacing

2005-03-09 Thread tkpmep
I've just downloaded and installed ActivePython and am trying to customize the PythonWin editor. Its line spacing seems to default to 2, and consequently, I cannot see many lines of code on a screen. How do I set the line spacing to 1? Thomas Philips -- http://mail.python.org/mailman/listinfo/py

Re: Web framework

2005-03-09 Thread dowskimania
Gianluca Sartori wrote: > Hi guys, > > What web framework do you suggest to develop with? I really like CherryPy. It has a very intuitive design. A "directory" is an object and the "files" in it are methods. URL variables are passed as arguments to the methods. The CherryPy site has a good tut

RE: running programs from within python

2005-03-09 Thread Batista, Facundo
Title: RE: running programs from within python [James Stroud] #- import os He says he did it: #- > > M.N.A.Smadi wrote: #- > >> (and yes i am importing the os module) But he still didn't paste the code here .    Facundo Bitácora De Vuelo: http://www.taniquetil.com.ar/plog PyAr

Re: Is there a short-circuiting dictionary "get" method?

2005-03-09 Thread Reinhold Birkenfeld
Dave Opstad wrote: > In this snippet: > > d = {'x': 1} > value = d.get('x', bigscaryfunction()) > > the bigscaryfunction is always called, even though 'x' is a valid key. > Is there a "short-circuit" version of get that doesn't evaluate the > second argument if the first is a valid key? For now

Re: running programs from within python

2005-03-09 Thread James Stroud
You should import os On Wednesday 09 March 2005 10:06 am, M.N.A.Smadi wrote: > this is the full error > > > Traceback (most recent call last): > File "./plugin.py", line 60, in ? > main() > File "./plugin.py", line 40, in main > os.system("/root/tmp/bibutils_3.14/isi2xml " + isi_file

Second argument to super().

2005-03-09 Thread Tobiah
What is the purpose of the second argument to super()? What is meant by the returning of an 'unbound' object when the argument is omitted. Also, when would I pass an object as the second argument, and when would I pass a type? Thanks, Tobiah -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a short-circuiting dictionary "get" method?

2005-03-09 Thread Kent Johnson
F. Petitjean wrote: Le Wed, 09 Mar 2005 09:45:41 -0800, Dave Opstad a écrit : Is there a "short-circuit" version of get that doesn't evaluate the second argument if the first is a valid key? For now I'll code around it, but this behavior surprised me a bit... def scary(): print "scary called"

RE: Forums based on python

2005-03-09 Thread Batista, Facundo
Title: RE: Forums based on python [EMAIL PROTECTED] #- HI #- I AM NEW TO PROGRAMING PRESENTLY I AM USING WINDOWS ME AND WHAT I SAW IN PYTHON INTEREST ME ANN AWFUL LOT. I DOWNLOADED VERSION 2.4 AND I #- TRIED TO GET MY PROGRAM "HELLO WORLD" ETC I SAVED ALL PROGRAMS BUT WHEN I WANT TO RUN IT I

RE: Problematic behavior of the import statement when several modulefiles have the same name.

2005-03-09 Thread Robert Brewer
Xif wrote: > Here's a problem with relative imports: > > Suppose I have a package called some_package (in a separate directory > included in the PYTHONPATH, with an __init__.py file etc.) > > This package has a module inside the directory, called "database", and > therefore residing in the file

Re: Is there a short-circuiting dictionary "get" method?

2005-03-09 Thread Bill Mill
On 09 Mar 2005 18:13:01 GMT, F. Petitjean <[EMAIL PROTECTED]> wrote: > Le Wed, 09 Mar 2005 09:45:41 -0800, Dave Opstad a écrit : > > In this snippet: > > > > d = {'x': 1} > > value = d.get('x', bigscaryfunction()) > > > > the bigscaryfunction is always called, even though 'x' is a valid key. > > Is

Re: Is there a short-circuiting dictionary "get" method?

2005-03-09 Thread Bill Mill
On 9 Mar 2005 10:05:21 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Maybe this can help: > > value = d.get('x', lambda: bigscaryfunction()) >>> def test(): print 'gbye' ... >>> d = {} >>> z = d.get('x', lambda: test()) >>> z at 0x008D6870> So this seems to be merely an obfuscation of:

Re: Is there a short-circuiting dictionary "get" method?

2005-03-09 Thread F. Petitjean
Le Wed, 09 Mar 2005 09:45:41 -0800, Dave Opstad a écrit : > In this snippet: > > d = {'x': 1} > value = d.get('x', bigscaryfunction()) > > the bigscaryfunction is always called, even though 'x' is a valid key. > Is there a "short-circuit" version of get that doesn't evaluate the > second argume

Re: Is there a short-circuiting dictionary "get" method?

2005-03-09 Thread bearophileHUGS
Maybe this can help: value = d.get('x', lambda: bigscaryfunction()) Bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Popen3 and capturestderr

2005-03-09 Thread Kenneth Pronovici
On Wed, Mar 09, 2005 at 06:17:50AM -, Donn Cave wrote: > Quoth Kenneth Pronovici <[EMAIL PROTECTED]>: > ... > | If ignoreStderr=False, I use popen2.Popen4 so that stderr and stdout are > | intermingled. If ignoreStderr=True, I use popen2.Popen3 with > | capturestderr=True so stderr doesn't app

Re: running programs from within python

2005-03-09 Thread M.N.A.Smadi
this is the full error Traceback (most recent call last): File "./plugin.py", line 60, in ? main() File "./plugin.py", line 40, in main os.system("/root/tmp/bibutils_3.14/isi2xml " + isi_file + " > tmp_isi_xml.xml") NameError: global name 'os' is not defined smadi Steven Bethard wrote: M.

Forums based on python

2005-03-09 Thread Naouka
HI I AM NEW TO PROGRAMING PRESENTLY I AM USING WINDOWS ME AND WHAT I SAW IN PYTHON INTEREST ME ANN AWFUL LOT. I DOWNLOADED VERSION 2.4 AND I TRIED TO GET MY PROGRAM "HELLO WORLD" ETC I SAVED ALL PROGRAMS BUT WHEN I WANT TO RUN IT I CAN'T FIND UNDER  EDIT=RUN SCRIPT = WHERE CAN I GO TO RUN MY

Re: Is there a short-circuiting dictionary "get" method?

2005-03-09 Thread Bill Mill
Dave, On Wed, 09 Mar 2005 09:45:41 -0800, Dave Opstad <[EMAIL PROTECTED]> wrote: > In this snippet: > > d = {'x': 1} > value = d.get('x', bigscaryfunction()) > > the bigscaryfunction is always called, even though 'x' is a valid key. > Is there a "short-circuit" version of get that doesn't evalua

Re: Is there a short-circuiting dictionary "get" method?

2005-03-09 Thread Peter Hansen
Dave Opstad wrote: In this snippet: d = {'x': 1} value = d.get('x', bigscaryfunction()) the bigscaryfunction is always called, even though 'x' is a valid key. Is there a "short-circuit" version of get that doesn't evaluate the second argument if the first is a valid key? For now I'll code around

Is there a short-circuiting dictionary "get" method?

2005-03-09 Thread Dave Opstad
In this snippet: d = {'x': 1} value = d.get('x', bigscaryfunction()) the bigscaryfunction is always called, even though 'x' is a valid key. Is there a "short-circuit" version of get that doesn't evaluate the second argument if the first is a valid key? For now I'll code around it, but this beh

Problematic behavior of the import statement when several module files have the same name.

2005-03-09 Thread Xif
Hello Everyone! Here's a problem with relative imports: Suppose I have a package called some_package (in a separate directory included in the PYTHONPATH, with an __init__.py file etc.) This package has a module inside the directory, called "database", and therefore residing in the file some_pac

Help with socket staus

2005-03-09 Thread Miley, Shain
Hello, First let me say hello since I am new to this list. Recently I downloaded and installed the c3 suite of python2 scripts so that I can execute commands on multiple unix nodes. What I am looking to do is determine when an ssh connection fails (either sshd has been stopped, the node is n

Re: logging addLevelName

2005-03-09 Thread Jeremy Jones
[EMAIL PROTECTED] wrote: I am trying to add a new logging level. logging.config.fileConfig("bengineLog.cfg") logging.CLIENT = logging.INFO + 1 logging.addLevelName( logging.CLIENT, 'CLIENT' ) logging.root.setLevel( [logging.INFO, logging.CLIENT, logging.WARNING, logging.ERROR, logging.CRITICAL] ) l

Re: running programs from within python

2005-03-09 Thread Steven Bethard
M.N.A.Smadi wrote: am getting an error in the script as follows: NameError: global name 'os' is not defined however i dont get the same error when running from the python CLI. (and yes i am importing the os module) Can you give the full exception message (i.e. copy-paste it from the output)? STe

RE: running programs from within python

2005-03-09 Thread Batista, Facundo
Title: RE: running programs from within python [M.N.A.Smadi] #- am getting an error in the script as follows: #- #- NameError: global name 'os' is not defined What script? Please paste it here. If it's more than 20 lines, trim it until you find the smaller script that has the error.

Re: running programs from within python

2005-03-09 Thread M.N.A.Smadi
am getting an error in the script as follows: NameError: global name 'os' is not defined however i dont get the same error when running from the python CLI. (and yes i am importing the os module) is this a bug in python 2.3 (the one am currently using) thanks m.smadi Steven Bethard wrote: M.N.A.S

Re: [CherryPy]Serve dynamic binary file in cherrypy?

2005-03-09 Thread Remi Delon
"mep" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Hi, > After lookup in cherrypy site and google for a while, I haven't > found any information about cherrypy how to serve dynamic binary > file(some generated charts).Is there any easy way to do this? > In cherrypy 2.0 &

Re: running programs from within python

2005-03-09 Thread Steven Bethard
M.N.A.Smadi wrote: M.N.A.Smadi wrote: hi; in general: how can i pass a string containing a concatenated sequcne of command line arguments to a unix system CLI? i guess i will answer myself: import os os.system(string) Also worth noting is that if you're using Python 2.4, you might want to look a

RE: running programs from within python

2005-03-09 Thread Batista, Facundo
Title: RE: running programs from within python [M.N.A.Smadi] #- i guess i will answer myself: #- import os #- os.system(string) If you have Py2.4, it's better to use subprocess(). .    Facundo Bitácora De Vuelo: http://www.taniquetil.com.ar/plog PyAr - Python Argentina: http://pyar.dec

SOAPpy Interoperability w/AXIS C++

2005-03-09 Thread jkohans
Hello, I am having some trouble getting a Python client written using SOAPpy 0.11.6 to work with a Web Service that is published using AXIS C++ version 1.4. I have a C++ client working, and I am able to compare the SOAP messages that are being sent by it and the Python client. It appears as thou

Re: running programs from within python

2005-03-09 Thread M.N.A.Smadi
M.N.A.Smadi wrote: hi; in general: how can i pass a string containing a concatenated sequcne of command line arguments to a unix system CLI? my specific problem: i have an executable that is called xyz (written in C if that matters) that i cannot modify, which prints it is text output to the scr

running programs from within python

2005-03-09 Thread M.N.A.Smadi
hi; in general: how can i pass a string containing a concatenated sequcne of command line arguments to a unix system CLI? my specific problem: i have an executable that is called xyz (written in C if that matters) that i cannot modify, which prints it is text output to the screen and takes an i

MDaemon Warning - virus found: RETURNED MAIL: SEE TRANSCRIPT FOR DETAILS

2005-03-09 Thread Automatic Email Delivery Software
*** WARNING ** Este mensaje ha sido analizado por MDaemon AntiVirus y ha encontrado un fichero anexo(s) infectado(s). Por favor revise el reporte de abajo. AttachmentVirus name Action taken ---

Web framework

2005-03-09 Thread Gianluca Sartori
Hi guys, What web framework do you suggest to develop with? I had a look both at Nevow and Quixote. These seemes to be the most appreciated by the community. Anyway, I had no luck looking for a complete and coherent documentation. Thanks for any suggestion, Gianluca -- http://mail.python.org/ma

Re: [perl-python] a program to delete duplicate files

2005-03-09 Thread TZOTZIOY
On 9 Mar 2005 04:56:13 -0800, rumours say that "Xah Lee" <[EMAIL PROTECTED]> might have written: >Write a Perl or Python version of the program. > >a absolute requirement in this problem is to minimize the number of >comparison made between files. This is a part of the spec. http://groups-beta.g

Re: Your suggestions re virus, round 6: Virus KO

2005-03-09 Thread Anthra Norell
Josef, I'll definitely take a close look at all the suggestions I have been offered, in the interest of future damage prevention. This time, though, the fight is over and I emerge victorious! Poking around here and I came across huge startup or execution log files listing rather unabash

Re: i18n: looking for expertise

2005-03-09 Thread [EMAIL PROTECTED]
Michael: on my box, (winXP SP2), sys.getfilesystemencoding() returns 'mbcs'. If you post your revised solution to this unicode problem, I'd be delighted to test it on Windows. I'm working on a Tkinter front-end for Vivian deSmedt's rsync.py and would like to address the issue of accented charact

Re: Split text file into words

2005-03-09 Thread Duncan Booth
qwweeeit wrote: >ll=re.split(r"[\s,{}[]()+=-/*]",i) The stack overflow comes because the ()+ tried to match an empty string as many times as possible. This regular expression contains a character set '\s,{}[' followed by the expression '()+=-/*]'. You can see that the parentheses aren't pa

Re: Python COM Class Question

2005-03-09 Thread Steve Holden
pemo wrote: I'm trying to use difflib.py from a COM aware language - and, for ease of use, I'm initially trying to get this going from VB6. I've wrappered difflib.py correctly I think, and I can now call into it and call a global method (called 'test' of course). Here's the consuming code:

Re: Working on a log in script to my webpage

2005-03-09 Thread Steve Holden
Pete. wrote: I better mention, that I rather make it all in python and html (found out that python somehow works with asp) I know that what I have to do is the following: 1) When the user logs in, I have to store a session ID in a cookie In actual fact it's best not to wait until the user log

Re: Split text file into words

2005-03-09 Thread qwweeeit
I thank you for your help. I already used re.split successfully but in this case... I didn't explain more deeply because I don't want someone else do my homework. I want to implement a variable & commands cross reference tool. For this goal I must clean the python source from any comment and manif

Re: Working on a log in script to my webpage

2005-03-09 Thread Pete.....
Thanks. But I would really like to do this from scratch, so that I can learn it, I dont think I need that much more, before it works. I found an example with asp, where the save the session if the password is correct. It isnt that long a code, so was wondering if it isnt possible to make somet

BayPIGgies: March 10, 7:30pm (FINAL MEETING AT STANFORD)

2005-03-09 Thread Aahz
WARNING: the last meeting of BayPIGgies at Stanford is currently scheduled for March. Our host, Danny Yoo, is leaving Stanford, and we need to find a new location. If you wish to assist with the search, please join the BayPIGgies mailing list. Meanwhile, let's all give hearty thanks to Danny for

Announcement: PyMatrix-0.0.1a Released

2005-03-09 Thread Colin J. Williams
PyMatrix is a package to provide access to the functionality of matrix algebra. This package is currently based on numarray. It includes a statistics module which includes a basic analysis of variance. In the future it is hoped to enhance the generality of the divide operation, to add the tra

Re: How to upgrade python on Redhat?

2005-03-09 Thread Paul Boddie
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > > 2) Give up and install python 2.4 in /usr/local. This leaves me in the > awkward situation of having to ensure that all our in-house scripts, > all the time use /usr/local/bin/python. Or, as recommended, use

  1   2   >