Re: Faster GUI text control

2005-05-13 Thread Fredrik Lundh
"none "@bag.python.org" wrote: > several people mention that is was a known issue with Tkinter. > I'm trying to decide what is the best replacement for the control. I > was originally planning on redoing the GUI with wxpython, but I've seen > people indicate I would have the same problem. I als

Re: Solipsis: Python-powered Metaverse

2005-05-13 Thread Paul McNett
Terry Reedy wrote: > While the above is not directly on-topic for c.l.p, it does suggest > possible design considerations for users of the socket module and packets > built on top ;-). > -- including Solipsis, which is such. I contributed to the thread going kind of off-topic, so I'll just follo

Re: Solipsis: Python-powered Metaverse

2005-05-13 Thread Terry Reedy
>>On Wed, 11 May 2005 22:48:31 -0400, rumours say that "Terry Reedy" >><[EMAIL PROTECTED]> might have written: >>>play an online action game, which sends a constant stream of update >>>info. >>>Then, curious what would happen, I logged on, from a different computer >>>but >>>through the same rou

Re: 80 bit precision ?

2005-05-13 Thread Terry Reedy
"km" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all, > > does python currently support 80 bit precision Floating Point Unit ? Last I read, in CPython, the float type encapsulates a C double. So, does any C compiler implements doubles as 80 bit floats? Or, if it has 64 b

Re: Python Polymorphism

2005-05-13 Thread Alexander Schmolck
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > Carlos Moreira wrote: > >> Supose that I want to create two methos (inside a >> class) with exactly same name, but number of >> parameters different: > > that's known as multimethods, or multiple dispatch. No -- multiple dispatch is something entirel

Re: Faster GUI text control

2005-05-13 Thread Paul McNett
Jeremy Bowers wrote: > The problem is that if you're really looking for performance, it may > differ based on the characteristics of the text and the quality of the > target computer, the platform (which you don't mention; GTK may scream in > Linux and make you scream in Windows...), etc., and ther

Re: Faster GUI text control

2005-05-13 Thread Jeremy Bowers
On Fri, 13 May 2005 15:44:24 -0500, none wrote: > I'm trying to decide what is the best replacement for the control. I > was originally planning on redoing the GUI with wxpython, but I've seen > people indicate I would have the same problem. Honestly, if this is important to you, the best thin

pygame on win32, image.fromstring()

2005-05-13 Thread tlviewer
hello, The script below is a prototype for loading playing card images from the bitmap resource in cards.dll (WinXP) I like the idea of not keeping copies of the images as files. I'm able to extract the card images as files, then load them in pygame as a surface, but I keep getting errors when d

Python in the news, somewhat

2005-05-13 Thread Adonis
ZDNet has released this article that talks about open source scriptingg languages and mentions Python/Jython/IronPython, just wanted to share the info. http://news.zdnet.com/2100-9593_22-5705448.html?tag=st.num Adonis -- http://mail.python.org/mailman/listinfo/python-list

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

2005-05-13 Thread Matt
Bengt Richter wrote: > On 13 May 2005 14:59:13 -0700, "Matt" <[EMAIL PROTECTED]> wrote: > > > >Bengt Richter wrote: > [...] > >> I'm afraid inheriting explicitly from object will make the exception > >unraisable. > >> Exceptions are still based on "classic" classes for some reason that > >> I don'

Re: Solipsis: Python-powered Metaverse

2005-05-13 Thread Jp Calderone
7On Sat, 14 May 2005 02:28:57 +0300, Christos TZOTZIOY Georgiou <[EMAIL PROTECTED]> wrote: >On Wed, 11 May 2005 22:48:31 -0400, rumours say that "Terry Reedy" ><[EMAIL PROTECTED]> might have written: > >>> and what if both computers >>> wanted to participate on the port 6000 fun? > >>Recently, I

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

2005-05-13 Thread Bengt Richter
On 13 May 2005 14:59:13 -0700, "Matt" <[EMAIL PROTECTED]> wrote: > >Bengt Richter wrote: [...] >> I'm afraid inheriting explicitly from object will make the exception >unraisable. >> Exceptions are still based on "classic" classes for some reason that >> I don't know enough about to explain. >> >>

Re: Python Documentation (should be better?)

2005-05-13 Thread OKB (not okblacke)
Greg Ewing wrote: > Curiously I had the same problem just the other day, > except with list instead of string. I think the problem > is that the sections on the actual built-in types > (list, str, dict, etc.) are one level too far down > to appear in the table of contents of the Library > Referenc

Re: Solipsis: Python-powered Metaverse

2005-05-13 Thread TZOTZIOY
On Wed, 11 May 2005 22:48:31 -0400, rumours say that "Terry Reedy" <[EMAIL PROTECTED]> might have written: >> and what if both computers >> wanted to participate on the port 6000 fun? >Recently, I had one family member use my purchased account to logon to and >play an online action game, which

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

