Re: Mysterious "Attribute Errors" when GUI Programming

2005-03-09 Thread Coral Snake
Again Thanks to everyone here. Both the GTK and the Tkinter example are running fine now. -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to make a list unique?

2005-03-09 Thread Michael Hoffman
Delaney, Timothy C (Timothy) wrote: I've proposed this on python-dev, but the general feeling so far is against it. So far the only use case is to remove duplicates without changing order, and there are iterator-based solutions which would normally be preferable. I've needed a dict that would itera

Re: How to script DOS app that doesn't use stdout

2005-03-09 Thread Gregor
Timothy Grant <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > On Sun, 06 Mar 2005 13:41:57 GMT, Gregor <[EMAIL PROTECTED]> > wrote: >> There's a DOS console application I am trying to script (in Python), >> but it doesn't seem to use stdout or stderr... For example, if I >> redirect outpu

Re: How to upgrade python on Redhat?

2005-03-09 Thread David Fraser
[EMAIL PROTECTED] wrote: This question applies specifically to RHEL 3.0 (actually Whitebox), but also generally to Redhat and probably pretty much every distribution that uses python for distribution-related tasks (configuration managers, rpm package management, yum, etc). So I want to upgrade to p

Re: mod_python & "please recompile it with -DEAPI" apache warning

2005-03-09 Thread [EMAIL PROTECTED]
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > [EMAIL PROTECTED] wrote: > > 2) added to MakeFile after config: > > EXTRA_CFLAGS=-DEAPI > > You can do this, but it should be to "src/Makefile" and added > to "CFLAGS" and not "EXTRA_CFLAGS" as the latter doesn't exist. > > Thanks I f

Re: looking for way to include many times some .py code from anotherpython code

2005-03-09 Thread Martin MOKREJŠ
Steve Holden wrote: Martin MOKREJŠ wrote: Steve Holden wrote: [...] I will be *very* surprised if you can't get a much better (i.e. easier and more efficient) solution by stepping back from the programming Hmm, I'm not convinced, but I'll put few more words here then. ;) details for a moment an

Re: running a C program with python script

2005-03-09 Thread Michael Hoffman
James Stroud wrote: module os the os.popen* commands. The subprocess module in Python 2.4 is generally a better and easier way to do this. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: firefox python plugin

2005-03-09 Thread Thomas Ganss
M.N.A.Smadi schrieb: hi; i want to write a script to do the following: when using firefox to download a textfile, instead of saving it to the hard dist, i want to run a python script on it, and i want the python script then to prompt me for the location where i want to store the processed downlo

popen2.Popen3 doesn't work well for me

2005-03-09 Thread alexrait1
I launch my python. Then I write this: import popen2 popen2.Popen3("mplayer *.mpg") it starts playing for 2 seconds.. and then stops... if I quit python (ctrl - D) mplayer continues to run and plays music as it should... Any ideas? -- http://mail.python.org/mailman/listinfo/python-list

Re: running a C program with python script

2005-03-09 Thread Thomas Ganss
M.N.A.Smadi schrieb: hi; how can i do the following: 1- run a C program from a python script 2- pass that C program an argument 3- Read the out of the program into a buffer that is local to the script thanks m.smadi in addition to the other approaches: if you want only a few specific lines of c you

[CherryPy]Serve dynamic binary file in cherrypy?

2005-03-09 Thread mep
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 & python 2.4 -- Best Regards, Wang Kebo http://www.huihoo.org/~mep -- http://

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

2005-03-09 Thread Steve Holden
alexrait1 wrote: I launch my python. Then I write this: import popen2 popen2.Popen3("mplayer *.mpg") it starts playing for 2 seconds.. and then stops... if I quit python (ctrl - D) mplayer continues to run and plays music as it should... Any ideas? It looks like the process you start is blocking on

removing command prompt excecuting python

2005-03-09 Thread Raghul
friends When i execute the python bu dbleclick in windows a command prompt run s at back what to do to stop the command prompt running back when running python. pls give me a solution -- http://mail.python.org/mailman/listinfo/python-list

Re: removing command prompt excecuting python

2005-03-09 Thread mep
Change python file extension from .py to .pyw -- Best Regards, Wang Kebo http://www.huihoo.org/~mep "Raghul" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > friends > When i execute the python bu dbleclick in windows a command > prompt run s at back what to do to stop t

