Why is os.stat so slow?

2009-06-16 Thread the_ricka
Hi all, Fairly new to python but have programmed in other languages (C, Java) before. I was experimenting with a python program that needed to take a directory tree and get the total disk usage of every file (and subfolder) underneath it. This solution also has to run on Windows Server 2003 for w

Re: waling a directory with very many files

2009-06-16 Thread Hrvoje Niksic
Nick Craig-Wood writes: > It can be done properly with gccxml though which converts structures > into ctypes definitions. That sounds interesting. > That said the dirent struct is specified by POSIX so if you get the > correct types for all the individual members then it should be > correct eve

Re: : an integer is required

2009-06-16 Thread Ulrich Eckhardt
Dave Angel wrote: > Ulrich Eckhardt wrote: >> open() doesn't take a string as second parameter, see 'help(open)'. >> Instead, it takes one of the integers which are defined as symbols in the >> os module, see 'dir(os)'. > > [...]The second parameter to the builtin function open() is a string[...] >

Re: Build problem on Solaris 9

2009-06-16 Thread Martin v. Löwis
> 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 > > /usr/bin/env deos exist > > Can anyone help me with th

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

2009-06-16 Thread Steven D'Aprano
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 other corporate-herd-oriented languages, > but we

Re: Good books in computer science?

2009-06-16 Thread Joachim Strömbergson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Aloha! dads wrote: > I remember someone earlier in the thread mentioning reading source > code from good coders. I've been wanting to give this a go as it makes > perfect sense, I suppose the standard library would be a good start. > What would your r

Regarding GUI

2009-06-16 Thread abhishek goswami
Hi, I have a very basic question about GUI programming as i am beginner into Python. You are providing many enviroment for GUI programming in python. But could you guide me which is better or frequently used Abhishek Goswami Chennai Phone No -0996227099 Explore and discover exciting

Re: Regarding GUI

2009-06-16 Thread Banibrata Dutta
Kindly search the archives of this mailing list... this is a fairly FAQ, and you should find a relevant thread which isn't older than 2-3 months, IIRC. In brief, you have several options, as you've probably already found, most one of the most popular is wxPython but then there are several other al

Need to know if a file as only ASCII charaters

2009-06-16 Thread Jorge
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 applications should run in windows. Any help wi

Re: On the property function

2009-06-16 Thread koranthala
On Jun 16, 9:19 am, Chris Rebert wrote: > On Mon, Jun 15, 2009 at 5:43 AM, Virgil Stokes wrote: > > Does anyone have a good example (or examples) of when "property(...)" can be > > useful? > > Erm, when you want to create a property (i.e. computed attribute). > > from __future__ import division >

Input problem

2009-06-16 Thread Prasoon
I am new to pythonand using python 2.6 I want to know when to use raw_input( ) and when to use input( )??? According to my interpretation one should use input( ) when entering numbers etc and raw_input( ) when a string is too be entered. Correct me if I am wrong Also if I want to ent

Re: On the property function

