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

2005-05-13 Thread Heiko Wundram
On Friday 13 May 2005 01:21, Christopher J. Bottaro wrote: For those of you following the Python Documentation thread, this is a good example of how the PHP manual is better. I found how to do this in a few seconds in PHP. I searched the Python docs for class name, classname, introspection

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

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 google

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() [class '__main__.A', class '__main__.B1', class '__main__.B2', class '__main__.C', type 'object'] Wow! No need to write a depth-first tree-traversal algorithm... Somebody add this idiom to the cookbook. --- Heiko. --

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

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

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

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

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

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

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 also

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

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

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 all

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 many

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

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

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

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

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

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

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

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 obvious

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 message

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) this obvious

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 the

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 doesn't work.

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 with

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

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\tsection number=\%i\ title=\%s\ length=\%i:%i\/\n % [number, name, seconds // 60,

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\tsection number=\%i\ title=\%s\ length=\%i:%i\/\n

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

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 (a la

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). CP/M

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

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 that's what

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

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 DEC's OSes

[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

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

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

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? It seems to me that if I could

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

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

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 problem

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) class '__main__.A' type(obj).mro() [class '__main__.A', class '__main__.B1', class '__main__.B2', [class '__main__.C', type 'object'] tuple(x.__name__ for x in type(obj).mro()) ('A', 'B1', 'B2', 'C', 'object') Wow

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 ? Everyone who are

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) Thank you very

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

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

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 are

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 to

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:

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

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

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) class '__main__.A' type(obj).mro() [class '__main__.A', class '__main__.B1', class '__main__.B2', [class '__main__.C', type 'object'] tuple(x.__name__ for x in type(obj).mro())

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 example

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

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 unrepr

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

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 'fcjgdtfhbs' or

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 printjobs

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/python-list

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

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

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.

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.

Re: OSx 10.4 lacks pythonIDE?

2005-05-13 Thread Robert Kern
B wrote: 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.

Re: create words of various lengths

2005-05-13 Thread [EMAIL PROTECTED]
this works while len(words) 1: wd = for i in [.join(choice(alphabet)) for i in range(randint(1,15))]: wd += i words[wd] = None anyway Thanks for that this is exactly what i need.. -- http://mail.python.org/mailman/listinfo/python-list

Re: create words of various lengths

2005-05-13 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: no specific number of words. anything between one and a gazillion, you mean? having some idea of the upper bound helps when chosing what algorithm/database/computer to use... and I get a syntax error on line: words[.join(choice(alphabet) for i in

Re: stop a thread safetely

2005-05-13 Thread Ivan Voras
Peter Hansen wrote: call to recv() does not guarantee that the full 608 bytes of data is Does read() have that guarantee? -- http://mail.python.org/mailman/listinfo/python-list

Re: property, how to use it?

2005-05-13 Thread Larry Bates
class Age: def __init__(self, years=None): if years is None: self.years=0 else: self.years=years def __setattr__(self, key, value): if key == years: if value 0: print ERROR-Years cannot be less than zero, setting to zero

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

2005-05-13 Thread bwooster47
http://twistedmatrix.com/users/moshez/unrepr.py http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/364469 Thanks, this helps - but I was looking at using no additional modules, or using something that came bundled in with python 2.3 I just discovered mx.Tools.NewBuiltins It has something

Re: create words of various lengths

2005-05-13 Thread [EMAIL PROTECTED]
:) the reason for me not upgrading my python is I am waiting for version of Numeric to be released for python 2.4 .The stable version of Numeric is only release for windows and not Linux I guess the last time i checked. which i use a lot . Anyway thanks --

Re: creating words of diff lengths

2005-05-13 Thread TZOTZIOY
Is there an echo in here? -- TZOTZIOY, I speak England very best. Be strict when sending and tolerant when receiving. (from RFC1958) I really should keep that in mind when talking with people, actually... -- http://mail.python.org/mailman/listinfo/python-list

Re: create words of various lengths

2005-05-13 Thread Robert Kern
[EMAIL PROTECTED] wrote: :) the reason for me not upgrading my python is I am waiting for version of Numeric to be released for python 2.4 .The stable version of Numeric is only release for windows and not Linux I guess the last time i checked. which i use a lot . Install from source. It

Re: stop a thread safetely

2005-05-13 Thread Peter Hansen
Ivan Voras wrote: Peter Hansen wrote: call to recv() does not guarantee that the full 608 bytes of data is Does read() have that guarantee? Assuming you mean read() on the file object that would be returned by calling makefile() on the socket, then the docs imply that this is the case,

Re: pyvm -- faster python

2005-05-13 Thread Terry Reedy
Stelios Xanthakis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Also, for the other part of the thread, I think that bytecode may be in fact faster than machine code JIT. Here is a theory: Suppose that for each algorithm there is the ideal implementation which executes at the

80 bit precision ?

2005-05-13 Thread km
Hi all, does python currently support 80 bit precision Floating Point Unit ? regards, KM -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Documentation (should be better?)

2005-05-13 Thread Bruno Desthuilliers
Ivan Van Laningham a écrit : (snip) BTW, my tortured method is quicker than Bruno's, because to use his method I'd have to start the interactive interpreter. start the interactive interpreter ??? What do you mean, start the interactive interpreter ??? It's *always* started as a part of your

Re: Python Documentation (should be better?)

2005-05-13 Thread Skip Montanaro
bruno I fail to see why would it would be better to have to open a bruno browser, go to python.org, go to the doc, find the right link etc bruno instead of just typing dir(xxx) and/or help(xxx). Actually, you frequently don't even have to enter the Python interpreter. Executing pydoc

Re: Simple TCP relay or proxy

2005-05-13 Thread Dave Benjamin
Tomas Christiansen wrote: Im trying to make a simple TCP socket relay or proxy, but my skills in Python are not high (yet). http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/114642 -- http://mail.python.org/mailman/listinfo/python-list

Re: creating words of diff lengths

2005-05-13 Thread [EMAIL PROTECTED]
yes! sorry about that -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >