wxTimer problem

2005-05-13 Thread Austin
I wrote a GUI program on windows. (python & wxPython) One function is to refresh the data from the COM Object continously. In the beginning, I used the thread.start_new_thread(xxx,()) But no matter how i try, it will cause the win32com error. After that, i use the wx.Timer to do the refresh functi

Re: Python features

2005-05-13 Thread Fredrik Lundh
Andrew Dalke wrote: > Peter Dembinski wrote: >> If you want to redirect me to Google, don't bother. IMO ninety percent >> of writings found on WWW is just a garbage. > > Sturgeon's law: Ninety percent of everything is crap. does that apply to sturgeon's law itself? (fwiw, this is of course why

Re: How to find the classname of an object? (was Python Documentation)

2005-05-13 Thread Heiko Wundram
On Friday 13 May 2005 03:11, Bengt Richter wrote: > >>> type(obj).mro() > > [, , , > , ] > Wow! No need to write a depth-first tree-traversal algorithm... Somebody add this idiom to the cookbook. --- Heiko. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Documentation (should be better?)

2005-05-13 Thread Ron Adam
Steven Bethard wrote: > Ron Adam wrote: > >>What I would like to see is something like the following for each item: >> >>0. reference @ sequence code >>2. "Builtin" | "import " >>3. Type/class: Name/Syntax >>4. Description with examples >>6. Links to other references of this item in docs >>7. Lin

Re: Python features

2005-05-13 Thread Edvard Majakari
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > does that apply to sturgeon's law itself? > > (fwiw, this is of course why google displays 10 results on the > first page. according to the law, one of them is always exactly > what you want). + 1 QOTW :-) -- # Edvard Majakari Software

Re: bash like expansion

2005-05-13 Thread bill
Hmmm, the following session causes me some concern: >>> print a $(which sh) ${HOME/b/k} 'the dog' >>> print b /bin/sh /home/kill the dog >>> shlex.split(a) ['$(which', 'sh)', '${HOME/b/k}', 'the dog'] >>> shlex.split(b) ['/bin/sh', '/home/kill', 'the', 'dog'] I started with a, which contains the

python and printers