2009-06-16 Thread Lie Ryan
Chris Rebert wrote: > On Mon, Jun 15, 2009 at 5:43 AM, Virgil Stokes wrote: >> Does anyone have a good example (or examples) of when "property(...)" can be >> useful? > > Erm, when you want to create a property (i.e. computed attribute). > > from __future__ import division > class TimeDelta(objec

Re: Input problem

2009-06-16 Thread Bearophile
Prasoon: > I am new to pythonand using python 2.6 > I want to know when to use raw_input( ) and when to use input( )??? I think it's better to always use raw_input(), and then convert the string to the data to work on. Once in a while you may want to use input() to input expressions (like for

Re: Input problem

2009-06-16 Thread Francesco Bochicchio
On 16 Giu, 11:32, Prasoon wrote: > I am new to pythonand using python 2.6 > I want to know when to use raw_input( ) and when to use input( )??? > > According to my interpretation one should use input( ) when entering > numbers etc and > raw_input( ) when a string is too be entered. > > Cor

PSP Text Editor

2009-06-16 Thread Johnson Mpeirwe
Hi all, Does anyone know of any good Python Server Pages text editor that can provide indentation, syntax highlighting, etc.. Thank you. Regards, Johnson -- http://mail.python.org/mailman/listinfo/python-list

how to stop a function execution like...

2009-06-16 Thread Gaudha
Is there any built-in function to stop execution of a function similar to stop the program execution by sys.exit? In the example below, I want to skip statement 2... if the 'if' condition is satisfied. Don't advice me to put statement 2 in 'else' block. That's not my intention. May be this a simple

Re: Input problem

2009-06-16 Thread Prasoon
On Jun 16, 3:34 pm, Francesco Bochicchio wrote: > On 16 Giu, 11:32, Prasoon wrote:> I am new to > pythonand using python 2.6 > > I want to know when to use raw_input( ) and when to use input( )??? > > > According to my interpretation one should use input( ) when entering > > numbers etc and

Re: how to stop a function execution like...

2009-06-16 Thread Diez B. Roggisch
Gaudha wrote: > Is there any built-in function to stop execution of a function similar > to stop the program execution by sys.exit? > In the example below, I want to skip statement 2... if the 'if' > condition is satisfied. > Don't advice me to put statement 2 in 'else' block. That's not my > inte

Re: Good books in computer science?

2009-06-16 Thread Aaron Watters
On Jun 14, 4:47 pm, dads wrote: > I'm wanting to purchase some of the titles that have been raised in > this thread. When I look they are very expensive books which is > understandable. Do you think getting earlier editions that are cheaper > is a daft thing or should I fork out the extra £10-£30

Re: how to stop a function execution like...

2009-06-16 Thread Gaudha
On Jun 16, 4:45 pm, "Diez B. Roggisch" wrote: > Gaudha wrote: > > Is there any built-in function to stop execution of a function similar > > to stop the program execution by sys.exit? > > In the example below, I want to skip statement 2... if the 'if' > > condition is satisfied. > > Don't advice m

SIP v4.8.1 Released

2009-06-16 Thread Phil Thompson
SIP v4.8.1 has been released and can be downloaded from http://www.riverbankcomputing.com/software/sip/. 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. SIP is licensed under the Python License and runs on Wi

Tool for browsing python code

2009-06-16 Thread Lucas P Melo
Is there any tool for browsing python code? (I'm having a hard time trying to figure this out) Anything like cscope with vim would be great. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tool for browsing python code

2009-06-16 Thread Stef Mientki
Lucas P Melo wrote: Is there any tool for browsing python code? (I'm having a hard time trying to figure this out) Anything like cscope with vim would be great. maybe a good IDE like PyScripter would do ? cheers, Stef -- http://mail.python.org/mailman/listinfo/python-list

Re: Tool for browsing python code

2009-06-16 Thread Banibrata Dutta
On Tue, Jun 16, 2009 at 6:18 PM, Lucas P Melo wrote: > Is there any tool for browsing python code? (I'm having a hard time trying > to figure this out) > Anything like cscope with vim would be great. > -- > http://mail.python.org/mailman/listinfo/python-list > If you are not averse to GUI's, the

PyQt v4.5.1 Released (Python bindings for Qt)

2009-06-16 Thread Phil Thompson
PyQt v4.5.1 has been released and is available from http://www.riverbankcomputing.com/software/pyqt/. PyQt is a comprehensive set of bindings for the Qt application and UI framework from Nokia. It supports the same platforms as Qt (Windows, Linux and MacOS/X). The highlights of this release incl

Re: how to stop a function execution like...

2009-06-16 Thread pdpi
On Jun 16, 12:45 pm, "Diez B. Roggisch" wrote: > Gaudha wrote: > > Is there any built-in function to stop execution of a function similar > > to stop the program execution by sys.exit? > > In the example below, I want to skip statement 2... if the 'if' > > condition is satisfied. > > Don't advice

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

2009-06-16 Thread Dave Angel
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 applications should run in window

Re: how to stop a function execution like...

2009-06-16 Thread Dave Angel
Gaudha wrote: On Jun 16, 4:45 pm, "Diez B. Roggisch" wrote: Gaudha wrote: Is there any built-in function to stop execution of a function similar to stop the program execution by sys.exit? In the example below, I want to skip statement 2... if the 'if' condition is satisfied. Don't advi

Re: how to stop a function execution like...

2009-06-16 Thread mzdude
On Jun 16, 7:30 am, Gaudha wrote: > Is there any built-in function to stop execution of a function similar > to stop the program execution by sys.exit? > In the example below, I want to skip statement 2... if the 'if' > condition is satisfied. > Don't advice me to put statement 2 in 'else' block.

Re: Observer implementations

2009-06-16 Thread Mike C. Fletcher
Tobias Weber wrote: ... No time to reinvent the wheel I'd still need to know how to weakref a classmethod See PyDispatcher for code to do this. PyDispatcher, at least, is not abandoned, it would be more accurate to say "finished". I use it in OpenGLContext (extensively), but I haven't ha

Re: persistent composites

2009-06-16 Thread Aaron Brady
On Jun 15, 4:56 pm, Aaron Brady wrote: > On Jun 15, 11:10 am, Paul Rubin wrote: > > > Aaron Brady writes: > > > > A real-world application of persistent data structures can be found > > > > here: > > > >http://stevekrenzel.com/persistent-list > > > > Jaime, thanks

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

2009-06-16 Thread pdpi
On Jun 16, 2:17 pm, 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

simple GUI for my application?

2009-06-16 Thread Filipe Teixeira
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 would be like this: Som tabs here like: ( Load | Edit | Opti

Re: simple GUI for my application?

2009-06-16 Thread Tim Harig
On 2009-06-16, Filipe Teixeira wrote: > Hi, I'm really struggling to find the best GUI to make a simple > application. http://www.python.org/doc/faq/gui/ -- http://mail.python.org/mailman/listinfo/python-list

Funny xmlrpc / linux problem

2009-06-16 Thread Hans Müller
Hello, I found a timing problem while playing with the xmlrpx stuff. I created a very simple server, running on a network node on windows. The client runs on windows or linux. It runs a very simple test function on the server which just echos a passed string. The trip time is beeing measured. W

Getting a processes' name?

2009-06-16 Thread Daniel Merboth (RIT Student)
Hello, My college uses a program called AccessGrid for video conferencing, and it runs through pythonw.exe. It comes with a python script to kill all processes and exit the program. The problem is, the script kills everything related to pythonw.exe, including my open scripts. I'm looking for a

Re: Funny xmlrpc / linux problem

2009-06-16 Thread Hans Müller
Small addition: While tracing the network data I found the server to be the problem, the answer to a request is beeing delayed by about 180ms - no idea why. -- http://mail.python.org/mailman/listinfo/python-list

Re: simple GUI for my application?

2009-06-16 Thread Stef Mientki
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 would be like this: Som tabs here l

Python module problem under QNX

2009-06-16 Thread gnapalm
Hello, I'm trying to solve an issue with custom Python module at QNX 6.4.0 and Python 2.5.2. I have simple Python module (A.so) written in c++ which is linked against some other c++ library (B.so) both build by autotools. On Linux all works fine with PYTHONPATH pointed to A.so directory when dyna

Re: Funny xmlrpc / linux problem

2009-06-16 Thread Hans Müller
Another addendum... while running again the server code on a linux host, the times are as expected. started... Checking with 100240 time for 10 loops: 2.844000 Checking with 10240 time for 10 loops: 0.39 Checking with 1024 time for 10 loops: 0.078000 Checking with 512 time for 10 loops: 0.0

Python so module dependency problem under QNX

2009-06-16 Thread gnapalm
Hello, I'm trying to solve an issue with custom Python module at QNX 6.4.0 and Python 2.5.2. I have simple Python module (A.so) written in c++ which is linked against some other c++ library (B.so) both build by autotools. On Linux all works fine with PYTHONPATH pointed to A.so directory when dyna

Re: Funny xmlrpc / linux problem

2009-06-16 Thread Brian Quinlan
Hey Hans, Try reversing the list of numbers and see if anything changes. Cheers, Brian Hans Müller wrote: Hello, I found a timing problem while playing with the xmlrpx stuff. I created a very simple server, running on a network node on windows. The client runs on windows or linux. It runs a

Re: Tool for browsing python code

2009-06-16 Thread D'Arcy J.M. Cain
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 -- D'Arcy J.M. Cain | Democracy is three wolves http://www.druid.net/darcy/| and a sheep voting on +1 416 425 1212 (DoD#0082)(eNTP) |

Re: persistent composites

2009-06-16 Thread Mike Kazantsev
On Tue, 16 Jun 2009 06:57:13 -0700 (PDT) Aaron Brady wrote: > Making the charitable interpretation that this was the extent of c-l- > py's support and enthusiasm for my idea, I will now go into mourning. > Death occurred at oh-eight-hundred. Rest in peace, support & > enthusiasm. I've read this

sqlite3, OperationalError: no such column, shouldn't that ne a ProgrammingError?

2009-06-16 Thread Gabriel Rossetti
Hello everyone, I get an OperationalError with sqlite3 if I put the wrong column name, but shouldn't that be a ProgrammingError instead? I read PEP 249 and it says : "OperationalError Exception raised for errors that are related to the database's operat

doctests and decorators

2009-06-16 Thread Eric Snow
Apparently there is a known issue with doctests, in which tests in functions using externally defined decorators are ignored. The recommended fix is to update the order of checks in the _from_module method of DocTestFinder in the doctest module. The bug and fix are discussed at the following URLs

ODE, GUI, plotter in Python

2009-06-16 Thread Ala
Hello everyone. I am starting on implementing a simulator using python, and since it's the first time I code in python would appreciate a few pointers: The simulator will use a coupled ODE for the most part of the simulation, I plan to use scipy. (Anything considered faster/better than scipy for

Re: doctests and decorators

2009-06-16 Thread Eric Snow
On Jun 16, 9:59 am, Eric Snow wrote: > Apparently there is a known issue with doctests, in which tests in > functions using externally defined decorators are ignored.  The > recommended fix is to update the order of checks in the _from_module > method of DocTestFinder in the doctest module.  The b

Re: doctests and decorators

2009-06-16 Thread Christian Heimes
Eric Snow schrieb: > Apparently there is a known issue with doctests, in which tests in > functions using externally defined decorators are ignored. The > recommended fix is to update the order of checks in the _from_module > method of DocTestFinder in the doctest module. The bug and fix are > di

Re: ODE, GUI, plotter in Python

2009-06-16 Thread Eduardo Lenz
Em Ter 16 Jun 2009, às 09:00:02, Ala escreveu: > Hello everyone. > > I am starting on implementing a simulator using python, and since it's > the first time I code in python would appreciate a few pointers: > > The simulator will use a coupled ODE for the most part of the > simulation, I plan to us

Re: doctests and decorators

2009-06-16 Thread Eric Snow
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 decorators are ignored.  The > > recommended fix is to update the order of checks in the _from_module > > method of

Re: sqlite3, OperationalError: no such column, shouldn't that ne a ProgrammingError?

2009-06-16 Thread John Machin
On Jun 17, 1:41 am, Gabriel Rossetti wrote: > Hello everyone, > > I get an OperationalError with sqlite3 if I put the wrong column name, > but shouldn't that be a ProgrammingError instead? I read PEP 249 and it > says : > [snip] > and to me it sounds more like a programming error than an operation

Re: Input problem

2009-06-16 Thread Scott David Daniels
Prasoon wrote: What is the difference between z=int(raw_input()) and z=eval(raw_input())(I thought them to be the same in case of integers) Note that you can (and probably should) provide a prompt as an arg to input and raw_input. I mean when an integer is entered in that case are they s

Re: ODE, GUI, plotter in Python

2009-06-16 Thread Diez B. Roggisch
> you should take a look at > http://pyode.sourceforge.net/ I think he's talking about "ordinary differential equations". While these are part of physics-simulations (and the ODE-libraries' name might be a PUN), PyODE is not what the OP is after. Diez -- http://mail.python.org/mailman/listinfo/p

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

2009-06-16 Thread Nigel Rantor
Tim Harig wrote: > > This is a joke. Do not take it seriously. I do not actually suggest > anybody use this method to measure the size of their drive. I do not take any > responsibility for any damages incurred by using this method. I will laugh > at you if you do. Offer not valid in AK, HI,

strptime issue in multi-threaded application

2009-06-16 Thread Joe Holloway
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. I poked around the source code enough

Re: Funny xmlrpc / linux problem

2009-06-16 Thread Hans Müller
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 function to disable Nagle's algorythm in my special ca

Re: TypeError: int argument required

2009-06-16 Thread Lie Ryan
Lawrence D'Oliveiro wrote: > In message , Rhodri > James wrote: > >> On Mon, 15 Jun 2009 01:33:50 +0100, Lawrence D'Oliveiro >> wrote: >> >>> Perl allows just about any printable character as a quote. I tried >>> alternative quotes for many years, and decided making that choice was a >>> waste o

Re: sqlite3, OperationalError: no such column, shouldn't that ne a ProgrammingError?

2009-06-16 Thread Jon Clements
On Jun 16, 4:41 pm, Gabriel Rossetti wrote: > Hello everyone, > > I get an OperationalError with sqlite3 if I put the wrong column name, > but shouldn't that be a ProgrammingError instead? I read PEP 249 and it > says : > > "        OperationalError > >             Exception raised for errors that

strange behavior with os.system

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

Re: strptime issue in multi-threaded application

2009-06-16 Thread MRAB
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: ImportError: Failed to import _strptime because the import lockis [sic] held by another thread. I poked around

Re: doctests and decorators

2009-06-16 Thread Michele Simionato
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 decorators are ignored.  The > > > recommended fix is to update the

Re: strange behavior with os.system

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

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 %

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

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

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

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

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

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

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

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

  1   2   >