ANN: cElementTree 1.0.4 (december 13, 2005)

2005-12-16 Thread Fredrik Lundh
effbot.org proudly presents release 1.0.4 of the cElementTree library, a fast and very efficient implementation of the ElementTree API, for Python 2.1 and later. On typical documents, it's 15-20 times faster than the Python version of ElementTree, and uses 2-5 times less memory. cElementTree

Re: Adding methods to instances

2005-12-16 Thread Antoon Pardon
Op 2005-12-15, Ed Leafe schreef [EMAIL PROTECTED]: On Dec 15, 2005, at 11:51 AM, Lawrence Oluyede wrote: So? Am I nuts? Or is this possible? Yes it is, use exec() to turn your string in valid Python code and bind the dynamic function as a method of class Test xx = def dynamic(self):

Re: special operator =+

2005-12-16 Thread Steve Holden
Peter Hansen wrote: [EMAIL PROTECTED] wrote: kenny NguyenDoes anyone know the operator =+? It isn't an operator, it's equivalent to = (assignment) only. Though actually it would try to call the __pos__ method on the object prior to binding it to the name on the left side. (Much as -

Re: python24.dll and encodings ?

2005-12-16 Thread Thomas Heller
Bugs [EMAIL PROTECTED] writes: Thomas Heller wrote: [snip] A PEP discussing the rationales would *really* be great. My whole impetus for this thread was to minimize the size of Python executables created with py2exe. Right now they tend to be rather large, even for very small

Re: problem with os.spawnle(os.P_NOWAIT,'C:\info.exe')

2005-12-16 Thread Fredrik Lundh
[EMAIL PROTECTED] write; i tried running a exe file info.exe from the spawnle cmd, its running fine from the interactive mode, but when i try to run the same info.exe file from a python file, its giving me the following error: ##

Re: IsString

2005-12-16 Thread Steve Holden
Steven D'Aprano wrote: On Thu, 15 Dec 2005 08:22:37 +, Steve Holden wrote: Hear, hear. However you describe it Python is what it is, and this interminable discussion about its similarities with and differences from various concepts (most lately call by name/call by value) doesn't much

RE: Tuples

2005-12-16 Thread Michael . Coll-Barth
Well, it works for me and x is a list, not a tuple. Or am I reading too much into your subject line? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] n.org]On Behalf Of Tuvas Sent: Thursday, December 15, 2005 12:20 PM To: python-list@python.org Subject: Tuples

Re: The difference between import package.module and from package import module(about pymol)

2005-12-16 Thread Ben Finney
Xiao Jianfeng [EMAIL PROTECTED] writes: In pymol I can use from chempy import Atom but import chempy.Atom doesn't work. It says,ImportError: No module named Atom. What is going wrong ? I would trust the error message first, and check your assumption. Is 'chempy' actually a package, containing

Re: ActivePython and Amara

2005-12-16 Thread James
Where I go to work, a quote stands etched in a very large font into the concrete prominently to remind us to be humble. The greatest obstacle to discovery is not ignorance - it is the illusion of knowledge. (Daniel J. Boorstin) You just have to trust us on this. We are not jumping to conclusions

Re: How can I load python script into Html ??

2005-12-16 Thread Tim Roberts
Steve M [EMAIL PROTECTED] wrote: Man, I don't even know where to start. There is no way this will work if you don't have a web browser that can interpret Python. I don't know of one, and I don't think anybody wants one because using a browser that would execute arbitrary Python code provided by

Re: getsockopt

2005-12-16 Thread Steve Holden
Fabian Deutsch wrote: Hello, my name is fabian and i'm a student from northern germany. right now i try to create som kind of decapsulation of esp-udp packets using python. therefor i need to use the socket.getsockopt (SOL_IP, IP_OPTIONS, 20) method. But al i get is some empty value.

Re: Enumeration idioms: Values from different enumerations

2005-12-16 Thread Antoon Pardon
Op 2005-12-16, Ben Finney schreef [EMAIL PROTECTED]: [quoting private email with permission] Antoon Pardon wrote: I just downloaded your enum module for python [from the Cheeseshop] and played a bit with it. IMO some of the behaviour makes it less usefull. Feedback is appreciated. I'm