2005-05-13 Thread Alex Moreno
Hi everybody, i´m writing an applications under wxphython and i need to print some data in an external printer (usb, parallel, i suppose that it doesn´t mind. Excuse me for the (maybe) stupid question but, how can i do it? where can i found information about it? Thanks a lot, greetings -- http:/

mod_python seg faults with xml

2005-05-13 Thread Michael
Trying to process xml (xml-rpx) with a handler in mod_python crashes mod_python. Previous versions worked fine. Only change is I recompiled with newest versions of Apache, Python, and mod_python. No PHP or anything like that involved. Any idea why it seg faults when I try to import xmlrpclib an

RE: python and printers

2005-05-13 Thread Tim Golden
[Alex Moreno] | | i´m writing an applications under wxphython and i need to print some | data in an external printer (usb, parallel, i suppose that it doesn´t | mind. Excuse me for the (maybe) stupid question but, how can i do it? | where can i found information about it? Seems to be a popular su

Re: New Python regex Doc

2005-05-13 Thread Xah Lee
> I think you will continue to have > difficulty getting respect on this > matter as long as you show disrespect > to those who have come before you. > ... Dear Ron Adam and other good people, I respect people and I respect truth. And, the priority is truth first. The software community, is one

Re: New Python regex Doc

2005-05-13 Thread John Bokma
Xah Lee wrote: > I respect people and I was convinced he was going to show different: > The software community, is one fucked up ball, and in part, because just one person sees the light... > people respect not people nor truth. They respect their own asses, Then you must be the #1 fine exam

Parsing HTML with JavaScript

2005-05-13 Thread mtfulmer
I am trying to extract some information from a few web pages, and I was using the HTMLParser module. It worked fine until it got to the javascript, at which it gave a parse error. Is there a good way to work around this or should I just preparse the file to remove the javascript manually? This is m

Re: Python Documentation (should be better?)

2005-05-13 Thread bruno modulix
Ivan Van Laningham wrote: > Hi All-- > Yes. There are multiple ways I can correct myself, some, I'm sure, > involving chains and whips. Well, if you like it... > But you're all missing the point: > Christopher is right! Python docs are not as good as PHP docs. That's a POV, not a fact. > Wh

Re: Parsing HTML with JavaScript

2005-05-13 Thread Richard Brodie
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I am trying to extract some information from a few web pages, and I was > using the HTMLParser module. It worked fine until it got to the > javascript, at which it gave a parse error. It's fairly common for pages with Javascript to al

Re: Encryption with Python?

2005-05-13 Thread TZOTZIOY
On Sat, 7 May 2005 13:51:40 +0200, rumours say that "Anthra Norell" <[EMAIL PROTECTED]> might have written: >Here's the challenge. Prove this breakable > >'\x10\x88d\x1d\xba\xa1\xdcK\x05w\x02/s\xa7Q0\xeb8\xb6Gx\xef\xcb\x1e=\xf5\x7f >\x9bI\xcb(\x87>\xa5\x04\xc1soF\xfd\xc6\xc6\xd9|\x971\xdb\xcdT\tw#

Property,how to use it?

2005-05-13 Thread 皮大庆
Python-list,您好! What is the "property" mean in the python? Who can explain it for me? I don't know how to use it. 致 礼! 皮大庆 [EMAIL PROTECTED]   2005-05-13 -- http://mail.python.org/mailman/listinfo/python-list

property, how to use it?

2005-05-13 Thread 皮大庆
python,您好! What is the "property" mean in the python? Who can explain it for me? I don't know how to use it. 致 礼! 皮大庆 [EMAIL PROTECTED]   2005-05-13 -- http://mail.python.org/mailman/listinfo/python-list

OK

2005-05-13 Thread =??B?xqS088fs?=
-- http://mail.python.org/mailman/listinfo/python-list

Ok

2005-05-13 Thread =??B?xqS088fs?=
-- http://mail.python.org/mailman/listinfo/python-list

Re: pyvm -- faster python

2005-05-13 Thread Stelios Xanthakis
Hi, Kay Schluehr wrote: > > Why this? eval() consumes a string, produces a code object and executes > it. Wether the code-object is bytecode or a chunk of machine code makes > a difference in the runtime but does not alter the high level > behavioural description of eval(). In either way the comp

Re: pyvm -- faster python

2005-05-13 Thread Armin Steinhoff
Stelios Xanthakis wrote: > Kay Schluehr wrote: > >> >> Yes. What we are seeking for and this may be the meaning of Armins >> intentiously provocative statement about the speed of running HLLs is a >> successor of the C-language and not just another VM interpreter that is >> written in C and limits

Re: Encryption with Python?

2005-05-13 Thread hemanth
Anthra Norell wrote: > Thanks a lot for the feedback. This is certainly a great learning > experience. It's a fascinating topic too. Without wishing to annoy, I'd be > interested in knowing more. I insert questions below. > > You can google your questions and you will find them out answered in man

function with variable arguments

2005-05-13 Thread Xah Lee
i wanted to define a function where the number of argument matters. Example: def Range(n): return range(n+1) def Range(n,m): return range(n,m+1) def Range(n,m,step): return range(n,m+1,step) this obvious doesn't work. The default argument like Range(n=1,m,step=1) obviously isn't a s

Re: pyvm -- faster python

2005-05-13 Thread Stelios Xanthakis
Armin Steinhoff wrote: >> >> pyvm has that. A big part of it is written in "lightweight C++" [1]. > > > Realy ? I have downloaded the lwc distribution and checked it out. > It was a surprise that none of the examples are working. > I'm using SuSE 9.0 with gcc 3.3.1 ... > :( > Is there a work

Re: pyvm -- faster python

2005-05-13 Thread Stelios Xanthakis
Stelios Xanthakis wrote: > > Also, for the other part of the thread, I think that bytecode may > be in fact faster than machine code JIT. Forgot to add: It depends of course on how good is the bytecode. IMO Python's bytecode is pretty good for its purpose which is executing a dynamic language w

Re: Question about extending the interperter

2005-05-13 Thread harold fellermann
> The problem for me is that the pointer "p" in the last function points > to the arguments: > If a user caller foo("123") - p points to '123'. > What I need is to point it to the whole string received - 'foo > ("123")'. > > Is there a way I can do this? no. at least not a simple one. you can obta

Re: Declaring self in PyObject_CallMethod

2005-05-13 Thread harold fellermann
Hi, > Calling a python method from C++ has the following signature: > > PyObject * > PyObject_CallMethod(PyObject *self, char *method_name, > char *arg_format, ...); > > I'm having trouble figuring out how to declare self. > > Let's say my python file is called stuff.py and is

Reg php equivalent Mail_mime Module in Python

2005-05-13 Thread praba kar
Dear All, email.Message module base we can build message for mailing services which is like php Mail_mime module. In php Mail_mime module willautomatically build all the header fields like content-type, content-Transfer-encoding, Return-Path and so on for a mailing messages. I want to know th

Re: function with variable arguments

2005-05-13 Thread Wolfram Kriesing
using default args does actually solve it what about def Range(n, m=None, step=None) if step==None: if m==None: range(n) else: range(n,m) else: if m==None: raise Exception, "missing parameter m" else: range(n,m,step) can be optimized i am sure :-) --

Re: function with variable arguments

2005-05-13 Thread Steve
On 5/13/05, Wolfram Kriesing <[EMAIL PROTECTED]> wrote: > using default args does actually solve it > what about > def Range(n, m=None, step=None) > if step==None: > if m==None: > range(n) > else: <...snip...> or better still : def Range(*args): return range(*args) Regards

Re: working directory for debugging in pythonwin

2005-05-13 Thread Thomas Pfaff
Colin J. Williams schrieb: > Thomas Pfaff wrote: > >> Hello all, >> >> I started using the nice Pythonwin IDE together with Python 2.3 (I have >> come to prefer its editor to IDLE). >> My problem is, that when I want to run a script in the debugger, I can >> give the script name and arguments, but

Trusted python

2005-05-13 Thread rmm
Here's a first attempt at trusted python. I would be grateful if any python gurus could point out the, no doubt obvious, flaws. I've stopped fileobject working with patches to fileobject and frameobject. All child frames of the first 'trusted' frame are trusted (checked using inspect.getouterfram

Re: function with variable arguments

2005-05-13 Thread Dan Sommers
On 13 May 2005 02:52:34 -0700, "Xah Lee" <[EMAIL PROTECTED]> wrote: > i wanted to define a function where the number of argument matters. > Example: > def Range(n): > return range(n+1) > def Range(n,m): > return range(n,m+1) > def Range(n,m,step): > return range(n,m+1,step) > this

Re: working directory for debugging in pythonwin

2005-05-13 Thread Roger Upole
You could pass the directory in as an optional extra argument to the script. Alternately, you might accept either a bare file name or a full path. Roger -- This signature was intentionally left blank. (except it's not, wtf ??) "Thomas Pfaff" <[EMAIL PROTECTED]> wrote in messag

Re: Reg php equivalent Mail_mime Module in Python

2005-05-13 Thread elbertlev
Look for: http://sourceforge.net/projects/pymaillib/ -- http://mail.python.org/mailman/listinfo/python-list

Re: function with variable arguments

2005-05-13 Thread Peter Dembinski
On Fri, 13 May 2005 11:52:34 +0200, Xah Lee <[EMAIL PROTECTED]> wrote: > i wanted to define a function where the number of argument matters. > Example: > > def Range(n): > return range(n+1) > > def Range(n,m): > return range(n,m+1) > > def Range(n,m,step): > return range(n,m+1,step) >

Re: pyvm -- faster python

2005-05-13 Thread Armin Steinhoff
Stelios Xanthakis wrote: > Armin Steinhoff wrote: > >>> >>> pyvm has that. A big part of it is written in "lightweight C++" [1]. >> >> >> >> Realy ? I have downloaded the lwc distribution and checked it out. >> It was a surprise that none of the examples are working. >> I'm using SuSE 9.0 with g

Re: wxTimer problem

2005-05-13 Thread Jp Calderone
On Fri, 13 May 2005 14:57:26 +0800, Austin <[EMAIL PROTECTED]> wrote: >I wrote a GUI program on windows. (python & wxPython) >One function is to refresh the data from the COM Object continously. >In the beginning, I used the thread.start_new_thread(xxx,()) >But no matter how i try, it will cause th

Re: function with variable arguments

2005-05-13 Thread PoD
On Fri, 13 May 2005 02:52:34 -0700, Xah Lee wrote: > i wanted to define a function where the number of argument matters. > Example: > > def Range(n): > return range(n+1) > > def Range(n,m): > return range(n,m+1) > > def Range(n,m,step): > return range(n,m+1,step) > > this obvious d

Re: function with variable arguments

2005-05-13 Thread Wolfram Kriesing
> def Range(n,m=None,step=1): > if m is None: > n,m = 0,n+1 > else: > n,m = n,m+1 > return range(n,m,step) i like this one. coming from php (just a couple weeks ago) its always again interesting to see how i have to start thinking to program differently, it can be so much easier wi

Re: working directory for debugging in pythonwin

2005-05-13 Thread Thomas Pfaff
Roger Upole schrieb: > You could pass the directory in as an optional extra argument > to the script. Alternately, you might accept either a bare file name > or a full path. > > Roger > > Yes, that's true, and I suppose it's good programming style not to depend on a special working dir

Re: How "return" no return ?

2005-05-13 Thread Jeff Epler
At the interactive prompt, a result is printed when both these things are true: * The entered code is an expression, not any other kind of statement * The result of the expression is not 'None' If an expression occurs, information about it will be printed instead. So the interpreter won't

stop a thread safetely

2005-05-13 Thread Zunbeltz Izaola
Hi, I have a wxPython application that call makes a thread (with threading module). In some moment i've to stop the thread but i need to finish a funtion in the thread before it can stop. How can i achive this? Thanks in advance Zunbletz -- http://mail.python.org/mailman/listinfo/python-list

Re: stop a thread safetely

2005-05-13 Thread Peter Hansen
Zunbeltz Izaola wrote: > I have a wxPython application that call makes a thread (with threading > module). In some moment i've to stop the thread but i need to finish a > funtion in the thread before it can stop. How can i achive this? How did you intend to stop the thread in a manner which might

String formatting strangeness

2005-05-13 Thread dark . ryder
I must be doing something wrong, but for the life of me, I can't figure out what. Here's the code snippet which is giving me grief: print type(number), type(name), type(seconds // 60), type(seconds % 60) print "\t\t\t\n" % [number, name, seconds // 60, seconds % 60] (These are lines 49 and 50 of

doc tags?

2005-05-13 Thread Wolfram Kriesing
i was already searching and remember i had seen something like "its not needed". Anyway, are there any doc tags, like in Java/PHPDoc etc, where you can describe parameters (@param[eter]), return values (@ret[urn]), attributes (@var), references (@see), etc? I guess I have just not found the link

MySQL: 'latin-1' codec can't encode character

2005-05-13 Thread francescomoi
Hi. I'm trying to store a text within a MySQL field (v 3.23.58) by using MySQLdb (v 1.2.1c3). The text is: "telephone..." (note the last character) And I get this error message: --- File "/usr/lib/python2.3/site-packages/MySQLdb/connections.py", line 33, in defaulterrorhandler raise

Re: String formatting strangeness

2005-05-13 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > I must be doing something wrong, but for the life of me, I can't figure > out what. Here's the code snippet which is giving me grief: > > print type(number), type(name), type(seconds // 60), type(seconds % 60) > print "\t\t\t\n" > % [number, name, seconds // 60, seconds

Re: MySQL: 'latin-1' codec can't encode character

2005-05-13 Thread Fredrik Lundh
"[EMAIL PROTECTED]" > I'm trying to store a text within a MySQL field (v 3.23.58) by using > MySQLdb > (v 1.2.1c3). > > The text is: "telephone..." (note the last character) > > And I get this error message: > --- > File "/usr/lib/python2.3/site-packages/MySQLdb/connections.py", line > 33,

Re: doc tags?

2005-05-13 Thread Larry Bates
In python they are called decorators, but I've never had a need to use them myself, but then I'm a little old fashioned. Larry Bates Wolfram Kriesing wrote: > i was already searching and remember i had seen something like "its not > needed". > > Anyway, are there any doc tags, like in Java/PHPD

Re: String formatting strangeness

2005-05-13 Thread Larry Bates
The argument to string format expression needs to be a tuple not a list. Also, all the string escaping makes this very hard to read. You can mix single and double quotes to achieve: print '\t\t\t\n' % \ (number, name, seconds // 60, seconds % 60) which IMHO is much easier to read. Larry

Re: doc tags?

2005-05-13 Thread Wolfram Kraus
Wolfram Kriesing wrote: > i was already searching and remember i had seen something like "its not > needed". > > Anyway, are there any doc tags, like in Java/PHPDoc etc, where you can > describe parameters (@param[eter]), return values (@ret[urn]), > attributes (@var), references (@see), etc? >

Numarray question

2005-05-13 Thread Matt Feinstein
If I try >>> 2 < array([1,2,3]) I get: array([0, 0, 1], type=Bool) which is pretty slick, However if I set >>> q = 2 < array([1,2,3]) >>> q and q I get a runtime error: "An array doesn't make sense as a truth value." So.. why not? It seems to me that if I could vectorize logical expressions

Re: Launch file in Notepad

2005-05-13 Thread Grant Edwards
On 2005-05-13, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Thu, 12 May 2005 15:34:39 -, Grant Edwards <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> I think the use of forward slashes for command line switches >> was adopted by CP/M from DEC's OSes (e.g. RSX-11).

Re: doc tags?

2005-05-13 Thread Robert Kern
Larry Bates wrote: > In python they are called decorators, but I've never had a > need to use them myself, but then I'm a little old fashioned. Decorators only work on function and method definitions. I don't think that's what Wolfram is referring to. > Larry Bates > > Wolfram Kriesing wrote: >

Re: String formatting strangeness

2005-05-13 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > > Traceback (most recent call last): > File "X:\Music (FLAC)\Post-process new rips.py", line 50, in ? > print "\t\t\t length=\"%i:%i\"/>\n" % [number, name, seconds // 60, seconds % 60] > TypeError: int argument required > > Wait, what? The first line clearly

Re: doc tags?

2005-05-13 Thread Jp Calderone
On Fri, 13 May 2005 06:44:46 -0700, Robert Kern <[EMAIL PROTECTED]> wrote: >Larry Bates wrote: >> In python they are called decorators, but I've never had a >> need to use them myself, but then I'm a little old fashioned. > >Decorators only work on function and method definitions. I don't think >th

Re: MySQL: 'latin-1' codec can't encode character

2005-05-13 Thread francescomoi
Hi Fredrik. Thank you very much for your quick answer. Do you suggest to change it by using regexp or must I encode the whole texto into a suitable one? Regards. Fredrik Lundh wrote: > "[EMAIL PROTECTED]" > > > I'm trying to store a text within a MySQL field (v 3.23.58) by using > > MySQLdb > >

Re: New Python regex Doc

2005-05-13 Thread axel
In comp.lang.perl.misc John Bokma <[EMAIL PROTECTED]> wrote: > If you had really any point, you didn't need to swear in every third > sentence. Nor bother so many groups with your rants. > If you think it can be done better, pick up a part of documentation, and > rewrite it. To make it very har

Re: doc tags?

2005-05-13 Thread Fredrik Lundh
Wolfram Kriesing wrote: > i was already searching and remember i had seen something like "its not > needed". > > Anyway, are there any doc tags, like in Java/PHPDoc etc, where you can > describe parameters (@param[eter]), return values (@ret[urn]), > attributes (@var), references (@see), etc? do

Re: Importing modules

2005-05-13 Thread qwweeeit
Hi Fredrik, thank you very much for your articles (especially that on import-confusion). At last I grasped, also if not thorougly, the import mechanism. What cleared my doubts was your recursive import paragraph. In the Guido's "Python Reference Manual" he says: "Import statements are executed in t

Re: String formatting strangeness

2005-05-13 Thread dark . ryder
*hides face* Groan! This is what I get for trying to code first thing in the morning. Thanks, all, it works fine now... -- http://mail.python.org/mailman/listinfo/python-list

Re: Launch file in Notepad

2005-05-13 Thread Roger Upole
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thu, 12 May 2005 15:34:39 -, Grant Edwards <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >> I think the use of forward slashes for command line switches >> was adopted by CP/M from DE

[no subject]

2005-05-13 Thread python-list-bounces+archive=mail-archive . com
#! rnews 2528 Newsgroups: comp.lang.python Path: news.xs4all.nl!newsspool.news.xs4all.nl!transit.news.xs4all.nl!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!attws2!ip.att.net!NetNews1!xyzzy!nntp From: Harry George <[EMAIL PROTECTED]> Subject: Re: String formatting strangeness X-Nnt

Re: How to find the classname of an object? (was Python Documentation)

2005-05-13 Thread Christopher J. Bottaro
Bengt Richter wrote: > >>> type(obj) > > >>> type(obj).mro() > [, , , > [, ] > >>> tuple(x.__name__ for x in type(obj).mro()) > ('A', 'B1', 'B2', 'C', 'object') Wow awesome, thats exactly what I was looking for. I hate to bring up the documentation thing again...but.where the hell is

Re: Numarray question

2005-05-13 Thread Robert Kern
Matt Feinstein wrote: > If I try > > 2 < array([1,2,3]) > > > I get: > > array([0, 0, 1], type=Bool) > > which is pretty slick, However if I set > > q = 2 < array([1,2,3]) q and q > > > I get a runtime error: "An array doesn't make sense as a truth value." > > So.. why not?

Re: Python Documentation (should be better?)

2005-05-13 Thread Rocco Moretti
bruno modulix wrote: > > I fail to see why would it would be better to have to open a browser, go > to python.org, go to the doc, find the right link etc instead of just > typing dir(xxx) and/or help(xxx). Well, for those with Windows machines, the documentation is a simple Start->All Programs

Dive into Python java equivalent

2005-05-13 Thread Luis P. Mendes
Hi, do you know if is there any 'Dive into Python' equivalent for the java language? DiP is the best I've seen and I would need to learn some basics of Java and also ways to interact between the two languages. (I'm already aware of Jpype and Jython) Luis -- http://mail.python.org/mailman/lis

Re: stop a thread safetely

2005-05-13 Thread Zunbeltz Izaola
On Fri, 13 May 2005 09:10:13 -0400, Peter Hansen wrote: > > How did you intend to stop the thread in a manner which might be unsafe? > (Hint, unless you're doing something unusual, you can't.) > I have a threaded object (Mythread). It checks if want_thread variable is True to return. The proble

Re: How to find the classname of an object? (was Python Documentation)

2005-05-13 Thread Christopher J. Bottaro
Christopher J. Bottaro wrote: > Bengt Richter wrote: > >> >>> type(obj) >> >> >>> type(obj).mro() >> [, , , >> [, ] >> >>> tuple(x.__name__ for x in type(obj).mro()) >> ('A', 'B1', 'B2', 'C', 'object') > > Wow awesome, thats exactly what I was looking for. Wait a sec...why doesn't the f

newbie - insert variable in pathname

2005-05-13 Thread [EMAIL PROTECTED]
Hello all, I have a username variable luser: luser = win32api.GetUserName I need to insert it into the following to replace the hardcoded "johndoe" in the pathname of GIS.GIS.Parcels: GIS_GIS_Parcels = "Database [EMAIL PROTECTED]" Thanks in advance, plsullivan -- http://mail.python.org/mailm

RE: newbie - insert variable in pathname

2005-05-13 Thread Tim Golden
[EMAIL PROTECTED] | | Hello all, | I have a username variable luser: | | luser = win32api.GetUserName | | I need to insert it into the following to replace the hardcoded | "johndoe" in the pathname of GIS.GIS.Parcels: | | GIS_GIS_Parcels = "Database | [EMAIL PROTECTED] | .GIS.Parcels" Just in

Re: newbie - insert variable in pathname

2005-05-13 Thread Miradan
import win32api GIS_GIS_Parcels = "Database [EMAIL PROTECTED]" % (win32api.GetUserName()) HTH -- http://mail.python.org/mailman/listinfo/python-list

Re: pyvm -- faster python

2005-05-13 Thread Stelios Xanthakis
Armin Steinhoff wrote: >>> Is there a working version of lwc ??? >>> >> >> pyvm is written in lwc-2.0 which is not yet released because >> nobody's using it. > > > As you mentioned it ... lwc-2.0 is used for pyvm. So it is used :) > > Do you have an idea when lwc-2.0 will be releast ? > > Ever

Re: MySQL: 'latin-1' codec can't encode character

2005-05-13 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > > > File "/usr/lib/python2.3/site-packages/MySQLdb/connections.py", > line > > > 33, in defaulterrorhandler > > > raise errorclass, errorvalue > > > UnicodeEncodeError: 'latin-1' codec can't encode character > u'\u2026' in > > > position 288: ordinal not in range(256

Safe eval, or how to get list from string

2005-05-13 Thread bwooster47
I've to use ConfigParser. It returns values that are exactly in the config file, so get string variables like: int1 with quotes and characers: "42" this is easy to convert to int: realint = int(int1) I've read the tutorial, and the FAQ, and not sure if I missed it, but other than calling eval (wh

Re: MySQL: 'latin-1' codec can't encode character

2005-05-13 Thread Walter Dörwald
Fredrik Lundh wrote: > [...] > if you want more control of the replacement, you can skip the translate > step and use your own error handler, e.g. > > charmap = ... see above ... > > def fixunicode(info): > s = info.object[info.start:info.end] > try: > return

Re: property, how to use it?

2005-05-13 Thread Steve
Hi, Read this: http://www.python.org/2.2.3/descrintro.html#property If you still don't understand or are confused about it's usage, ask here. Hint: Suppose you need to create an Age class with a 'years' attribute and ensure that, (assuming I create an object a = Age()) 1) when one tries to acces

Re: Question about extending the interperter

2005-05-13 Thread Fredrik Lundh
"Eli" <[EMAIL PROTECTED]> wrote: > Thanks for the answer; I should better explain my problem. that's always a good idea ;-) > So a solution would be creating 'function 1' which preprocess the input > and calls the original function 1, than do so for any other function. > This works, but there ar

Re: mod_python seg faults with xml

2005-05-13 Thread Fredrik Lundh
"Michael" wrote: > Trying to process xml (xml-rpx) with a handler in mod_python crashes > mod_python. Previous versions worked fine. Only change is I recompiled > with newest versions of Apache, Python, and mod_python. No PHP or > anything like that involved. Any idea why it seg faults when I try

Re: New Python regex Doc

2005-05-13 Thread John Bokma
wrote: > In comp.lang.perl.misc John Bokma <[EMAIL PROTECTED]> wrote: [ @55, |@#~~|!! ] > Oh please let him use an ass... Ok, he is allowed to use ass in examples, e.g. (Perl) s/ass/domesticated donkey/g; (Maybe to explain \b ? ) -- John Small Perl scripts: http://johnbok

Re: stop a thread safetely

2005-05-13 Thread Jp Calderone
On Fri, 13 May 2005 16:47:34 +0200, Zunbeltz Izaola <[EMAIL PROTECTED]> wrote: >On Fri, 13 May 2005 09:10:13 -0400, Peter Hansen wrote: > >> >> How did you intend to stop the thread in a manner which might be unsafe? >> (Hint, unless you're doing something unusual, you can't.) >> > >I have a thread

Dynamic doctests?

2005-05-13 Thread mitchell
I'm trying to execute doc tests without writing to the filesystem (i.e. in the Python interpreter). I have something like: """ Docstring: >>> n 6 """ # Code: n=6 import doctest doctest.testmod() The tests all pass when saving this text to a python script (as it should), but wh

Re: How to find the classname of an object? (was Python Documentation)

2005-05-13 Thread Matt
Christopher J. Bottaro wrote: > Christopher J. Bottaro wrote: > > > Bengt Richter wrote: > > > >> >>> type(obj) > >> > >> >>> type(obj).mro() > >> [, , , > >> [, ] > >> >>> tuple(x.__name__ for x in type(obj).mro()) > >> ('A', 'B1', 'B2', 'C', 'object') > > > > Wow awesome, thats exactly w

create words of various lengths

2005-05-13 Thread [EMAIL PROTECTED]
"X-No-Archive: yes" what I am looking for is 1. To create a list of different words of various lengths(1-15) using A-Z,a-z,0-9 and punctuations.Basically anything that could be found on a text document. 2. The words formed need not be meaningful .FOr example 'ajf' or 'fcjgdtfhbs' or even 'gfdew!

Re: create words of various lengths

2005-05-13 Thread Robert Kern
[EMAIL PROTECTED] wrote: > "X-No-Archive: yes" > > what I am looking for is > > 1. To create a list of different words of various lengths(1-15) using > A-Z,a-z,0-9 and punctuations.Basically anything that could be found on > a text document. > > 2. The words formed need not be meaningful .FOr ex

creating words of diff lengths

2005-05-13 Thread [EMAIL PROTECTED]
X-No-Archive: yes what I am looking for is 1. To create a list of different words of various lengths(1-15) using A-Z,a-z,0-9 and punctuations.Basically anything that could be found on a text document. 2. The words formed need not be meaningful .FOr example 'ajf' or 'fcjgdtfhbs' or even 'gfdew!' o

Re: Safe eval, or how to get list from string

2005-05-13 Thread Jason Mobarak
[EMAIL PROTECTED] wrote: > if there is list1 = "[ 'filea', 'fileb', ]", I can get at list by > doing: > reallist = eval(list1) > is there an easier/simpler method of doing the same thing as realstring > and reallist lines above? http://twistedmatrix.com/users/moshez/unrepr.py Example: >>> from u

Re: create words of various lengths

2005-05-13 Thread [EMAIL PROTECTED]
Hi Robert, At first I thought it would be an interesting thing to have a little swift module to create a database of all words in the dictionary.But then I thought y just the words in the dictionary? y not all possible words like 'and' and 'adn'. Just was inspired with the little idea of if its an

Re: create words of various lengths

2005-05-13 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > what I am looking for is > > 1. To create a list of different words of various lengths(1-15) using > A-Z,a-z,0-9 and punctuations.Basically anything that could be found on > a text document. > > 2. The words formed need not be meaningful .FOr example 'ajf' or > 'fcjgdtfh

Re: tkFileDialog question

2005-05-13 Thread jaime . suarez
James, thank you very much for your answer. Jaime -- http://mail.python.org/mailman/listinfo/python-list

Simple TCP "relay" or "proxy"

2005-05-13 Thread Tomas Christiansen
Im trying to make a simple TCP socket "relay" or "proxy", but my skills in Python are not high (yet). The only thing it should do, is to open the connection on behalf of the client, and when the client closes the connection, it should do so too. It's going to "relay" PCL and/or PostScript print

Re: Dynamic doctests?

2005-05-13 Thread Sébastien Boisgérault
> > code='"""\n>>> n\n6\n"""\nn=6\nimport doctest\ndoctest.testmod()' > exec(code) > Remove 'doctest.tesmod()' and the import from your 'code' string. ]]] exec(code) ]]] import doctest ]]] doctest.testmod() should do the trick. Cheers, SB -- http://mail.python.org/mailman/listinfo/pytho

Re: stop a thread safetely

2005-05-13 Thread Peter Hansen
Zunbeltz Izaola wrote: > On Fri, 13 May 2005 09:10:13 -0400, Peter Hansen wrote: >>How did you intend to stop the thread in a manner which might be unsafe? >>(Hint, unless you're doing something unusual, you can't.) > > I have a threaded object (Mythread). It checks if want_thread > variable is Tr

Re: create words of various lengths

2005-05-13 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Hi Robert, > At first I thought it would be an interesting thing to have a little > swift module to create a database of all words in the dictionary. Okay, take one more step back. Why is it interesting to have such a dictionary? How do you intend to use it? Having ans

Re: OSx 10.4 lacks pythonIDE?

2005-05-13 Thread B
On 13/5/05 03:35, in article [EMAIL PROTECTED], "Robert Kern" <[EMAIL PROTECTED]> wrote: > baza wrote: >> Where is the IDE in 'Tiger' for the mac? Don't tell me I have to use >> text edit all the time?? > > PythonIDE never came with the OS. You have to install it yourself. > > http://homepage

Re: create words of various lengths

2005-05-13 Thread [EMAIL PROTECTED]
no specific number of words. and I get a syntax error on line: > words["".join(choice(alphabet) for i in range(randint(1,15)))] = None -- http://mail.python.org/mailman/listinfo/python-list

Re: OSx 10.4 lacks pythonIDE?

2005-05-13 Thread B
On 13/5/05 03:35, in article [EMAIL PROTECTED], "Robert Kern" <[EMAIL PROTECTED]> wrote: > baza wrote: >> Where is the IDE in 'Tiger' for the mac? Don't tell me I have to use >> text edit all the time?? > > PythonIDE never came with the OS. You have to install it yourself. > > http://homepage

Re: How to find the classname of an object? (was Python Documentation)

2005-05-13 Thread Steven Bethard
Christopher J. Bottaro wrote: > Bengt Richter wrote: > > >> >>> type(obj) >> >> >>> type(obj).mro() >> [, , , >> [, ] >> >>> tuple(x.__name__ for x in type(obj).mro()) >> ('A', 'B1', 'B2', 'C', 'object') > > Wow awesome, thats exactly what I was looking for. I hate to bring up the > documentat

Re: Safe eval, or how to get list from string

2005-05-13 Thread Michael Spencer
[EMAIL PROTECTED] wrote: > I've to use ConfigParser. > > It returns values that are exactly in the config file, so get string > variables like: > int1 with quotes and characers: "42" > this is easy to convert to int: > realint = int(int1) > > I've read the tutorial, and the FAQ, and not sure if I

  1   2   >