Re: Python to tell what is the IP of my PC

2006-11-08 Thread 空心菜
>>> import re,urllib2 >>> re.search('\d+\.\d+\.\d+\.\d+',urllib2.urlopen("http://www.hereismyip.com";).read()).group() 'xx.xx.xxx.xxx′ On 11月9日, 上午11时06分, Hieu Hoang <[EMAIL PROTECTED]> wrote: > Hi list, > I think a script to extract the IP from some websites like > whatismyip.com could do the jo

Re: which is a good imaging lib in python??

2006-11-08 Thread John Machin
srj wrote: > hi > can any1 tell me which is a good imaging lib in python and where i can > get it (2 dwnld) from?? > > regds The straight answer to your question is "Yes". If you were to do a google search for "python imaging library", you would then be in a position to tell yourself. -- http:

Re: opening excel

2006-11-08 Thread John Machin
timmy wrote: > Hello, > > has anybody got any experience opening and manilpulating excel > spreedsheets via python? it seems pythoncom allows this to happen but > i'm a total newb to it. (i usually work in the unix world) > all i need to do, is open the xls files and read values from it. If you r

which is a good imaging lib in python??

2006-11-08 Thread srj
hi can any1 tell me which is a good imaging lib in python and where i can get it (2 dwnld) from?? regds -- http://mail.python.org/mailman/listinfo/python-list

gathering data about running processes - looking for a library

2006-11-08 Thread Arkadiusz Miskiewicz
Hi, I'm looking for a library (or utility) written in python that would allow me to easily access all possible information about currently running processes (under Linux). Something like /bin/ps os /bin/pstree providing all information in nice way (dictionary). googling doesn't find anything

Re: Question regarding lists and regex

2006-11-08 Thread Paul McGuire
"Prabhu Gurumurthy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Here is a simple program, which queries /var/log/daemon on my OpenBSD box > and gets the list of valid ntp peers. > > Questions: > what is the easiest way for me to create lists on the fly, by that I mean > like pe

opening excel

2006-11-08 Thread timmy
Hello, has anybody got any experience opening and manilpulating excel spreedsheets via python? it seems pythoncom allows this to happen but i'm a total newb to it. (i usually work in the unix world) all i need to do, is open the xls files and read values from it. -- http://mail.python.org/mailm

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-08 Thread Fernando Perez
sturlamolden wrote: > Following up on my previous post, there is a simple Python MPI wrapper > that can be used to exploit multiple processors for scientific > computing. It only works for Numeric, but an adaptaion to NumPy should > be easy (there is only one small C file in the source): > > http

Can not download plugins for jEdit (help!!)

2006-11-08 Thread BillJosephson
Hi all. I am trying to use jEdit, but can't seem to download any plugins. I go to Plugin Manager, and select Download options. I update the mirro and can see lots of servers. I select the first (plugin central default) and say apply. In the Update dialogues bottom window, I see a msg saying "Dowloa

Question regarding lists and regex

2006-11-08 Thread Prabhu Gurumurthy
Here is a simple program, which queries /var/log/daemon on my OpenBSD box and gets the list of valid ntp peers. Questions: what is the easiest way for me to create lists on the fly, by that I mean like perl push my @foo, something_from_say_stderr. The reason is as you can ip = [""] statement b

Re: [DLC] ChiPy Monthly Meeting, Thursday 7:00 pm.

2006-11-08 Thread Hendrik van Rooyen
"Steve Holden" <[EMAIL PROTECTED]> > Hendrik van Rooyen wrote: > > "Steve Holden" <[EMAIL PROTECTED]> wrote: > > > > > >>I don't suppose there's any chance that someone might be passing > >>Schaumberg on their way to this meeting? I'm teaching there, and a ride > >>would avoid me having to rent

Re: Problem getting a file pathname with tkFileDialog

2006-11-08 Thread Tim Daneliuk
Sefyroth wrote: > Thank you!!! I have had problems with other stuff because of this > (mainly py2exe!) > > It did the job! I thank you a lot. My pleasure. > > Just wondering though, > > D:/Travaux/5ème session/B51 - Dev. de ^ > Systèmes/Workspace/LMAOSoft/Controleur.py ^

Re: Cactching Stdout

2006-11-08 Thread Stephan Kuhagen
Dennis Lee Bieber wrote: >> popen...is this what I need? How can I use them? It is very important >> for me that I could take the output in real-time. >> Thanks for the help! >> Massi > > That's going to be difficult... popen and pipes work when one > process starts another INDEPENDENT process.

Re: decorators

2006-11-08 Thread [EMAIL PROTECTED]
John Henry wrote: > I must be very thick. I keep reading about what decorators are and I > still don't have a good feel about it. See, for example: > > http://alex.dojotoolkit.org/?p=564 > > What exactly do I use decorators for? Metafunctions. Saying @mydecorator def foo(...): ... is just a

Re: Using Python from Cocoa App via PyObjc - numbers dont match...

2006-11-08 Thread sapsi
Hi, Well not a complaint as such but a question. Thank you for the response however and the link. I have seen it before but never got around to reading it... Further to this, if i was writing a python module and c function and suppose the python module and the c function called each other back a

Re: string to list of numbers conversion

2006-11-08 Thread henning
[EMAIL PROTECTED] skrev: > Hi, > I have a string '((1,2), (3,4))' and I want to convert this into a > python tuple of numbers. I think your question is deeper and more natural than is clear from the many recepies given so far in this thread, so I'll take on another point of view, >From a langu

Re: Strange re problem on OSX but Not Linux

2006-11-08 Thread Brian
Paul McGuire wrote: > "Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Dont use regex as a name. Also, do you have any script called "re.py" > > hidding that library module? or regex.py? > > My bet is that a local re.py is masking the lib module. (It's a shame

Re: Python deployment options

2006-11-08 Thread Hieu Hoang
Hi list, I have packaged a few pygames to one exe file with pyinstaller ( http:/ /pyinstaller.python-hosting.com/ ), sent them to my friends and the executables work. Running them shows a Fatal Error dialog box with only "MSVCR71.DLL", but nothing breaks, despite whether the system has python o

Re: Python to tell what is the IP of my PC

2006-11-08 Thread Hieu Hoang
Hi list, I think a script to extract the IP from some websites like whatismyip.com could do the job. I don't know how to write it though, sure someone can give direction on that. Cheers, Rooy -- http://mail.python.org/mailman/listinfo/python-list

Re: help using smtplib to work ..

2006-11-08 Thread Jordan
Your post was definitely the most helpful for me. For some reason, smtp for gmail seems to require that you call server.ehlo() a second time, after having called server.starttls(), otherwise, the server won't accept authorization. Thanks. -Jordan Gabriel Genellina wrote: > At Wednesday 8/11/20

Re: Problem getting a file pathname with tkFileDialog

2006-11-08 Thread Sefyroth
Thank you!!! I have had problems with other stuff because of this (mainly py2exe!) It did the job! I thank you a lot. Just wondering though, D:/Travaux/5ème session/B51 - Dev. de Systèmes/Workspace/LMAOSoft/Controleur.py That's my filepath, what is not ASCII in there? è Just checked and it'

Re: Using Python from Cocoa App via PyObjc - numbers dont match...

2006-11-08 Thread Michael Ash
In comp.lang.objective-c sapsi <[EMAIL PROTECTED]> wrote: > The first output in the console is 40.4 and the second > -40.4152587891. > > If i change the NSLog(s) to "%f",[n floatValue] (and the second > likewise) the first is 40.42 and the second is -40.42. I assume you are complaini

Re: auto indent

2006-11-08 Thread [EMAIL PROTECTED]
M.N.Smadi wrote: > i have a script that is not indented properly. Is there > a way that i can have it auto indented. FWIW the Zeus for Windows IDE will fold Pyhon code: http://www.zeusedit.com/features.html With the code folded you can then select the folded line and using 'tab'/'shift tab'

Re: is this the right way to do subclasses?

2006-11-08 Thread Gabriel Genellina
At Wednesday 8/11/2006 22:35, Ben Finney wrote: class Character(object): stat_keys = ['strength', 'dexterity', 'intelligence'] def __init__(self, name, stats): self.name = name self.health = 10 self.stats = {} for (key, value) i

Re: Python to tell what is the IP of my PC .

2006-11-08 Thread Cameron Walsh
Gabriel Genellina wrote: > At Wednesday 8/11/2006 21:18, Nicolas G wrote: > >> > How can I use python to get the real IP address of my DSL router (when >> > my PC is part of the local home LAN) ? >> >> http://aspn.activestate.com/ASPN

Re: Python cgi Apache os.system()