reading timestamp from vid file (avi)

2005-03-09 Thread flupke
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 process a directory of video fi

Re: function with a state

2005-03-09 Thread Xah Lee
Nevermind. I was thinking too much. :) Thanks. Xah Peter Hansen wrote: > Xah Lee wrote: > >>def myFun(var): > >> return var+1 > >>globe = 0 > >>globe = myFun(globe) > > > > this is intriguing. How does it work? > > not a rhetorical question, but where in the python doc can i read about > > it

Re: py2exe Python2.4 and "warning: string/unicode conversion"

2005-03-09 Thread Miki Tebeka
Hello "Martin, > > I'm shipping an application using py2exe. > >With Python2.3 it worked fine but when switching to Python2.4 I started > >getting "warning: string/unicode conversion" all over the place. > > > >Any ideas how to solve this (other than using 'filterwarnings')? > > It is really sur

Re: Best way to make a list unique?

2005-03-09 Thread Kent Johnson
Delaney, Timothy C (Timothy) wrote: Diez B. Roggisch wrote: This is actually one thing that Java 1.5 has that I'd like to see in Python - the LinkedHashSet and LinkedHashMap. Very useful data structures. Implementing these is fairly simple. There are two Ordered Dictionary recipes in the cookbook a

Re: Small but significant memory leak in Pyana XSLT processor

2005-03-09 Thread Brian Quinlan
Ola Natvig wrote: I've isolated the problem a bit more. The script will not leak if line 25: transformer.transform2String(transformer.parseSource(xml), xslt) is changed to: transformer.transform2String(xml, xslt) Looks like the DOM tree or at least parts of it are not freed. But there are no need t

Python COM Class Question

2005-03-09 Thread pemo
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: Dim PythonU

Re: Working on a log in script to my webpage

2005-03-09 Thread Pete.....
Hi again. This question might sound a bit strange, but here I go anyway. I found a tutorial on how to make member areas with ASP. ( It looked very complicated the info I found about making and using cookies to store session ID's with python) Can I use python code and SQL statements in ASP. Th

Re: function with a state

2005-03-09 Thread Dan Bishop
[EMAIL PROTECTED] wrote: > Xah Lee <[EMAIL PROTECTED]> wrote: > > > is it possible in Python to create a function that maintains a > > variable value? > > Yes. There's no concept of a 'static' function variable as such, but > there are many other ways to achieve the same thing. > > > globe=0; > > d

Re: Python 2.4 removes None data type?

2005-03-09 Thread Jacek Generowicz
Warren Postma <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: > > > I just read in the 'What's New in Python 2.4' document that the None > > data type was converted to a constant: > > http://python.org/doc/2.4/whatsnew/node15.html > > Implication: A long standing wart in Python now gone.

[perl-python] a program to delete duplicate files

2005-03-09 Thread Xah Lee
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 prints out which file are redundant copies. Here's the spec.

Re: Working on a log in script to my webpage

2005-03-09 Thread Pete.....
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 2) When page1 is loaded(upon correctly entered username/password) the c

Re: reading timestamp from vid file (avi)

2005-03-09 Thread Lucas Raab
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 process a director

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

2005-03-09 Thread mep
Resolved. Simplely specifiy content mime type before return. -- Best Regards, Wang Kebo http://www.huihoo.org/~mep "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 cherry

Re: Best way to make a list unique?

2005-03-09 Thread Marc Christiansen
Michael Spencer <[EMAIL PROTECTED]> wrote: Nice. When you replace None by an object(), you have no restriction on the elements any more: > Here's something to work with: > > class OrdSet(object): > def __init__(self, iterable): > """Build an ordered, unique collection of hashable ite

Re: Working on a log in script to my webpage

2005-03-09 Thread Kent Johnson
Pete. wrote: Hi all I am working on a log in script for my webpage. I have the username and the password stored in a PostgreSQL database. You might want to look at Snakelets and CherryPy. Snakelets is "a very simple-to-use Python web application server." One of the features is "Easy user authe

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

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

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

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

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 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: 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: 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: 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: 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: [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

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

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

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

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

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

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: [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 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: 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 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: 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

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

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

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

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

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

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

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: 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: 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 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 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: 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: 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: 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"

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

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

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

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

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

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

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

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

[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: 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,

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

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

[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

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

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

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

  1   2   >