2005-05-13 Thread Matt
Bengt Richter wrote: > On 13 May 2005 09:37:07 -0700, "Matt" <[EMAIL PROTECTED]> wrote: > > > > >Christopher J. Bottaro wrote: > >> Christopher J. Bottaro wrote: > >> > >> > Bengt Richter wrote: > >> > > >> >> >>> type(obj) > >> >> > >> >> >>> type(obj).mro() > >> >> [, , >'__main__.B2'>, >

Problems passing arrays into COM objects using win32com

2005-05-13 Thread mb3242
Hello, I'm trying to use win32com to call a method in a COM object. I'm having a problem with Python choosing the wrong type when wrapping up lists into VARIANTs. The function I'm trying to call in C++ looks like this: HRESULT write([in] VARIANT * len, [in] VARIANT * saData, [out] VARIANT * result

Re: Python Documentation (should be better?)

2005-05-13 Thread Aahz
In article <[EMAIL PROTECTED]>, Greg Ewing <[EMAIL PROTECTED]> wrote: > >Curiously I had the same problem just the other day, except with list >instead of string. I think the problem is that the sections on the >actual built-in types (list, str, dict, etc.) are one level too far >down to appear in

Re: Replacing open builtin

2005-05-13 Thread Steven Bethard
Jp Calderone wrote: > Probably not. For example: > >>>> (1).__class__.__bases__[0].__subclasses__()[-1]('/dev/null') > However: py> eval("(1).__class__.__bases__[0]" ... ".__subclasses__()[16]('/dev/null')", ... dict(__builtins__={})) Traceback (most recent call last): Fil

Re: Python Documentation (should be better?)

2005-05-13 Thread John J. Lee
"Christopher J. Bottaro" <[EMAIL PROTECTED]> writes: [...] By the way, did you try the .chm? John -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Documentation (should be better?)

2005-05-13 Thread John J. Lee
"Christopher J. Bottaro" <[EMAIL PROTECTED]> writes: [...] > At my work, we are developing a product from scratch. It is completely > modular and the modules communicate via SOAP. Because of that, we can > implement individual modules in any language of our choosing (so long as > they have good S

Re: doc tags?

2005-05-13 Thread Wolfram Kriesing
i am really looking for documenting my code, actually i expect the ide to interpret them too and show me the doc etc., since i am missing that a lot. esp. attributes' doc i was missing which made me write this post if there is not standard tool (or even a PEP) is there any pythonic syntax? (which m

Re: Python Documentation (should be better?)

2005-05-13 Thread John J. Lee
Greg Ewing <[EMAIL PROTECTED]> writes: > Ivan Van Laningham wrote: > > Hi All-- > > The Python docs are not ideal. I can never remember, for instance, > > where to find string methods (not methods in the string module, but > > methods with '') > > Curiously I had the same problem just the other

Re: Python Documentation (should be better?)

2005-05-13 Thread John J. Lee
Ivan Van Laningham <[EMAIL PROTECTED]> writes: > Hi All-- > The Python docs are not ideal. I can never remember, for instance, > where to find string methods (not methods in the string module, but > methods with ''), but I can remember a tortured path to get me there [...] The answer to 80% of "

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

2005-05-13 Thread Bengt Richter
On 13 May 2005 09:37:07 -0700, "Matt" <[EMAIL PROTECTED]> wrote: > >Christopher J. Bottaro wrote: >> Christopher J. Bottaro wrote: >> >> > Bengt Richter wrote: >> > >> >> >>> type(obj) >> >> >> >> >>> type(obj).mro() >> >> [, , '__main__.B2'>, >> >> [, ] >> >> >>> tuple(x.__name__ for x in

Faster GUI text control

2005-05-13 Thread none
Hi, I wrote a program for work that processed and formatted some collected text data in a Tkinter based GUI display. I've found that as my data files get longer (a few thousand lines), there seems to be a real lag when it comes to clearing or updating the Text control, enough so that the pr

Re: 80 bit precision ?

2005-05-13 Thread Paul Rubin
"Sébastien Boisgérault" <[EMAIL PROTECTED]> writes: > http://sourceforge.net/projects/gmpy/ > > To be honest, I have never used it ;). A review would be > appreciated. I've used it for large integer calculations and it's great, around 5x faster than Python longs if I remember right. I did hit a

MySQL application example

2005-05-13 Thread qwweeeit
Hi all, I have in mind to learn to use MySQL, not only to use it myself but also to persuade a friend of mine to use Python and MySQL and abandon Informix and its old fashioned language (and also SCO UNIX to migrate to Linux). Apart reading tutorials, I have found that the best thing to learn a com

Re: Parsing HTML with JavaScript

2005-05-13 Thread John J. Lee
[EMAIL PROTECTED] writes: > 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

Re: 80 bit precision ?

2005-05-13 Thread Sébastien Boisgérault
Not in the core language or the std library. However, if you are insterested in high-precision computations, gmpy may be useful: http://sourceforge.net/projects/gmpy/ To be honest, I have never used it ;). A review would be appreciated. Regards, SB -- http://mail.python.org/mailman/listinfo

Re: creating words of diff lengths

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

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

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

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

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 c

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 w

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 [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 -- http://mail.python.org/mailman/listinfo

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 somethin

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: 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: 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 range(randint

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: 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: OSx 10.4 lacks pythonIDE?

2005-05-13 Thread Matt Feinstein
On Fri, 13 May 2005 03:21:40 +0100, baza <[EMAIL PROTECTED]> wrote: >Where is the IDE in 'Tiger' for the mac? Don't tell me I have to use >text edit all the time?? You can use Spotlight to find the file idle.pyw and use that as an IDE... Matt Feinstein -- There is no virtue in believing someth

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  1   2   >