2006-11-08 Thread Cameron Walsh
[EMAIL PROTECTED] wrote: > Hello :) > > I have installed Apache on windows... > The server work well, and my python script also > > but when I want in my python script to run a System command like > os.system(my_command) the script doesn't do anything! > > here the error.log > > [Wed Nov 08 14:

Re: Python to tell what is the IP of my PC .

2006-11-08 Thread BartlebyScrivener
NicolasG wrote: > How can I use python to get the real IP address of my DSL router http://whatismyip.com rd -- http://mail.python.org/mailman/listinfo/python-list

Re: substring search without using built in utils

2006-11-08 Thread Gabriel Genellina
At Wednesday 8/11/2006 22:29, zeal elite wrote: I am looking for substring search python program without using the built in funtions like find, or 'in'. The only reasonable usage for such a constraint would be a school assignment so: don't cheat and do your homework! -- Gabriel Genellina S

Re: Using Python from Cocoa App via PyObjc - numbers dont match...

2006-11-08 Thread Gabriel Genellina
At Wednesday 8/11/2006 22:22, sapsi wrote: I managed to create a python class and instantiate that from my Objective C Cocoa App (its not a python app). [...] The first output in the console is 40.4 and the second -40.4152587891. If i change the NSLog(s) to "%f",[n floatValue] (and the sec

Re: Python to tell what is the IP of my PC .

2006-11-08 Thread Gabriel Genellina
At Wednesday 8/11/2006 21:18, Nicolas G wrote: > How can I use python to get the real IP address of my DSL router (when > my PC is part of the local home LAN) ? http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/162994 import

Re: profanity on comp.lang.python (was Re: Pyro stability)

2006-11-08 Thread skip
Irmen> So there. Finally back on the original subject ;-) And without satisfying Godwin's Law. Pretty good. Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: is this the right way to do subclasses?

2006-11-08 Thread Ben Finney
John Salerno <[EMAIL PROTECTED]> writes: > Ok, back to my so-called "game." I'm just curious if I've > implemented the subclasses properly, because it seems like an awful > lot of repetition with the parameters. And again, if I want to add a > new attribute later, I'd have to change a lot of thing

substring search without using built in utils

2006-11-08 Thread zeal elite
Hi, I am looking for substring search python program without using the built in funtions like find, or 'in'. Appreciate it. Thanks in advance. zeal _ Find a local pizza place, music store, museum and more…then map the best route

Re: assigning values in __init__

2006-11-08 Thread Ben Finney
John Salerno <[EMAIL PROTECTED]> writes: > Ben Finney wrote: > > If you pass a *mapping* of the > > "I-might-want-to-add-more-in-the-future" values, then you get both > > explicit *and* expandable, without an arbitrary unneeded sequence. > > Do you mean by using the **kwargs parameter? No. I mean

Using Python from Cocoa App via PyObjc - numbers dont match...