Re: Enumeration idioms: Values from different enumerations

2005-12-16 Thread Ben Finney
Mike Meyer [EMAIL PROTECTED] writes: Peter Hansen [EMAIL PROTECTED] writes: That is, [perhaps] trying to compare enumerations that should not be compared *is* an error (raising an exception) *because* the whole point of enumerations is to avoid errors in such cases. Except it might not be an

Re: split string saving screened spaces

2005-12-16 Thread Giovanni Bajo
Sergey wrote: Which module to use to do such thing: -a -b -c '1 2 3' - [-a, -b, -c, '1 2 3'] import shlex shlex.split(-a -b -c '1 2 3') ['-a', '-b', '-c', '1 2 3'] -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: split string saving screened spaces

2005-12-16 Thread bonono
Sergey wrote: Which module to use to do such thing: -a -b -c '1 2 3' - [-a, -b, -c, '1 2 3'] (i have string, need to pass it to getopt) seems like CSV except that the seperator is space. You may check to see if the CSV module can take space as delimiter. --

Python and curses

2005-12-16 Thread linuxfreak
Was wanting to write a text based application in python seems curses module is the way to go... anyone knows of any good tutorials apart from the one written by esr -- http://mail.python.org/mailman/listinfo/python-list

Python IDE

2005-12-16 Thread linuxfreak
Which is a better python IDE SPE or WingIDE in terms of features -- http://mail.python.org/mailman/listinfo/python-list

Re: getsockopt

2005-12-16 Thread Fabian Deutsch
--- Ursprüngliche Nachricht --- Von: Steve Holden [EMAIL PROTECTED] An: python-list@python.org Betreff: Re: getsockopt Datum: Fri, 16 Dec 2005 08:29:08 + Fabian Deutsch wrote: Hello, my name is fabian and i'm a student from northern germany. right now i try to create som kind

Re: newbie to python

2005-12-16 Thread Johhny
Hello, Here is the script then the problem. cat testing.py import crypt import random, string def getsalt(chars = string.letters + string.digits): return random.choice(chars) + random.choice(chars) username = raw_input('password : ') print crypt.crypt(username,getsalt()) python

Re: newbie to python

2005-12-16 Thread Peter Otten
Johhny wrote: Here is the script then the problem. cat testing.py import crypt import random, string def getsalt(chars = string.letters + string.digits): return random.choice(chars) + random.choice(chars) username = raw_input('password : ') print crypt.crypt(username,getsalt())

Re: getsockopt

2005-12-16 Thread Steve Holden
Fabian Deutsch wrote: --- Ursprüngliche Nachricht --- Von: Steve Holden [EMAIL PROTECTED] An: python-list@python.org Betreff: Re: getsockopt Datum: Fri, 16 Dec 2005 08:29:08 + Fabian Deutsch wrote: Hello, my name is fabian and i'm a student from northern germany. right now i try to create

Re: 0 in [True,False] returns True

2005-12-16 Thread Antoon Pardon
Op 2005-12-15, Grant Edwards schreef [EMAIL PROTECTED]: On 2005-12-15, Antoon Pardon [EMAIL PROTECTED] wrote: Well, in my case, a given name (or return value) is always bound to a floating point object. I don't test the type of the object and treat it in two different ways depending on what

Re: CherryPy wiki not working

2005-12-16 Thread bill
Yes, it looks like some type of virus has affected my computer. CherryPy was fine from home using my IMac. But at work from both Firefox and IE I get this problem and now it has affected another site. The URLs at CherryPy look like this : http://www.cherrypy.org/store/0_1_540744_1_1_index.html

Re: getsockopt

2005-12-16 Thread Fabian Deutsch
Stave Holde wrote: Fabian Deutsch wrote: --- Ursprüngliche Nachricht --- Von: Steve Holden [EMAIL PROTECTED] An: python-list@python.org Betreff: Re: getsockopt Datum: Fri, 16 Dec 2005 08:29:08 + Fabian Deutsch wrote: Hello, my name is fabian and i'm a student from northern

Re: Enumeration idioms: Values from different enumerations

