Re: Managing a multiple threaded service

2009-06-16 Thread Mark Hammond
On 17/06/2009 4:23 PM, Paul Hemans wrote: Hi, New to Python I've got 2 threads 1 is the SimpleHTTPRequestHandler, the other polls a site for data. I want to run the program as a windows service. My questions are: Should both of them run as threads and then just have an infinite loop with a s

Re: question about a command like 'goto ' in Python's bytecode or it's just a compiler optimization?

2009-06-16 Thread Tim Roberts
higer wrote: > >My Python version is 2.5.2; When I reading the bytecode of some pyc >file, I always found that there are many jump command from different >position,but to the same position. You can see this situation in >following code(this bytecode is just from one .pyc file and I don't >have its

Re: first full alpha release of PyLab_Works v0.3

2009-06-16 Thread Martin P. Hellwig
edexter wrote: On Jun 16, 12:27 pm, Stef Mientki wrote: hello, I am pleased to announce the first full alpha release of PyLab_Works, v0.3. PyLab_Works is a modular Visual Development Environment, based on data-flow programming technics. PyLab_Works is specially aimed at Education, Engineering

Re: simple GUI for my application?

2009-06-16 Thread Tim Roberts
Tim Harig wrote: > >IronPython is not a GUI toolkit per se. It is a python implementation >build on top of .Net like Jython is built on top of Java. I therefore has >access to the MFCs which can be used to create native Windows GUIs. That's not correct. MFC is strictly a native C++ concept.

Managing a multiple threaded service

2009-06-16 Thread Paul Hemans
Hi, New to Python I've got 2 threads 1 is the SimpleHTTPRequestHandler, the other polls a site for data. I want to run the program as a windows service. My questions are: Should both of them run as threads and then just have an infinite loop with a sleep in the main thread in order to stop t

Re: question about a command like 'goto ' in Python's bytecode or it's just a compiler optimization?

2009-06-16 Thread Diez B. Roggisch
higer schrieb: My Python version is 2.5.2; When I reading the bytecode of some pyc file, I always found that there are many jump command from different position,but to the same position. You can see this situation in following code(this bytecode is just from one .pyc file and I don't have its sou

Re: How to get the total size of a local hard disk?

2009-06-16 Thread Tim Roberts
willgun wrote: > >Unfortunately,I'm on win32. >Actually,I prefer a cross-platform method. Why do you need this? This kind of information is not very useful in a cross-platform application. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/

Re: Exceptions and Object Destruction (was: Problem with apsw and garbage collection)

2009-06-16 Thread Steven D'Aprano
On Wed, 17 Jun 2009 17:52:30 +1200, Lawrence D'Oliveiro wrote: > In message , > Steven D'Aprano wrote: > >> On Tue, 16 Jun 2009 16:45:43 +1200, Lawrence D'Oliveiro wrote: >> >>> In message , Piet van Oostrum wrote: >>> The exact time of the destruction of objects is an implementation

Re: parsing json using simplejson

2009-06-16 Thread Tim Roberts
deostroll wrote: > >I want to be able to parse it into python objects. Any ideas? What did you not like about the very useful replies you have already received? -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Exceptions and Object Destruction (was: Problem with apsw and garbage collection)

2009-06-16 Thread Paul Rubin
Lawrence D'Oliveiro writes: > > Reference counting is an implementation detail used by CPython but not > > [implementations built on runtimes designed for corporate-herd-oriented > > languages, like] IronPython or Jython. > > I rest my case. You're really being pretty ignorant. I don't know of

Re: Measuring Fractal Dimension ?

2009-06-16 Thread Paul Rubin
Jaime Fernandez del Rio writes: > I am pretty sure that a continuous sequence of > curves that converges to a continuous curve, will do so uniformly. I think a typical example of a curve that's continuous but not uniformly continuous is f(t) = sin(1/t), defined when t > 0 It is continuous at

Re: walking a directory with very many files

2009-06-16 Thread Lawrence D'Oliveiro
In message <20090617091858.432f8...@malediction>, Mike Kazantsev wrote: > On Wed, 17 Jun 2009 14:52:28 +1200 > Lawrence D'Oliveiro wrote: > >> In message >> <234b19ac-7baf-4356-9fe5-37d00146d...@z9g2000yqi.googlegroups.com>, >> thebjorn wrote: >> >> > Not proud of this, but...: >> > >> > [djan

Re: Exceptions and Object Destruction (was: Problem with apsw and garbage collection)

2009-06-16 Thread Lawrence D'Oliveiro
In message , Steven D'Aprano wrote: > On Tue, 16 Jun 2009 16:45:43 +1200, Lawrence D'Oliveiro wrote: > >> In message , Piet van Oostrum wrote: >> >>> The exact time of the destruction of objects is an implementation >>> detail and should not be relied upon. >> >> That may be true in Java and o

Re: SIP v4.8.1 Released

2009-06-16 Thread Lawrence D'Oliveiro
In message , Phil Thompson wrote: > SIP is a tool for generating Python modules that wrap C or C++ libraries. > It is similar to SWIG. It is used to generate PyQt and PyKDE. I find the name confusing. Every time I hear it I think "Session Initiation Protocol". OK, so I've been spending too mu

RE: Good books in computer science?

2009-06-16 Thread Lawrence D'Oliveiro
In message , Phil Runciman wrote: > FWIW I actually dislike this book! Why? -- http://mail.python.org/mailman/listinfo/python-list

Exotic Logics

2009-06-16 Thread William Clifford
I was staring at a logic table the other day, and I asked myself, "what if one wanted to play with exotic logics; how might one do it?" I did some searching but not being too sure of what to look for and carried away with my own enthusiasm for the idea, I didn't find much. What I've come up with is

Re: walking a directory with very many files

2009-06-16 Thread Lawrence D'Oliveiro
In message , Jean-Paul Calderone wrote: > The problem is that POSIX specifies the fields with types like off_t and > ino_t. Since ctypes doesn't know anything about these types, application > code has to specify their size and other attributes. As these vary from > platform to platform, you can

Re: Tool for browsing python code

2009-06-16 Thread Horace Blegg
On Tue, Jun 16, 2009 at 3:15 PM, Daniel Fetchinson < fetchin...@googlemail.com> wrote: > >> "D'Arcy J.M. Cain" writes: > >> >> not sure if there are any "curses" base TUI's (!) for Python. > >> > vi > >> > >> emacs :) > > > > Hey, it was all pretty civil up till now. ;) > > I've heard from my co

Re: Re: Executing a python script while it is running

2009-06-16 Thread Zach Hobesh
On Tue, Jun 16, 2009 at 6:37 PM, Chris Rebert wrote: > On Tue, Jun 16, 2009 at 6:21 PM, wrote: >> Hey Dave, >> >> Thanks for the helpful responses. >> >>> Option 2 is what you get by default.  Naturally it depends on what the >>> application  is using to launch the batch file, but the most common

Re: Measuring Fractal Dimension ?

2009-06-16 Thread Jaime Fernandez del Rio
On Wed, Jun 17, 2009 at 4:50 AM, Lawrence D'Oliveiro wrote: > In message <7x63ew3uo9@ruckus.brouhaha.com>,  wrote: > >> Lawrence D'Oliveiro writes: >> >>> I don't think any countable set, even a countably-infinite set, can have >>> a fractal dimension. It's got to be uncountably infinite, and

Re: walking a directory with very many files

2009-06-16 Thread Mike Kazantsev
On Wed, 17 Jun 2009 03:42:02 GMT Lie Ryan wrote: > Mike Kazantsev wrote: > > In fact, on modern filesystems it doesn't matter whether you > > accessing /path/f9e95ea4926a4 with million files in /path > > or /path/f/9/e/95ea with only hundred of them in each path. Former > > case (all-in-one-path)

Re: Newbie question about method options

2009-06-16 Thread Tim Harig
On 2009-06-17, python-newbie113 wrote: > If i use, create_arc(bbox, options) => id > what is id? and how do i find the parameter list representing options? I am not familiar with tkinker; but, the expression is just showing a function prototype. The function part should be self-explanitory. Jud

Newbie question about method options

2009-06-16 Thread python-newbie113
I am new to python and have a question about using methods. Here is the link i am looking at: http://www.pythonware.com/library/tkinter/introduction/x2102-methods.htm If i use, create_arc(bbox, options) => id what is id? and how do i find the parameter list representing options? Thanks for help

Re: Logging multiple lines

2009-06-16 Thread Lie Ryan
Nikolaus Rath wrote: > Hi, > > Are there any best practices for handling multi-line log messages? > > For example, the program, > > main = logging.getLogger() > handler = logging.StreamHandler() > handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s > %(message)s')) >

Re: Perl's @foo[3,7,1,-1] ?

2009-06-16 Thread Pierre Bourdon
On Wed, Jun 17, 2009 at 04:14, Steven D'Aprano wrote: > What's np.arange? import numpy as np -- Pierre "delroth" Bourdon Étudiant à l'EPITA / Student at EPITA -- http://mail.python.org/mailman/listinfo/python-list

Re: walking a directory with very many files

2009-06-16 Thread Lie Ryan
Mike Kazantsev wrote: > On Wed, 17 Jun 2009 14:52:28 +1200 > Lawrence D'Oliveiro wrote: > >> In message >> <234b19ac-7baf-4356-9fe5-37d00146d...@z9g2000yqi.googlegroups.com>, >> thebjorn wrote: >> >>> Not proud of this, but...: >>> >>> [django] www4:~/datakortet/media$ ls bfpbilder|wc -l >>> 17

question about a command like 'goto ' in Python's bytecode or it's just a compiler optimization?

2009-06-16 Thread higer
My Python version is 2.5.2; When I reading the bytecode of some pyc file, I always found that there are many jump command from different position,but to the same position. You can see this situation in following code(this bytecode is just from one .pyc file and I don't have its source .py file): .

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread Lie Ryan
Wolfgang Rohdewald wrote: > On Wednesday, 17. June 2009, Steven D'Aprano wrote: >> while text: >> for c in text: >> if c not in printable: return False > > that is one loop per character. unless printable is a set > wouldn't it be faster to apply a regex to te

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread Lie Ryan
Scott David Daniels wrote: > norseman wrote: >> Scott David Daniels wrote: >>> Dave Angel wrote: Jorge wrote: ... > I'm making a application that reads 3 party generated ASCII files, > but some times the files are corrupted totally or partiality and I > need to know if it's a ASCI

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread Wolfgang Rohdewald
On Wednesday, 17. June 2009, Steven D'Aprano wrote: > while text: > for c in text: > if c not in printable: return False that is one loop per character. wouldn't it be faster to apply a regex to text? something like while text: if re.search(r'\W',text)

Re: Logging multiple lines

2009-06-16 Thread Mike Kazantsev
On Tue, 16 Jun 2009 22:22:31 -0400 Nikolaus Rath wrote: > How do you usually handle multi-line messages? Do you avoid them > completely (and therefore also the exception logging facilities > provided by logging)? Or is it possible to tweak the formatter so > that it inserts the prefix at the begi

Re: walking a directory with very many files

2009-06-16 Thread Mike Kazantsev
On Wed, 17 Jun 2009 14:52:28 +1200 Lawrence D'Oliveiro wrote: > In message > <234b19ac-7baf-4356-9fe5-37d00146d...@z9g2000yqi.googlegroups.com>, > thebjorn wrote: > > > Not proud of this, but...: > > > > [django] www4:~/datakortet/media$ ls bfpbilder|wc -l > > 174197 > > > > all .jpg files b

Logging multiple lines

2009-06-16 Thread Nikolaus Rath
Hi, Are there any best practices for handling multi-line log messages? For example, the program, main = logging.getLogger() handler = logging.StreamHandler() handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s')) main.addHandler(handler) main.setLev

Re: walking a directory with very many files

2009-06-16 Thread Lawrence D'Oliveiro
In message <234b19ac-7baf-4356-9fe5-37d00146d...@z9g2000yqi.googlegroups.com>, thebjorn wrote: > Not proud of this, but...: > > [django] www4:~/datakortet/media$ ls bfpbilder|wc -l > 174197 > > all .jpg files between 40 and 250KB with the path stored in a database > field... *sigh* Why not p

Re: Executing a python script while it is running

2009-06-16 Thread Lie Ryan
Zach Hobesh wrote: >> A lot more information would be useful. What version of Python, and what >> operating system environment? Exactly what would you like to happen when >> the batch file is invoked a second time? > > I'm running Python 2.6.2 on Windows. I'm passing filenames to the > batch fi

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread Steven D'Aprano
On Tue, 16 Jun 2009 10:42:58 -0700, Scott David Daniels wrote: > Dave Angel wrote: >> Jorge wrote: >>> Hi there, >>> I'm making a application that reads 3 party generated ASCII files, >>> but some >>> times >>> the files are corrupted totally or partiality and I need to know if >>> it's a >>> ASC

Re: Measuring Fractal Dimension ?

2009-06-16 Thread Lawrence D'Oliveiro
In message <7x63ew3uo9@ruckus.brouhaha.com>, wrote: > Lawrence D'Oliveiro writes: > >> I don't think any countable set, even a countably-infinite set, can have >> a fractal dimension. It's got to be uncountably infinite, and therefore >> uncomputable. > > I think the idea is you assume unif

Re: Newbie help for using multiprocessing and subprocess packages for creating child processes

2009-06-16 Thread Mike Kazantsev
On Tue, 16 Jun 2009 23:20:05 +0200 Piet van Oostrum wrote: > > Matt (M) wrote: > > >M> Try replacing: > >M> cmd = [ "ls /path/to/file/"+staname+"_info.pf" ] > >M> with: > >M> cmd = [ “ls”, “/path/to/file/"+staname+"_info.pf" ] > > In addition I would like to remark that -- if the o

Re: doctests and decorators

2009-06-16 Thread Steven D'Aprano
On Tue, 16 Jun 2009 12:04:32 -0700, Scott David Daniels wrote: > Eric Snow wrote: >> In general should decorators always hide themselves? I am guessing >> not, otherwise this would already be part of their behavior. Still, is >> it the common case to camouflage the decorator like this? If so, I

Re: Perl's @foo[3,7,1,-1] ?

2009-06-16 Thread Steven D'Aprano
On Wed, 17 Jun 2009 01:50:55 +, Alan G Isaac wrote: > On 6/13/2009 2:11 PM kj apparently wrote: >> Switching from Perl here, and having a hard time letting go... >> >> Suppose I have an "array" foo, and that I'm interested in the 4th, 8th, >> second, and last element in that array. In Perl I

Re: Perl's @foo[3,7,1,-1] ?

2009-06-16 Thread Alan G Isaac
On 6/13/2009 2:11 PM kj apparently wrote: > Switching from Perl here, and having a hard time letting go... > > Suppose I have an "array" foo, and that I'm interested in the 4th, 8th, > second, and last element in that array. In Perl I could write: > > my @wanted = @foo[3, 7, 1, -1]; >>> a = n

Re: Re: Executing a python script while it is running

2009-06-16 Thread Chris Rebert
On Tue, Jun 16, 2009 at 6:21 PM, wrote: > Hey Dave, > > Thanks for the helpful responses. > >> Option 2 is what you get by default.  Naturally it depends on what the >> application  is using to launch the batch file, but the most common cases >> will launch a separate process. > > The app ended up

Re: Re: Executing a python script while it is running

2009-06-16 Thread hobesh
Hey Dave, Thanks for the helpful responses. Option 2 is what you get by default. Naturally it depends on what the application is using to launch the batch file, but the most common cases will launch a separate process. The app ended up delaying starting the second batch file until it finis

Re: first full alpha release of PyLab_Works v0.3

2009-06-16 Thread edexter
On Jun 16, 12:27 pm, Stef Mientki wrote: > hello, > > I am pleased to announce the first full alpha release of PyLab_Works, v0.3. > > PyLab_Works is a modular Visual Development Environment, based on > data-flow programming technics. PyLab_Works is specially aimed at > Education, Engineering and S

Re: Executing a python script while it is running

2009-06-16 Thread Dave Angel
Zach Hobesh wrote: A lot more information would be useful. What version of Python, and what operating system environment? Exactly what would you like to happen when the batch file is invoked a second time? I'm running Python 2.6.2 on Windows. I'm passing filenames to the batch files and

Re: python-2.6.2 Exception: TypeError: "'NoneType' object is not callable" in ignored

2009-06-16 Thread Terry Reedy
John Machin wrote: Yes, I forgot that Exception TypeError: "'NoneType' object is not callable" in ignored should be parsed as '''Exception TypeError: "'NoneType' object is not callable" in''' [was] ignored rather than read as Exception TypeError: "'NoneType' object is not callable" in ig

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread norseman
Scott David Daniels wrote: norseman wrote: Scott David Daniels wrote: Dave Angel wrote: Jorge wrote: ... I'm making a application that reads 3 party generated ASCII files, but some times the files are corrupted totally or partiality and I need to know if it's a ASCII file with *nix line ter

Re: Executing a python script while it is running

2009-06-16 Thread Zach Hobesh
> A lot more information would be useful.  What version of Python, and what > operating system environment?  Exactly what would you like to happen when > the batch file is invoked a second time? I'm running Python 2.6.2 on Windows. I'm passing filenames to the batch files and I need all filenames

Re: Executing a python script while it is running

2009-06-16 Thread Dave Angel
Zach Hobesh wrote: Hi everybody, Here's my situation: I have a batch file that calls a python script. This batch file is triggered by an outside application when the application completes a task. The problem is that while the batch file (and pythons script) is running, the application will co

Re: Guidance on initialization code in a module

2009-06-16 Thread David Stanek
On Tue, Jun 16, 2009 at 4:54 PM, mrstevegross wrote: > Is there a common way to initialize various stuff in a module? That > is, I have some code in my module that I want to run whenever the > module is imported. Currently, my module looks like this: > > === foo.py === > def something(): >  ... > >

Re: Guidance on initialization code in a module

2009-06-16 Thread Dave Angel
mrstevegross wrote: Is there a common way to initialize various stuff in a module? That is, I have some code in my module that I want to run whenever the module is imported. Currently, my module looks like this: === foo.py === def something(): ... def somethingelse(): ... something() === E

Re: Tool for browsing python code

2009-06-16 Thread Daniel Fetchinson
>> "D'Arcy J.M. Cain" writes: >> >> not sure if there are any "curses" base TUI's (!) for Python. >> > vi >> >> emacs :) > > Hey, it was all pretty civil up till now. ;) I've heard from my cousin that his former high school classmate's uncle did a research on a large statistical sample of progra

Re: Guidance on initialization code in a module

2009-06-16 Thread Scott David Daniels
mrstevegross wrote: Is there a common way to initialize various stuff in a module? That is, I have some code in my module that I want to run whenever the module is imported. Currently, my module looks like this: === foo.py === def something(): ... def somethingelse(): ... something() === E

Re: Executing a python script while it is running

2009-06-16 Thread Grant Edwards
On 2009-06-16, Zach Hobesh wrote: > I have a batch file that calls a python script. > > This batch file is triggered by an outside application when the > application completes a task. The problem is that while the batch > file (and pythons script) is running, the application will complete > the

Re: Executing a python script while it is running

2009-06-16 Thread Gary Herron
Zach Hobesh wrote: Hi everybody, Here's my situation: I have a batch file that calls a python script. This batch file is triggered by an outside application when the application completes a task. The problem is that while the batch file (and pythons script) is running, the application will co

Re: Input problem

2009-06-16 Thread Piet van Oostrum
> Lie Ryan (LR) wrote: >LR> Piet van Oostrum wrote: Prasoon (P) wrote: >>> >P> What is the difference between >P> z=int(raw_input()) and z=eval(raw_input())(I thought them to be >P> the same in case of integers) >>> >P> I mean when an integer is entered in that case are they s

Executing a python script while it is running

2009-06-16 Thread Zach Hobesh
Hi everybody, Here's my situation: I have a batch file that calls a python script. This batch file is triggered by an outside application when the application completes a task. The problem is that while the batch file (and pythons script) is running, the application will complete the next task,

Re: Newbie help for using multiprocessing and subprocess packages for creating child processes

2009-06-16 Thread Piet van Oostrum
> Matt (M) wrote: >M> Try replacing: >M> cmd = [ "ls /path/to/file/"+staname+"_info.pf" ] >M> with: >M> cmd = [ “ls”, “/path/to/file/"+staname+"_info.pf" ] In addition I would like to remark that -- if the only thing you want to do is to start up a new command with subprocess.Popen -

Re: strptime issue in multi-threaded application

2009-06-16 Thread Christian Heimes
Joe Holloway schrieb: > We recently uplifted our web application to run on Python 2.6.2. > We've noticed on a couple occasions that calls into time.strptime have > failed with this exception: > > ImportError: Failed to import _strptime because the import lockis > [sic] held by another thread. The

Re: Newbie help for using multiprocessing and subprocess packages for creating child processes

2009-06-16 Thread Rob Newman
Thanks Matt - that worked. Kind regards, - Rob On Jun 16, 2009, at 12:47 PM, Matt wrote: Try replacing: cmd = [ "ls /path/to/file/"+staname+"_info.pf" ] with: cmd = [ “ls”, “/path/to/file/"+staname+"_info.pf" ] Basically, the first is the conceptual equivalent of executing the following

Re: Python WSDL Support

2009-06-16 Thread Piet van Oostrum
> Chris (C) wrote: >C> Is there any modern support for WSDL? The only projects I could find >C> are ZSI and SOAPpy, and both have been dead for several years. That is not necessarily bad. But for the client side there is also suds (https://fedorahosted.org/suds/). And you may also look for

Re: Build problem on Solaris 9

2009-06-16 Thread kai
On Jun 16, 12:15 am, "Martin v. Löwis" wrote: > > When I run make after successively running ./configure, I got the > > following Error message: > > ./Parser/asdl_c.py -c ./Python ./Parser/Python.asdl > > /usr/bin/env: No such file or directory > > make: *** [Python/Python-ast.c] Error 127 Thank y

Re: Python WSDL Support

2009-06-16 Thread Waldemar Osuch
On Jun 16, 12:24 pm, Chris wrote: > Is there any modern support for WSDL? The only projects I could find > are ZSI and SOAPpy, and both have been dead for several years. https://fedorahosted.org/suds/ is actively maintained -- http://mail.python.org/mailman/listinfo/python-list

Guidance on initialization code in a module

2009-06-16 Thread mrstevegross
Is there a common way to initialize various stuff in a module? That is, I have some code in my module that I want to run whenever the module is imported. Currently, my module looks like this: === foo.py === def something(): ... def somethingelse(): ... something() === EOF === Is the 'someth

Re: Input problem

2009-06-16 Thread Lie Ryan
Piet van Oostrum wrote: >> Prasoon (P) wrote: > >> P> What is the difference between >> P> z=int(raw_input()) and z=eval(raw_input())(I thought them to be >> P> the same in case of integers) > >> P> I mean when an integer is entered in that case are they same and when >> P> an integer in

Re: Tool for browsing python code

2009-06-16 Thread D'Arcy J.M. Cain
On Tue, 16 Jun 2009 21:22:12 +0100 Arnaud Delobelle wrote: > "D'Arcy J.M. Cain" writes: > >> not sure if there are any "curses" base TUI's (!) for Python. > > vi > > emacs :) Hey, it was all pretty civil up till now. ;) -- D'Arcy J.M. Cain | Democracy is three wolves http://www.dru

Re: mac text files & for line

2009-06-16 Thread Humberto
On Jun 16, 1:39 pm, MRAB wrote: > Humberto wrote: > > Greetings. > > > This is probably a v. basic question, but my apologies as I'm > > relatively new w/ this. > > > But I am attempting to use for line to iterate through a text > > file, but I am working on a Mac and am getting a single block of

Re: waling a directory with very many files

2009-06-16 Thread Nick Craig-Wood
Nick Craig-Wood wrote: > Jean-Paul Calderone wrote: > > On Mon, 15 Jun 2009 09:29:33 -0500, Nick Craig-Wood > > wrote: > > >Hrvoje Niksic wrote: > > >> Nick Craig-Wood writes: > > >> > > >> > Here is a ctypes generator listdir for unix-like OSes. > > >> > > >> ctypes code scares me with i

Re: mac text files & for line

2009-06-16 Thread Lie Ryan
Humberto wrote: > Greetings. > > This is probably a v. basic question, but my apologies as I'm > relatively new w/ this. > > But I am attempting to use for line to iterate through a text > file, but I am working on a Mac and am getting a single block of text. > I assume this is because of the Mac

Re: Tool for browsing python code

2009-06-16 Thread Arnaud Delobelle
"D'Arcy J.M. Cain" writes: > On Tue, 16 Jun 2009 18:25:00 +0530 > Banibrata Dutta wrote: >> not sure if there are any "curses" base TUI's (!) for Python. > > vi emacs :) -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list

Re: strange behavior with os.system

2009-06-16 Thread Piet van Oostrum
> kmw (k) wrote: >k> Hi, >k> I wanted to write a simple script (in 5 minutes or so) which replaces >k> the option '+1' given to the command 'sort' by '-k 2' and than runs >k> 'sort' with the modified argument list. After two hours I am giving up >k> and ask you for help. This is what I tried

Re: PSP Text Editor

2009-06-16 Thread Piet van Oostrum
Reading your question again I think I have probably misunderstood it. You want to an editor to edit Python Server Pages? -- Piet van Oostrum URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4] Private email: p...@vanoostrum.org -- http://mail.python.org/mailman/listinfo/python-list

Re: PSP Text Editor

2009-06-16 Thread Piet van Oostrum
> Johnson Mpeirwe (JM) wrote: >JM> Hi all, >JM> Does anyone know of any good Python Server Pages text editor that can >JM> provide indentation, syntax highlighting, etc.. A text editor in a web context doesn't run on the server but in the browser. Therefore it should use client-side scriptin

[ANN] first full alpha release of PyLab_Works v0.3

2009-06-16 Thread Stef Mientki
hello, I am pleased to announce the first full alpha release of PyLab_Works, v0.3. PyLab_Works is a modular Visual Development Environment, based on data-flow programming technics. PyLab_Works is specially aimed at Education, Engineering and Science. The ideas behind PyLab_Works are, that the

Re: Input problem

2009-06-16 Thread Piet van Oostrum
> Prasoon (P) wrote: >P> What is the difference between >P> z=int(raw_input()) and z=eval(raw_input())(I thought them to be >P> the same in case of integers) >P> I mean when an integer is entered in that case are they same and when >P> an integer in not entered,in that case how are they

Re: Newbie help for using multiprocessing and subprocess packages for creating child processes

2009-06-16 Thread Matt
Try replacing: cmd = [ "ls /path/to/file/"+staname+"_info.pf" ] with: cmd = [ “ls”, “/path/to/file/"+staname+"_info.pf" ] Basically, the first is the conceptual equivalent of executing the following in BASH: ‘ls /path/to/file/FOO_info.pf’ The second is this: ‘ls’ ‘/path/to/file/FOO_info.pf

Re: Good books in computer science?

2009-06-16 Thread Aahz
In article <8f093893-310a-4f0f-9e67-61393c234...@f38g2000pra.googlegroups.com>, Aaron Watters wrote: > >This is the best book ever written on computer science >and the first edition is free. > >http://www.math.upenn.edu/~wilf/AlgComp3.html Thanks! -- Aahz (a...@pythoncraft.com) <*>

Re: ImageEnhance.Contrast - is this fishy or what?

2009-06-16 Thread Scott David Daniels
Scott David Daniels wrote: roop wrote: I was browsing ImageEnhace.py, and found something that I thought was odd in class Contrast: class Contrast(_Enhance): "Adjust image contrast" ... Good catch [I'll send a copy to the imaging sig]. If you replace class ... Over on image-sig, F

Newbie help for using multiprocessing and subprocess packages for creating child processes

2009-06-16 Thread Rob Newman
Hi All, I am new to Python, and have a very specific task to accomplish. I have a command line shell script that takes two arguments: create_graphs.sh -v --sta=STANAME where STANAME is a string 4 characters long. create_graphs creates a series of graphs using Matlab (among other 3rd party

Re: mac text files & for line

2009-06-16 Thread Scott David Daniels
MRAB wrote: Humberto wrote: But I am attempting to use for line to iterate through a text file, but I am working on a Mac and am getting a single block of text. I assume this is because of the Mac {CR} usage vs. line feed. Is there a programmatic way to use for line to interpret the carriage re

Re: simple GUI for my application?

2009-06-16 Thread Mike Driscoll
On Jun 16, 1:24 pm, Tim Harig wrote: > On 2009-06-16, Mike Driscoll wrote: > > > On Jun 16, 9:20 am, Filipe Teixeira wrote: > >> Hi, I'm really struggling to find the best GUI to make a simple > >> application. > [SNIP] > >> Basically I will use a lot of edit boxes and some tabs, and a folder >

Re: strptime issue in multi-threaded application

2009-06-16 Thread Scott David Daniels
MRAB wrote: Joe Holloway wrote: We recently uplifted our web application to run on Python 2.6.2. We've noticed on a couple occasions that calls into time.strptime have failed with this exception: [2] http://svn.python.org/view?view=rev&revision=59678 A simple workaround might be to sleep a sho

Re: doctests and decorators

2009-06-16 Thread Scott David Daniels
Eric Snow wrote: In general should decorators always hide themselves? I am guessing not, otherwise this would already be part of their behavior. Still, is it the common case to camouflage the decorator like this? If so, I would expect it to be the default behavior of decorators. The Python g

Re: Measuring Fractal Dimension ?

2009-06-16 Thread David C . Ullrich
On 15 Jun 2009 04:55:03 GMT, Steven D'Aprano wrote: >On Sun, 14 Jun 2009 14:29:04 -0700, Kay Schluehr wrote: > >> On 14 Jun., 16:00, Steven D'Aprano >> wrote: >> >>> Incorrect. Koch's snowflake, for example, has a fractal dimension of >>> log 4/log 3 ? 1.26, a finite area of 8/5 times that of t

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread Scott David Daniels
norseman wrote: Scott David Daniels wrote: Dave Angel wrote: Jorge wrote: ... I'm making a application that reads 3 party generated ASCII files, but some times the files are corrupted totally or partiality and I need to know if it's a ASCII file with *nix line terminators. In linux I can ru

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread MRAB
norseman wrote: Scott David Daniels wrote: Dave Angel wrote: Jorge wrote: Hi there, I'm making a application that reads 3 party generated ASCII files, but some times the files are corrupted totally or partiality and I need to know if it's a ASCII file with *nix line terminators. In linux

Re: simple GUI for my application?

2009-06-16 Thread Tim Harig
On 2009-06-16, Mike Driscoll wrote: > On Jun 16, 9:20 am, Filipe Teixeira wrote: >> Hi, I'm really struggling to find the best GUI to make a simple >> application. [SNIP] >> Basically I will use a lot of edit boxes and some tabs, and a folder >> tree, any tips so I can search in the right place?

Re: Measuring Fractal Dimension ?

2009-06-16 Thread Paul Rubin
Lawrence D'Oliveiro writes: > I don't think any countable set, even a countably-infinite set, can have a > fractal dimension. It's got to be uncountably infinite, and therefore > uncomputable. I think the idea is you assume uniform continuity of the set (as expressed by a parametrized curve).

Re: how to import a name from a module-path?

2009-06-16 Thread thebjorn
On Jun 16, 7:43 pm, Gary Herron wrote: > thebjorn wrote: > > I'm storing the path to functions in a database and now I'd like to > > get a reference so I can execute them. > > > I looked briefly at the imp module and got very confused...  Currently > > I'm doing this: > > >   def import_object(pat

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread norseman
Scott David Daniels wrote: Dave Angel wrote: Jorge wrote: Hi there, I'm making a application that reads 3 party generated ASCII files, but some times the files are corrupted totally or partiality and I need to know if it's a ASCII file with *nix line terminators. In linux I can run the fil

Re: doctests and decorators

2009-06-16 Thread Scott David Daniels
Eric Snow wrote: ... One work-around I found is the following change in example: test1.py def decorator(function): def new_function(*args, **kwargs): return function(*args, **kwargs) new_function.__module__ = function.__module__ new_function.__doc_

Re: simple GUI for my application?

2009-06-16 Thread Mike Driscoll
On Jun 16, 9:20 am, Filipe Teixeira wrote: > Hi, I'm really struggling to find the best GUI to make a simple > application. > > I'm doing a program to load all the ini files in the current folder, > or the folder that the user chooses and list the specifics entries in > it. > > So, the program wou

Re: how to import a name from a module-path?

2009-06-16 Thread Gary Herron
thebjorn wrote: I'm storing the path to functions in a database and now I'd like to get a reference so I can execute them. I looked briefly at the imp module and got very confused... Currently I'm doing this: def import_object(path): module, obj = path.rsplit('.', 1) exec "from r

Re: waling a directory with very many files

2009-06-16 Thread thebjorn
On Jun 15, 6:56 am, Steven D'Aprano wrote: > On Sun, 14 Jun 2009 22:35:50 +0200, Andre Engels wrote: > > On Sun, Jun 14, 2009 at 6:35 PM, tom wrote: > >> i can traverse a directory using os.listdir() or os.walk(). but if a > >> directory has a very large number of files, these methods produce very

Re: Need to know if a file as only ASCII charaters

2009-06-16 Thread Scott David Daniels
Dave Angel wrote: Jorge wrote: Hi there, I'm making a application that reads 3 party generated ASCII files, but some times the files are corrupted totally or partiality and I need to know if it's a ASCII file with *nix line terminators. In linux I can run the file command but the applicatio

Re: doctests and decorators

2009-06-16 Thread Eric Snow
On Jun 16, 11:24 am, Michele Simionato wrote: > On Jun 16, 6:39 pm, Eric Snow wrote: > > > > > On Jun 16, 10:31 am, Christian Heimes wrote: > > > > Eric Snow schrieb: > > > > > Apparently there is a known issue with doctests, in which tests in > > > > functions using externally defined decorator

Re: mac text files & for line

2009-06-16 Thread MRAB
Humberto wrote: Greetings. This is probably a v. basic question, but my apologies as I'm relatively new w/ this. But I am attempting to use for line to iterate through a text file, but I am working on a Mac and am getting a single block of text. I assume this is because of the Mac {CR} usage vs

Re: Funny xmlrpc / linux problem

2009-06-16 Thread Jeff McNeil
On Jun 16, 12:51 pm, Hans Müller wrote: > Richard, > > thanks a lot for your hint, that was completely new for me. > Nagle's optimisation is definitely a good idea in most cases. > > By the way, do you have an idea how to access the underlying socket to modify > the behavier > via the setsockopt

mac text files & for line

2009-06-16 Thread Humberto
Greetings. This is probably a v. basic question, but my apologies as I'm relatively new w/ this. But I am attempting to use for line to iterate through a text file, but I am working on a Mac and am getting a single block of text. I assume this is because of the Mac {CR} usage vs. line feed. Is t

how to import a name from a module-path?

2009-06-16 Thread thebjorn
I'm storing the path to functions in a database and now I'd like to get a reference so I can execute them. I looked briefly at the imp module and got very confused... Currently I'm doing this: def import_object(path): module, obj = path.rsplit('.', 1) exec "from rootpkg.%s import %

  1   2   >