2006-11-08 Thread sapsi
Hi, I managed to create a python class and instantiate that from my Objective C Cocoa App (its not a python app). Essentially, i made two classes in IB and then another class(ogle) with outlets for these two. Now here is the implementation for ogle.m -(void)awakeFromNib { NSNumber *n=[NSNumber

Re: python Error: IndentationError: expected an indented block

2006-11-08 Thread Ben Finney
Please don't post HTML message bodies to a public forum. Antonios Katsikadamos <[EMAIL PROTECTED]> writes: > hi all. I am using python 2.4. I have to run an older python code > and when i run it i get the following message > IndentationError: expected an indented block. > 1)what does this mean?

Re: help using smtplib to work ..

2006-11-08 Thread Tim Williams
On 09/11/06, Nicolas G <[EMAIL PROTECTED]> wrote: > > > > > > Usually when sending/relaying without authentication, the From is > > irrelevant, only the To is taken into account. Maybe, GMAIL do > > something different because they have to put the mail in the sender's > > mailbox as well as the r

Re: Python to tell what is the IP of my PC .

2006-11-08 Thread Nicolas G
On 11/9/06, Tim Williams <[EMAIL PROTECTED]> wrote: On 8 Nov 2006 15:35:31 -0800, NicolasG <[EMAIL PROTECTED]> wrote:> How can I use python to get the real IP address of my DSL router (when> my PC is part of the local home LAN) ? The router will the PC's default gateway IP address,  if you are on a

Re: Python to tell what is the IP of my PC .

2006-11-08 Thread Tim Williams
On 09/11/06, Nicolas G <[EMAIL PROTECTED]> wrote: > > > On 11/9/06, Tim Williams <[EMAIL PROTECTED]> wrote: > > On 8 Nov 2006 15:35:31 -0800, NicolasG <[EMAIL PROTECTED]> wrote: > > > How can I use python to get the real IP address of my DSL router (when > > > my PC is part of the local home LAN) ?

Re: profanity on comp.lang.python (was Re: Pyro stability)

2006-11-08 Thread Irmen de Jong
Jorge Godoy wrote: > Cliff Wells <[EMAIL PROTECTED]> writes: > >> I think this sums up my point of view as well (although I would have >> used around 3215 more words to say it). > > H... Putting this on the discussion of the week: you'd have used > range(3215) or xrange(3215) more words? ;

Re: PIL - Pixel Level Image Manipulation?

2006-11-08 Thread Max Erickson
"Gregory Piñero" <[EMAIL PROTECTED]> wrote: > On 11/8/06, Gregory Piñero <[EMAIL PROTECTED]> wrote: >> I want to be able to randomly change pixels in an image and view >> the results. I can use whatever format of image makes this >> easiest, e.g., gray scale, bit tonal, etc. >> >> Ideally I'd lik

Re: Python to tell what is the IP of my PC .

2006-11-08 Thread Tim Williams
On 8 Nov 2006 15:35:31 -0800, NicolasG <[EMAIL PROTECTED]> wrote: > How can I use python to get the real IP address of my DSL router (when > my PC is part of the local home LAN) ? The router will the PC's default gateway IP address, if you are on a windows platform, you can view it by typing IPC

Re: help using smtplib to work ..

2006-11-08 Thread Tim Williams
On 8 Nov 2006 15:31:27 -0800, NicolasG <[EMAIL PROTECTED]> wrote: > > > > > > > Under outgoing mail smtp server, use smtp.gmail.com. Since it requires SMTP > > authorization, use your Gmail account as username (e.g. [EMAIL PROTECTED]) > > and > > your Gmail password as password. You can turn TSL

Re: pack a three byte int

2006-11-08 Thread John Machin
[EMAIL PROTECTED] wrote: > Can Python not express the idea of a three-byte int? It is a bit hard to determine what that (rhetorical?) question means. Possible answers: 1. Not as concisely as a one-byte struct code -- as you presumably have already determined by reading the manual ... 2. No, but wh

Python to tell what is the IP of my PC .

2006-11-08 Thread NicolasG
How can I use python to get the real IP address of my DSL router (when my PC is part of the local home LAN) ? -- http://mail.python.org/mailman/listinfo/python-list

Re: help using smtplib to work ..

2006-11-08 Thread NicolasG
> > > Under outgoing mail smtp server, use smtp.gmail.com. Since it requires SMTP > authorization, use your Gmail account as username (e.g. [EMAIL PROTECTED]) and > your Gmail password as password. You can turn TSL on or off. > > > > The email server requires authentication before it can send. >

Re: Barry Warsaw giving Python talk at NASA

2006-11-08 Thread William Allison
A.M. Kuchling wrote: > This is at the Goddard campus: > > > --amk Thanks for the heads up on this. I managed to get escorted in to see it. Thought it was quite good. I was also informed that the webcast will be made available to

pack a three byte int

2006-11-08 Thread p . lavarre
Can Python not express the idea of a three-byte int? For instance, in the working example below, can we somehow collapse the three calls of struct.pack into one? >>> import struct >>> >>> skip = 0x123456 ; count = 0x80 >>> >>> cdb = '' >>> cdb += struct.pack('>B', 0x08) >>> cdb += struct.pack('>I

Re: help using smtplib to work ..

2006-11-08 Thread Gabriel Genellina
At Wednesday 8/11/2006 19:23, NicolasG wrote: I'm using the following code to send e-mail through python: import smtplib fromaddr = '[EMAIL PROTECTED]' toaddrs = '[EMAIL PROTECTED]' subject = 'someting for subject !' msg = 'This is body of the mail.' msg = 'From: ' + fromaddr + '\nTo: ' + t

Re: help using smtplib to work ..

2006-11-08 Thread Larry Bates
NicolasG wrote: > I'm using the following code to send e-mail through python: > > import smtplib > > fromaddr = '[EMAIL PROTECTED]' > toaddrs = '[EMAIL PROTECTED]' > subject = 'someting for subject !' > > msg = 'This is body of the mail.' > > msg = 'From: ' + fromaddr + '\nTo: ' + toaddrs + '\

Re: decorators

2006-11-08 Thread Paul McGuire
"Carsten Haese" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > If none of the examples make you say > "wow, I could use this" and if you don't find yourself writing > repetitive setup/teardown/housekeeping code, you can probably live quite > comfortably without using decorators. >

Re: is this the right way to do subclasses?

2006-11-08 Thread Bruno Desthuilliers
John Salerno a écrit : > Peter Otten wrote: > >> You may need a no-op implementation of fix_attributes() in the Character >> class. > > > What does that mean? Is that in case I use Character directly to create > an object? Most propbably it can be useful for other character classes that don't

Re: is this the right way to do subclasses?

2006-11-08 Thread Bruno Desthuilliers
John Salerno a écrit : > Ok, back to my so-called "game." I'm just curious if I've implemented > the subclasses properly, because it seems like an awful lot of > repetition with the parameters. And again, if I want to add a new > attribute later, I'd have to change a lot of things. I can't help

Re: is this the right way to do subclasses?

2006-11-08 Thread Steve Holden
John Salerno wrote: > John Salerno wrote: >> Peter Otten wrote: >> >>> Try it: Fighter(...) will implicitly call Character.__init__(...). >> Ok, I'm confused! :) I thought you had to explicity call a base class's >> __init__ method? How is it doing this? > > Wait, I just might be an idiot. Is it

Re: assigning values in __init__

2006-11-08 Thread Steven D'Aprano
On Wed, 08 Nov 2006 10:55:57 -0500, John Salerno wrote: > Ben Finney wrote: >> John Salerno <[EMAIL PROTECTED]> writes: >> >>> But I do like Steve's suggestion that it's better to be explicit >>> about each attribute, instead of just accepting a list of numbers >>> (but I can't help but feel that

help using smtplib to work ..

2006-11-08 Thread NicolasG
I'm using the following code to send e-mail through python: import smtplib fromaddr = '[EMAIL PROTECTED]' toaddrs = '[EMAIL PROTECTED]' subject = 'someting for subject !' msg = 'This is body of the mail.' msg = 'From: ' + fromaddr + '\nTo: ' + toaddrs + '\nSubject:' + subject + '\n\n' + msg pr

Re: Change directory permission under windows

2006-11-08 Thread Roger Upole
__schronos__ wrote: > Hi. > > I would like to add users with full control access to a directory. I > can do it to a file in the following way: > > info=win32security.DACL_SECURITY_INFORMATION > sd=win32security.GetFileSecurity(DIR, info) > acl=sd.GetSecurityDescriptorDacl() > sidUser=win32securit

Re: decorators

2006-11-08 Thread Paddy
John Henry wrote: > I must be very thick. I keep reading about what decorators are and I > still don't have a good feel about it. See, for example: > > http://alex.dojotoolkit.org/?p=564 > > and: > > http://soiland.no/software/decorator > > What exactly do I use decorators for? Here's my learnin

Re: is this the right way to do subclasses?

2006-11-08 Thread John Salerno
Peter Otten wrote: > You may need a no-op implementation of fix_attributes() in the Character > class. What does that mean? Is that in case I use Character directly to create an object? Would that just be a 'pass' statement? -- http://mail.python.org/mailman/listinfo/python-list

Re: decorators

2006-11-08 Thread Carsten Haese
On Wed, 2006-11-08 at 12:37 -0800, John Henry wrote: > I must be very thick. I keep reading about what decorators are and I > still don't have a good feel about it. See, for example: > > http://alex.dojotoolkit.org/?p=564 > > and: > > http://soiland.no/software/decorator > > What exactly do I

Re: Python c-api and reusing python-objects: works only once

2006-11-08 Thread Gabriel Genellina
At Wednesday 8/11/2006 17:04, [EMAIL PROTECTED] wrote: I'm trying to access python objects from c++. It works once. Second time it hangs. Does someone have any clue or some example code or pointer? In general, try to make a *small* example that reproduces the problem you have. And the c++ cl

Re: is this the right way to do subclasses?

2006-11-08 Thread John Salerno
John Salerno wrote: > Peter Otten wrote: > >> Try it: Fighter(...) will implicitly call Character.__init__(...). > > Ok, I'm confused! :) I thought you had to explicity call a base class's > __init__ method? How is it doing this? Wait, I just might be an idiot. Is it not even necessary for me t

Re: profanity on comp.lang.python (was Re: Pyro stability)

2006-11-08 Thread skip
Carl> As for your statement about how "command of the language" (in Carl> reference to python) extends to written/spoken word, I don't quite Carl> understand what you are saying. Just that posts to newsgroups like c.l.py are examples of your written prose, profane or not. Carl>

Re: is this the right way to do subclasses?

2006-11-08 Thread John Salerno
Peter Otten wrote: > Try it: Fighter(...) will implicitly call Character.__init__(...). Ok, I'm confused! :) I thought you had to explicity call a base class's __init__ method? How is it doing this? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a commas-in-between idiom?

2006-11-08 Thread Gabriel Genellina
At Wednesday 8/11/2006 16:51, Peter van Kampen wrote: """ A = B = [] # both names will point to the same list """ I've been bitten by this once or twice in the past, but I have always wondered what it was useful for? Can anybody enlighten me? As an optimization, inside a method, you can bind

Re: profanity on comp.lang.python (was Re: Pyro stability)

2006-11-08 Thread Jorge Godoy
Cliff Wells <[EMAIL PROTECTED]> writes: > I think this sums up my point of view as well (although I would have > used around 3215 more words to say it). H... Putting this on the discussion of the week: you'd have used range(3215) or xrange(3215) more words? ;-) -- Jorge Godoy <[EMAI

Re: profanity on comp.lang.python (was Re: Pyro stability)

2006-11-08 Thread Carl J. Van Arsdall
[EMAIL PROTECTED] wrote: > Carl> You are comparing interviews to usenet. I somehow see a > Carl> disconnect. I don't think many people are going to go to a > Carl> potential employer and say "hey fuck face, how the fuck are ya?" > ... > Carl> Although you mentioned impressing

Re: is this the right way to do subclasses?

2006-11-08 Thread Gabriel G
At Wednesday 8/11/2006 16:33, John Salerno wrote: > class Character(object): > def __init__(self, name, strength, dexterity, intelligence): > self.name = name > self.health = 10 > self.strength = strength > self.dexterity = dexterity > self.intelligenc

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-08 Thread Martin v. Löwis
Ross Ridge schrieb: > The problem your describing isn't that reference counting hasn't been > made safe. What you and Joe seem to be trying to say is that atomic > increment and decrement instructions alone don't make accessing shared > structure members safe. All I can do is to repeat Joe's word

Re: Strange re problem on OSX but Not Linux

2006-11-08 Thread Paul McGuire
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dont use regex as a name. Also, do you have any script called "re.py" > hidding that library module? or regex.py? My bet is that a local re.py is masking the lib module. (It's a shame this error is so easy to tri

Re: is this the right way to do subclasses?

2006-11-08 Thread Peter Otten
John Salerno wrote: > Peter Otten wrote: > >> One way to avoid the repetition: >> >> class Character(object): >> def __init__(self, name, strength, dexterity, intelligence): >> self.name = name >> self.health = 10 >> self.strength = strength >> self.dexterity

Re: decorators

2006-11-08 Thread Paul McGuire
"John Henry" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I must be very thick. I keep reading about what decorators are and I > still don't have a good feel about it. See, for example: > > http://alex.dojotoolkit.org/?p=564 > > and: > > http://soiland.no/software/decorator > > W

Re: Strange re problem on OSX but Not Linux

2006-11-08 Thread Gabriel Genellina
At Wednesday 8/11/2006 15:01, Brian wrote: I have a very small script: import re text = open('eq.txt','r').read() regex = '[^A-Z][A-Z]{3}([a-z])[A-Z]{3}[^A-Z]' pattern = re.compile(regex) match = pattern.findall(text) print ''.join(match) -

Re: Problem getting a file pathname with tkFileDialog

2006-11-08 Thread Tim Daneliuk
Sefyroth wrote: > Thanks, > > but I get this error when I try this. > > UnicodeEncodeError: 'ascii' codec can't encode character u'\xe8' in > position 12: ordinal not in range(128) > > I had encountered it with the askdirectory method as well. Is there an > easy way to bypass this? > > Thanks

Re: tkFileDialog

2006-11-08 Thread James Stroud
Gheorghe Postelnicu wrote: > -- Forwarded message -- > From: [EMAIL PROTECTED] > To: python-list@python.org > > import tkFileDialog > file = tkFileDialog.askopenfile() > print file > Its ill-a

Re: profanity on comp.lang.python (was Re: Pyro stability)

2006-11-08 Thread skip
Carl> You are comparing interviews to usenet. I somehow see a Carl> disconnect. I don't think many people are going to go to a Carl> potential employer and say "hey fuck face, how the fuck are ya?" ... Carl> Although you mentioned impressing people etc, is it really Carl>

Re: profanity on comp.lang.python (was Re: Pyro stability)

2006-11-08 Thread skip
olsongt> Does using foobar in examples count as profanity? olsongt> http://en.wikipedia.org/wiki/Foobar Only if you spell it FUBAR, and even then it's a euphemism, so I think you're safe. ;-) Skip -- http://mail.python.org/mailman/listinfo/python-list

decorators

2006-11-08 Thread John Henry
I must be very thick. I keep reading about what decorators are and I still don't have a good feel about it. See, for example: http://alex.dojotoolkit.org/?p=564 and: http://soiland.no/software/decorator What exactly do I use decorators for? -- http://mail.python.org/mailman/listinfo/python-

decorators

2006-11-08 Thread John Henry
I must be very thick. I keep reading about what decorators are and I still don't have a good feel about it. See, for example: http://alex.dojotoolkit.org/?p=564 What exactly do I use decorators for? -- http://mail.python.org/mailman/listinfo/python-list

Re: Delivering data to python from a c-thread

2006-11-08 Thread Svein Seldal
Steve Holden wrote: > OK. I was just thinking that, with Python threads, communication using > Queue.Queue is thread-safe and will handle the GIL, so that way you only > have the problem of how to synchronize your C code when it receives the > callback from the Python thread. The python intern

Re: Is there a commas-in-between idiom?

2006-11-08 Thread Georg Brandl
Peter van Kampen schrieb: > On 2006-11-06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >> I've collected a bunch of list pydioms and other notes here: >> >> http://effbot.org/zone/python-list.htm > > """ > A = B = [] # both names will point to the same list > """ > > I've been bitten by this onc

Re: Python deployment options.

2006-11-08 Thread sturlamolden
Fuzzyman wrote: > I think that is an incorrect reading of the thread. > > The *Python* developers need a valid Visual Studio license to > redistribute msvcr71.dll. > > When you build an app with py2exe you are just bundling Python with > your application and so don't need the license. Here is a

Python c-api and reusing python-objects: works only once

2006-11-08 Thread [EMAIL PROTECTED]
Hi! I'm trying to access python objects from c++. It works once. Second time it hangs. Does someone have any clue or some example code or pointer? Thanks! /Karim Here are some python classes: -- impo

Re: Problem getting a file pathname with tkFileDialog

2006-11-08 Thread Sefyroth
Thanks, but I get this error when I try this. UnicodeEncodeError: 'ascii' codec can't encode character u'\xe8' in position 12: ordinal not in range(128) I had encountered it with the askdirectory method as well. Is there an easy way to bypass this? Thanks again Tim Daneliuk wrote: > [EMAIL P

Re: profanity on comp.lang.python (was Re: Pyro stability)

2006-11-08 Thread Cliff Wells
On Wed, 2006-11-08 at 11:18 -0800, Aahz wrote: > In article <[EMAIL PROTECTED]>, > <[EMAIL PROTECTED]> wrote: > > > >I'm with Beliavsky on this one. I can't see any particular reason to curse > >in a forum such as c.l.py. It just coarsens the discussion with no obvious > >positive benefit as far

Thank you

2006-11-08 Thread Farraige
Thank you all for your very valuable clues! Thanks to you I got nearly 97% perfomance improvement !!! I can't believe it :))) Once again thank you Best wishes Farraige -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL - Pixel Level Image Manipulation?

2006-11-08 Thread Gregory Piñero
On 11/8/06, Gregory Piñero <[EMAIL PROTECTED]> wrote: > I want to be able to randomly change pixels in an image and view the > results. I can use whatever format of image makes this easiest, e.g., > gray scale, bit tonal, etc. > > Ideally I'd like to keep the pixels in an intermediate format like

Re: Problem exiting application in Windows Console.

2006-11-08 Thread Gabriel Genellina
At Wednesday 8/11/2006 09:10, Ant wrote: [getting a stack trace for SystemExit instead of a clean exit] class HelpHTTPRequestHandler(SimpleHTTPRequestHandler): def do_GET(self): print "PATH: ", self.path if self.path.endswith("quit.html"): print "Exiting..."

Re: Problem getting a file pathname with tkFileDialog

2006-11-08 Thread Tim Daneliuk
[EMAIL PROTECTED] wrote: > Hello, > I am working on a school project that requires me to get the path of a > filename for future treatment. > I've tried getting a file with tkFileDialog.askopenfile. > > > > import tkFileDialog > file = tkFileDialog.ask

Re: Is there a commas-in-between idiom?

2006-11-08 Thread Peter van Kampen
On 2006-11-06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > I've collected a bunch of list pydioms and other notes here: > > http://effbot.org/zone/python-list.htm """ A = B = [] # both names will point to the same list """ I've been bitten by this once or twice in the past, but I have always w

tkFileDialog

2006-11-08 Thread Gheorghe Postelnicu
In our example, try replacing the last line with print file.name -- Forwarded message -- From: [EMAIL PROTECTED] To: python-list@python.org Date: 8 Nov 2006 11:01:08 -0800 Subject: Problem getting a file pathname with tkFileDialog Hello, I am working on a school project that requi

Re: How to choose the right GUI toolkit ?

2006-11-08 Thread John Henry
John Salerno wrote: > Dan Lenski wrote: > > > So, is there another toolkit I should be looking at? > > I highly recommend wxPython. It's very mature, full-featured, and > portable, and fairly easy to learn as well. I can't really compare it to > other toolkits (not having used any of them, except

Re: profanity on comp.lang.python (was Re: Pyro stability)

2006-11-08 Thread Cliff Wells
On Wed, 2006-11-08 at 10:42 -0800, Paddy wrote: > I too know your wrong Aahz. The written word is not the same as that > spoken. People should make an effort to put across their meaning in a > clear manner. If I were going to an interview I would be very careful > about swearing and most likely no

Re: is this the right way to do subclasses?

2006-11-08 Thread John Salerno
Peter Otten wrote: > One way to avoid the repetition: > > class Character(object): > def __init__(self, name, strength, dexterity, intelligence): > self.name = name > self.health = 10 > self.strength = strength > self.dexterity = dexterity > self.intell

Re: Python deployment options.

2006-11-08 Thread Larry Bates
king kikapu wrote: > I see...So, if these are the only options, the only "safe" bet is to > install the language on the machine (beeing Win, Linux or Mac) > and execute the .py files, right ?? > > > On Nov 8, 1:24 pm, "Chris_147" <[EMAIL PROTECTED]> wrote: >> king kikapu wrote: >>> Hi to all folk

Re: is this the right way to do subclasses?

2006-11-08 Thread Peter Otten
John Salerno wrote: > Ok, back to my so-called "game." I'm just curious if I've implemented > the subclasses properly, because it seems like an awful lot of > repetition with the parameters. And again, if I want to add a new > attribute later, I'd have to change a lot of things. I can't help but >

Re: please help with optimisation of this code - update of given table according to another table

2006-11-08 Thread Gabriel Genellina
At Wednesday 8/11/2006 07:18, Farraige wrote: for row_t1 in t1: for row_t2 in t2: if [row_t1[i] for i in keyColumns] == [row_t2[j] for j in keyColumns]: # the keys are the same for colName in columnsToBeUpdated:

Re: profanity on comp.lang.python (was Re: Pyro stability)

2006-11-08 Thread Aahz
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: > >Beliavsky> English is a rich language, and there are better ways of >Beliavsky> doing that. > >aahz> Oh, gimme a fucking break. > >I'm with Beliavsky on this one. I can't see any particular reason to curse >in a forum such

Re: Delivering data to python from a c-thread

2006-11-08 Thread Svein Seldal
Steve Holden wrote: > OK. I was just thinking that, with Python threads, communication using > Queue.Queue is thread-safe and will handle the GIL, so that way you only > have the problem of how to synchronize your C code when it receives the > callback from the Python thread. The python intern

Re: Exception Handling in TCPServer (was; Problem exiting application in Windows Console.)

2006-11-08 Thread Matimus
> This seems a really nasty hack though - any ideas for a cleaner way to > do it? You could overload handle_request instead. I think that makes more sense anyway because you don't want to handle a SystemExit exception as an error, you want to exit. Of course this only deals with catching the excep

  1   2   3   >