2005-12-16 Thread Antoon Pardon
Op 2005-12-16, Ben Finney schreef [EMAIL PROTECTED]: Mike Meyer [EMAIL PROTECTED] writes: Peter Hansen [EMAIL PROTECTED] writes: That is, [perhaps] trying to compare enumerations that should not be compared *is* an error (raising an exception) *because* the whole point of enumerations is to

Re: RoR like (was : SPE 0.8.1.b Python IDE...)

2005-12-16 Thread bruno at modulix
Adrian Holovaty wrote: bruno at modulix wrote: RoR is not an IDE, it's a web framework. The closest things in Python are TurboGears (good Ajax/js support via Mochikit), Subway (never tested), and Django (no Ajax support AFAIK). Note that no Ajax support is misleading. Of course you can use

thread and alarm

2005-12-16 Thread Sergey
How to send alarm to a thread? I can set alarm in main thread, but how then send exception to another thread to wake it if it executes too long? -- http://mail.python.org/mailman/listinfo/python-list

Re: Enumeration idioms: Values from different enumerations

2005-12-16 Thread Ben Sizer
Ben Finney wrote: The problem with is the same value as an explanation for '==' is that it doesn't help in cases such as:: ShirtSize = Enum('small', 'medium', 'large') AppleSize = Enum('small', 'large') What should be the result of this comparison:: ShirtSize.small ==

text manipulation

2005-12-16 Thread Johhny
Hello, I am trying to write a script in python (to replace a perl script with limited functionality). Now I have some issues. Currently I am using the perl to load the file then regex parse certain lines to remove characters (uncomment lines and change variables). I would like to take that into

Re: Enumeration idioms: Values from different enumerations

2005-12-16 Thread Antoon Pardon
Op 2005-12-16, Ben Sizer schreef [EMAIL PROTECTED]: Ben Finney wrote: The problem with is the same value as an explanation for '==' is that it doesn't help in cases such as:: ShirtSize = Enum('small', 'medium', 'large') AppleSize = Enum('small', 'large') What should be the result

Re: text manipulation

2005-12-16 Thread Isaac T Alston
Johhny wrote: Any advice would be great. Have you had a look at Python's re module? If you've not, I suggest you do so - it contains all of Python's regex tools which you'll need. Regards, -- Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Clearing the Tkinter Window

2005-12-16 Thread Martin Franklin
James Stroud wrote: Dustan wrote: I'm a newbie here, especially with Tkinter. I'm writing a program that has 3 phases, if you will, in which I would have to clear the window and insert new widgets. Is this possible, and if so, how? I'm writing my application class based on Frame, if that

Re: Robotics and parallel ports

2005-12-16 Thread Isaac T Alston
Thanks for everyone's tips and hints. I WILL MAKE THIS WORK! I think I'll take your advice and use the serial port instead of the parallel port - I won't have that much data to send (in comparison with, for example, industrial level applications). As for on-board chips though, does this require

Re: tkinter: drop-down widget

2005-12-16 Thread Alex Hunsley
James Stroud wrote: Alex Hunsley wrote: Can anyone recommend some code for creating drop-down menus in tkinter? To be absolutely clear, here's an example of a drop-down: http://www.google.co.uk/preferences?hl=en (see the language selection widget) I've found the odd bit of code here and

Re: Python and curses

2005-12-16 Thread Eddie Corns
linuxfreak [EMAIL PROTECTED] writes: Was wanting to write a text based application in python seems curses module is the way to go... anyone knows of any good tutorials apart from the one written by esr There is at least 1 higher level library atop curses. http://excess.org/urwid/ I've only

Re: Python and curses

2005-12-16 Thread Isaac T Alston
linuxfreak wrote: Was wanting to write a text based application in python seems curses module is the way to go... anyone knows of any good tutorials apart from the one written by esr Not off the top of my head, no. However, you will find that the functions needed will be very similar to

Re: text manipulation

2005-12-16 Thread Martin Franklin
Johhny wrote: Hello, I am trying to write a script in python (to replace a perl script with limited functionality). Now I have some issues. Currently I am using the perl to load the file then regex parse certain lines to remove characters (uncomment lines and change variables). I would like

Re: tkinter: drop-down widget

2005-12-16 Thread Martin Franklin
James Stroud wrote: Alex Hunsley wrote: Can anyone recommend some code for creating drop-down menus in tkinter? To be absolutely clear, here's an example of a drop-down: http://www.google.co.uk/preferences?hl=en (see the language selection widget) I've found the odd bit of code here and

Re: text manipulation

2005-12-16 Thread Martin Franklin
Martin Franklin wrote: Johhny wrote: Hello, I am trying to write a script in python (to replace a perl script with limited functionality). Now I have some issues. Currently I am using the perl to load the file then regex parse certain lines to remove characters (uncomment lines and change

Re: text manipulation

2005-12-16 Thread Juho Schultz
Johhny wrote: Hello, I am trying to write a script in python (to replace a perl script with limited functionality). Now I have some issues. Currently I am using the perl to load the file then regex parse certain lines to remove characters (uncomment lines and change variables). I would like

Re: SVG rendering with Python

2005-12-16 Thread [EMAIL PROTECTED]
Matplotlib also has an SVG renderer. Just save the file with an SVG extension or choose SVG as your default backend in the rc file http://matplotlib.sf.net/matplotlibrc. -- http://mail.python.org/mailman/listinfo/python-list

Re: thread and alarm

2005-12-16 Thread Antoon Pardon
Op 2005-12-16, Sergey schreef [EMAIL PROTECTED]: How to send alarm to a thread? I can set alarm in main thread, but how then send exception to another thread to wake it if it executes too long? The short answer is you can't and you should preferably look for an other solution. If for example

Re: Problem with Lexical Scope

2005-12-16 Thread Bengt Richter
On 15 Dec 2005 18:45:17 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Well, the the comparison operations are just a special case really.I don't know about the obfuscation contest. I've attempted to make an extensible library. Sorry about obfuscation contest, I just balked at the reduce code,

Re: Re: getsockopt

2005-12-16 Thread Fabian Deutsch
Steve Holden wrote: Fabian Deutsch wrote: --- Ursprüngliche Nachricht --- Von: Steve Holden [EMAIL PROTECTED] An: python-list@python.org Betreff: Re: getsockopt Datum: Fri, 16 Dec 2005 08:29:08 + Fabian Deutsch wrote: Hello, my name is fabian and i'm a student from northern

Re: RoR like (was : SPE 0.8.1.b Python IDE...)

2005-12-16 Thread Paul Boddie
bruno at modulix wrote: Adrian, what you describe here is *exactly* what I call no Ajax support: you have to handle the whole thing manually, the framework doesn't provide anything by itself. I'm not going to argue whether Django supports Ajax or not, but I will agree that for the desired

Re: RoR like (was : SPE 0.8.1.b Python IDE...)

2005-12-16 Thread Paul Boddie
bruno at modulix wrote: Adrian, what you describe here is *exactly* what I call no Ajax support: you have to handle the whole thing manually, the framework doesn't provide anything by itself. I'm not going to argue whether Django supports Ajax or not, but I will agree that for the desired

Re: RoR like (was : SPE 0.8.1.b Python IDE...)

2005-12-16 Thread Paul Boddie
bruno at modulix wrote: Adrian, what you describe here is *exactly* what I call no Ajax support: you have to handle the whole thing manually, the framework doesn't provide anything by itself. I'm not going to argue whether Django supports Ajax or not, but I will agree that for the desired

Re: Enumeration idioms: Values from different enumerations

2005-12-16 Thread Ben Finney
Antoon Pardon [EMAIL PROTECTED] writes: Ben Finney wrote: The 'enum' package in Cheeseshop [defines enumerations as] sequences (of unique arbitrary values), that can be iterated and tested for membership. Sure but we do have this: from enum import Enum day = Enum('mon', 'tue', 'wed',

Re: newbie to python

2005-12-16 Thread Johhny
Thankyou, I appreciate your help. I did not realise that python would behave that way. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and curses

2005-12-16 Thread Thomas Dickey
linuxfreak [EMAIL PROTECTED] wrote: Was wanting to write a text based application in python seems curses module is the way to go... anyone knows of any good tutorials apart from the one written by esr It wasn't written by esr. He only has his name on it, did none of the work. -- Thomas

Re: Enumeration idioms: Values from different enumerations

2005-12-16 Thread Paul Rubin
Ben Finney [EMAIL PROTECTED] writes: This gives meaning to the equal value comparisons, but ensures that other comparisons are errors. Comments so far? What does copy.copy of an enumeration value do? What happens if you have a list with some enumeration values inside, and you make a

distutils: build scripts as native executables?

2005-12-16 Thread Giovanni Bajo
Hello, am I wrong or isn't there a way in distutils to build (compile/link) a native executable and install it among the scripts? It looks like that distutils.CCompiler features a link_executable() method, and build_ext.py has most of the logic needed to track dependencies, include paths and

Re: Which Python web framework is most like Ruby on Rails?

2005-12-16 Thread chuck
I did a fairly thorough investigation of web frameworks that let us write Python (we didn't care what the framework was written in; merely that it interfaced with Python) for one of the systems I've built this year. I wouldn't call the evaluation of web frameworks a problem - we met our

Re: why does php have a standard SQL module and Python doesn't !?

2005-12-16 Thread Kent Johnson
[EMAIL PROTECTED] wrote: This was my point though: I found the *description* - but no wordon WHICH implementation to get WHERE ? Hmm. - Browse to http://www.python.org - click Documentation - click Database API - click Database Modules (Database modules that implement the DB-API

Re: Enumeration idioms: Values from different enumerations

2005-12-16 Thread Antoon Pardon
Antoon Pardon wrote: Ben Finney wrote: Would it be better if every Enum instance had its own unique subclass of EnumValue, that was used to instantiate values for that enumeration? If you decide on keeping the current behaviour when comparing values of different enumerations, I would

Re: Robotics and parallel ports

2005-12-16 Thread malv
Hi, Thank you for the info. The dlp usb solution looks like a terrific gadget, especially since parallel ports have almost disppeared, at least on portables. In fact, would in linux not any py software capable of dealing with a usb connection (almost) suffice? Any further comments would be much

Re: split string saving screened spaces

2005-12-16 Thread Paul McGuire
Pyparsing has built-in quoted string support. from pyparsing import OneOrMore,Word,alphanums,quotedString item = Word('-',alphanums) | quotedString | Word(alphanums) items = OneOrMore(item) print items.parseString( -a -b -c '1 2 3' -d 5 -e zork2000 ) gives: ['-a', '-b', '-c', '1 2 3', '-d',

Re: text manipulation

2005-12-16 Thread BartlebyScrivener
John, Martin is right. Always try to solve without regex first. However, for those situations where you definitely need regex, use this tutorial: http://www.amk.ca/python/howto/regex/ It's well-written, succinct, and Python-specific. rpd -- http://mail.python.org/mailman/listinfo/python-list

Re: Python IDE

2005-12-16 Thread Mustafa Yalcin Acikyildiz
emacs, best ide of all-time ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: Can Python write foreign characters to the console?

2005-12-16 Thread Grant Edwards
On 2005-12-16, Bock [EMAIL PROTECTED] wrote: I was just told about Python. My searching and reading over the net I was able to learn that Python can handle foreign characters via Unicodes. Can or does Python write unicode to the screen? Sure. For example, in c++ cout Hello World.

Re: Clearing the Tkinter Window

2005-12-16 Thread Dustan
I don't want to destroy the root, I just want to remove the widgets (the exact opposite of what Martin was saying). I started working on James' idea, but it'll be a while before I have it fully implemented to test. -- http://mail.python.org/mailman/listinfo/python-list

Re: 0 in [True,False] returns True

2005-12-16 Thread Grant Edwards
On 2005-12-16, Antoon Pardon [EMAIL PROTECTED] wrote: Your examples are still both very different from the NaN example. A NaN is a floating point operation that supports all the same operations as all other floating point operations. In your example an integer object of -2 does not support

Problem with exec

2005-12-16 Thread Antoon Pardon
I have the following little piece of code: class Cfg:pass #config = Cfg() def assign(): setattr(config, 'Start' , [13, 26, 29, 34]) def foo(): config = Cfg() dct = {'config':config, 'assign':assign} exec assign() in dct print config.Start foo() When I execute this I get the

Re: Enumeration idioms: Values from different enumerations

2005-12-16 Thread Ben Sizer
Antoon Pardon wrote: Op 2005-12-16, Ben Sizer schreef [EMAIL PROTECTED]: Is it possible to make it have the following sort of behaviour? : ShirtSize.small == AppleSize.small True ShirtSize.small is AppleSize.small False It works for comparing a boolean (True) vs. an integer (1),

Re: Clearing the Tkinter Window

2005-12-16 Thread Fredrik Lundh
Dustan [EMAIL PROTECTED] wrote: I don't want to destroy the root, I just want to remove the widgets (the exact opposite of what Martin was saying). I started working on James' idea, but it'll be a while before I have it fully implemented to test. each widget has a children attribute, which

Re: Problem with os.path

2005-12-16 Thread Scott David Daniels
Daya Kiran Sunkara wrote: ... path = 'E:\mktrisk\service\marketdata\da' You should use: path = r'E:\mktrisk\service\marketdata\da' if you want to use backslashes regularly (for regexps and paths). You do know you could also use: path = 'E:/mktrisk/service/marketdata/da' even on windows.

Re: Python IDE

2005-12-16 Thread Fuzzyman
SPE is very good - I'd use it, and if you need any features Stani is very quick to add them. All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with exec

2005-12-16 Thread Larry Bates
Antoon Pardon wrote: I have the following little piece of code: class Cfg:pass #config = Cfg() def assign(): setattr(config, 'Start' , [13, 26, 29, 34]) def foo(): config = Cfg() dct = {'config':config, 'assign':assign} exec assign() in dct print config.Start foo()

Re: Problem with exec

2005-12-16 Thread Peter Otten
Antoon Pardon wrote: I have the following little piece of code: class Cfg:pass #config = Cfg() def assign(): setattr(config, 'Start' , [13, 26, 29, 34]) def foo(): config = Cfg() dct = {'config':config, 'assign':assign} exec assign() in dct print config.Start foo()

Parser or regex ?

2005-12-16 Thread Fuzzyman
Hello all, I'm writing a module that takes user input as strings and (effectively) translates them to function calls with arguments and keyword arguments.to pass a list I use a sort of 'list constructor' - so the syntax looks a bit like : checkname(arg1, arg 2, 'arg 3', keywarg=value,

Re: Problem with exec

2005-12-16 Thread Fredrik Lundh
Antoon Pardon wrote: I have the following little piece of code: class Cfg:pass #config = Cfg() def assign(): setattr(config, 'Start' , [13, 26, 29, 34]) def foo(): config = Cfg() dct = {'config':config, 'assign':assign} exec assign() in dct print config.Start foo() When

Re: Python IDE

2005-12-16 Thread Scott David Daniels
Martin Miller wrote: ... If someone with actual experience using Komodo with Python is listening, I'd be very interested in hearing what you think of it I got a copy of Komodo some time ago, and I love it. I wanted a fairly reliable debugging platform for a fairly large server I was

Re: Problem with exec

2005-12-16 Thread Antoon Pardon
Op 2005-12-16, Peter Otten schreef [EMAIL PROTECTED]: Antoon Pardon wrote: I have the following little piece of code: class Cfg:pass #config = Cfg() def assign(): setattr(config, 'Start' , [13, 26, 29, 34]) def foo(): config = Cfg() dct = {'config':config, 'assign':assign}

Re: Which Python web framework is most like Ruby on Rails?

2005-12-16 Thread A.M. Kuchling
On Thu, 15 Dec 2005 20:15:17 -0800, Alex Martelli [EMAIL PROTECTED] wrote: If you claim there's a web project that's unfeasible to do in Ruby, you'd better come up with a strong example. If you're making no such claim, which would be counter to the claims of the Ruby community, then

Re: Problem with exec

2005-12-16 Thread Antoon Pardon
Op 2005-12-16, Larry Bates schreef [EMAIL PROTECTED]: Antoon Pardon wrote: I have the following little piece of code: class Cfg:pass #config = Cfg() def assign(): setattr(config, 'Start' , [13, 26, 29, 34]) def foo(): config = Cfg() dct = {'config':config, 'assign':assign}

Re: Haskell Typeclasses

2005-12-16 Thread Alex Martelli
Kay Schluehr [EMAIL PROTECTED] wrote: ... work. Or maybe it works and I just have no clue how completely opaque call graphs as they appear in functions like this def f(x): h = g(x) h() can be tracked sufficiently in register-time in order to capture dependencies. It is not

Re: RoR like (was : SPE 0.8.1.b Python IDE...)

2005-12-16 Thread Adrian Holovaty
bruno at modulix wrote: Adrian, what you describe here is *exactly* what I call no Ajax support: you have to handle the whole thing manually, the framework doesn't provide anything by itself. Would you say the CGI module offers support for templating, data persistance and Ajax as well ?-) Hey

How to use pydoc?

2005-12-16 Thread newsposter
import pydoc import sys sys.version '2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)]' pydoc sys SyntaxError: invalid syntax The documentation for pydoc says: Run pydoc name to show documentation on something. What am I missing? Thanks! Chris --

Re: Enumeration idioms: Values from different enumerations

2005-12-16 Thread skip
Without downloading and installing your code, can you tell me what the result of these comparisons would be? col = Enum('red', 'green', 'blue') day = Enum('mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun') col.blue == blue day.tue == 23 If they return False I would expect

Re: Python IDE (was: PythonWin troubleshooting)

2005-12-16 Thread Tim Arnold
chuck [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Apparently not too many people use or are interested in PythonWin. I'm giving up on it. It used to work pretty good. I'm lucky that I have found PyScripter (http://www.mmm-experts.com/) a python IDE for the windows platform

Re: Problem with exec

2005-12-16 Thread Peter Otten
Antoon Pardon wrote: And from the documentation from exec I get the impression you can use it so that a function will have temporarily a different reference to global namespace. That impression confuses two things: (1) A function object carries a global namespace with it. That namespace is

Re: Parser or regex ?

2005-12-16 Thread Tim Arnold
Fuzzyman [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello all, I'm writing a module that takes user input as strings and (effectively) translates them to function calls with arguments and keyword arguments.to pass a list I use a sort of 'list constructor' - so the syntax

Re: to write set of values to a file from python

2005-12-16 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: hi thanks every body for the help. Now how can check whtr the row am reading is the last row or not?? for example: ... reader = csv.reader(file) for row in reader: print row HERE HOW CAN I CHECK WHTR THIS ROW IS THE LAST ONE IN THE FILE so that if

Re: Problem with exec

2005-12-16 Thread Peter Otten
Antoon Pardon wrote: Op 2005-12-16, Larry Bates schreef [EMAIL PROTECTED]: Antoon Pardon wrote: I have the following little piece of code: class Cfg:pass #config = Cfg() def assign(): setattr(config, 'Start' , [13, 26, 29, 34]) def foo(): config = Cfg() dct =

Re: Enumeration idioms: Values from different enumerations

2005-12-16 Thread skip
ShirtSize = Enum('small', 'medium', 'large') AppleSize = Enum('small', 'large') Ben What should be the result of this comparison:: ShirtSize.small == AppleSize.small False. They are values from different objects. Just make __eq__ map to is. I think you'll be fine.

Re: access to preallocated block of memory?

2005-12-16 Thread Scott David Daniels
You might want to take a look at the Blocks and Views code I did, take a look at it and see if you can either use it directly or use it with any changes you feel like making. http://members.dsl-only.net/~daniels/Block.html -- -Scott David Daniels [EMAIL PROTECTED] --

Re: Which Python web framework is most like Ruby on Rails?

2005-12-16 Thread Ben Sizer
Mike Meyer wrote: Ben Sizer [EMAIL PROTECTED] writes: Flexibility is good, but personally I think the problem is that instead of useful variety, we have redundant overlap. How many different templating systems, sql--object mappings, and URL dispatch schemes do we need? And what exactly is

Re: How to use pydoc?

2005-12-16 Thread Peter Otten
[EMAIL PROTECTED] wrote: import pydoc import sys sys.version '2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)]' pydoc sys SyntaxError: invalid syntax The documentation for pydoc says: Run pydoc name to show documentation on something. What am I missing? In the

Re: Parser or regex ?

2005-12-16 Thread Fuzzyman
Tim Arnold wrote: Fuzzyman [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello all, I'm writing a module that takes user input as strings and (effectively) translates them to function calls with arguments and keyword arguments.to pass a list I use a sort of 'list

Invoking Unix commands from a Python app

2005-12-16 Thread Rob Cowie
Hi all, An idea popped into my head recently for an app that would track how much time a user spends in a particular piece of software (or at least, for how long an application is open). I'm assuming there is a way to do this via the command line and a unix app, although I haven't yet

Re: problem with os.spawnle(os.P_NOWAIT,'C:\info.exe')

2005-12-16 Thread muttu2244
Ya Thanks Fredrik, i had overwritten the os in my code indeed, now its working fine. thanks a lot for that regards -- http://mail.python.org/mailman/listinfo/python-list

SMP, GIL and Threads

2005-12-16 Thread catsup
Hi, I have an app written under version Python 2.3.5. The problem I'm having is that it hangs on one of its threads. The thread that hangs does updates to a standard dictionary shared with another thread that only reads this dictionary. This app works beautifully on a single processor boxes in

Re: Enumeration idioms: Values from different enumerations

2005-12-16 Thread Mike Meyer
Ben Finney [EMAIL PROTECTED] writes: Mike Meyer [EMAIL PROTECTED] writes: Peter Hansen [EMAIL PROTECTED] writes: That is, [perhaps] trying to compare enumerations that should not be compared *is* an error (raising an exception) *because* the whole point of enumerations is to avoid errors in

Re: Invoking Unix commands from a Python app

2005-12-16 Thread Sybren Stuvel
Rob Cowie enlightened us with: Ok, I know see that os.spawnl() will suffice. However, how do I retrieve the output of the command. Apparently, os.spawnl() didn't suffice. Check out the popen2 module and Popen* classes. Sybren -- The problem with the world is stupidity. Not saying there should

Re: Adding methods to instances

2005-12-16 Thread Dody Suria Wijaya
To avoid that: - subclass Test first class SubclassTest(T): pass - assign the method to SubclassTest's attribute, SubclassTest.dynamic = dynamic - then assign the new class to magic variable __class__ : t.__class__ = SubclassTest t.dynamic() Antoon Pardon wrote: But this will make the

Re: Visual Python : finished ?

2005-12-16 Thread Bill
Do Re Mi chel La Si Do wrote: Hi! See : http://www.activeperl.com/Products/Visual_Perl/?mp=1 @+ MCI Another closed source success story. -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding methods to instances

2005-12-16 Thread Ben Hutchings
Antoon Pardon [EMAIL PROTECTED] wrote: Op 2005-12-15, Ed Leafe schreef [EMAIL PROTECTED]: On Dec 15, 2005, at 11:51 AM, Lawrence Oluyede wrote: So? Am I nuts? Or is this possible? Yes it is, use exec() to turn your string in valid Python code and bind the dynamic function as a method

Re: Invoking Unix commands from a Python app

2005-12-16 Thread Rob Cowie
Excellent... just the thing I was looking for. Thanks. Does anyone know of a unix app that could be used to monitor the duration of processes etc.? Would 'top' do the trick? Rob C -- http://mail.python.org/mailman/listinfo/python-list

Re: Parser or regex ?

2005-12-16 Thread Michael Spencer
Fuzzyman wrote: Hello all, I'm writing a module that takes user input as strings and (effectively) translates them to function calls with arguments and keyword arguments.to pass a list I use a sort of 'list constructor' - so the syntax looks a bit like : checkname(arg1, arg 2, 'arg

Re: SVG rendering with Python

2005-12-16 Thread Chris Lambacher
On Fri, Dec 16, 2005 at 01:58:40PM +1100, richard wrote: Andreas Lobinger wrote: richard wrote: Dennis Benzinger wrote: Does anybody know of a SVG rendering library for Python? Google python svg ... to find what? The answer to the OP's question. The OP's question is ambiguous.

  1   2   3   >