Re: __file__

2007-04-10 Thread Gabriel Genellina
En Tue, 10 Apr 2007 21:20:51 -0300, 7stud <[EMAIL PROTECTED]> escribió: > I'm having trouble understanding what the definition of __file__ is. > With this program: > > -- > #data.py: > > def show(): > print __file__ > > if __name__ == "__main__": > show() > --- > > if I run data.

Re: Does python have the static function member like C++

2007-04-10 Thread goodwolf
On Apr 11, 5:19 am, "7stud" <[EMAIL PROTECTED]> wrote: > On Apr 10, 9:08 pm, "人言落日是天涯,望极天涯不见家" <[EMAIL PROTECTED]> wrote: > > > I define the class like this: > > class AAA: > > counter = 0 > > def __init__(self): > > pass > > def counter_increase(): > > AAA.counter += 1

Re: Does python have the static function member like C++

2007-04-10 Thread bearophileHUGS
> Many thanks for you! > I've never heard of the "staticmethod" , that's great! Note that you don't need an empty __init__ : class AAA: counter = 0 @staticmethod def counter_increase(): AAA.counter += 1 print "couter now:", AAA.counter AAA.counter_increase() Bye, be

[ANN] IPython 0.8.0 is out

2007-04-10 Thread Fernando Perez
Hi all, The IPython team is happy to release version 0.8.0, with a lot of new enhancements, as well as many bug fixes. We hope you all enjoy it, and please report any problems as usual. WHAT is IPython? 1. An interactive shell superior to Python's default. IPython has many fea

Re: tuples, index method, Python's design

2007-04-10 Thread Carsten Haese
On Tue, 2007-04-10 at 21:23 -0700, Paul Rubin wrote: > Carsten Haese <[EMAIL PROTECTED]> writes: > > You have a point. Here is my revised solution: > > > > assert current_player in p > > opponents = tuple(x for x in p if x is not current_player) > > Still wrong on two counts. First, assert is a

Re: Universal Feed Parser issue

2007-04-10 Thread i3dmaster
On Apr 10, 6:45 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 10 Apr 2007 14:58:42 -0300, i3dmaster <[EMAIL PROTECTED]> > escribió: > > > I have a sample Atom feed like this: > > > > > ... > > > > > > > > > After parsed by feedparser, the timezone element does not get the >

Re: Check for keypress on Linux xterm ?

2007-04-10 Thread Grant Edwards
On 2007-04-11, hlubenow <[EMAIL PROTECTED]> wrote: > I wrote: > >> Hello, >> >> I'd like to check, if a single key is pressed on a Linux xterm. >> My problem is, I don't want my program to wait for the keypress. >> I just want to check, if a key is currently pressed and if not, I'd like >> to cont

Re: itertools, functools, file enhancement ideas

2007-04-10 Thread Paul Rubin
"Klaas" <[EMAIL PROTECTED]> writes: > Still don't see much advantage over writing a lambda (except perhaps > speed). Well, it's partly a matter of avoiding boilerplate, especially with the lambdaphobia that many Python users seem to have. -- http://mail.python.org/mailman/listinfo/python-list

Re: tuples, index method, Python's design

2007-04-10 Thread Paul Rubin
Carsten Haese <[EMAIL PROTECTED]> writes: > You have a point. Here is my revised solution: > > assert current_player in p > opponents = tuple(x for x in p if x is not current_player) Still wrong on two counts. First, assert is a no-op if optimization is turned on. Second, your version returns a

RELEASED Python 2.5.1, release candidate 1

2007-04-10 Thread Anthony Baxter
On behalf of the Python development team and the Python community, I'm happy to announce the release of Python 2.5.1 (release candidate 1). This is the first bugfix release of Python 2.5. Python 2.5 is now in bugfix-only mode; no new features are being added. According to the release notes, ov

Re: install wxPython

2007-04-10 Thread 7stud
On Apr 9, 2:20 pm, Marco <[EMAIL PROTECTED]> wrote: > Hi, > > I have a problem to install wxPython on my MacBook (Pythonversion 2.5). > If would install the wxPython (python setup.py install), then I got > this error: > > Traceback (most recent call last): > File "/Users/marco/Desktop/flexo1/wxpy

Re: How to get IP address of client from CGI module?

2007-04-10 Thread Graham Dumpleton
On Apr 11, 12:22 pm, John Nagle <[EMAIL PROTECTED]> wrote: >The documentation for Python's CGI module doesn't seem to say how to get > the IP address of the client. Don't see an obvious way to get that info > from reading the source, either. Ideas? > > J

Re: Python-list Digest, Vol 43, Issue 155

2007-04-10 Thread Amit K Saha
Hi mike! > > I've played with the win32 module's text-to-speech abilities a little. > > You may be able to get ideas from that. Here's a link to more info: > > http://surguy.net/articles/speechrecognition.xml > > > > http://www.cs.unc.edu/~parente/tech/tr02.shtml > > I forgot to mention that I am

Re: Does python have the static function member like C++

2007-04-10 Thread 人言落日是天涯,望极天涯不见家
On Apr 11, 11:19 am, "7stud" <[EMAIL PROTECTED]> wrote: > On Apr 10, 9:08 pm, "人言落日是天涯,望极天涯不见家" <[EMAIL PROTECTED]> wrote: > > > I define the class like this: > > class AAA: > >     counter = 0 > >     def __init__(self): > >         pass > >     def counter_increase(): > >         AAA.counter += 1

Re: Please help!!!

2007-04-10 Thread James Stroud
gslm wrote: > On 10 Nisan, 23:16, "Paul McGuire" <[EMAIL PROTECTED]> wrote: > >>On Apr 10, 2:43 pm, "gslm" <[EMAIL PROTECTED]> wrote: >> >> >>In fact ı know this, but I asked some questions like this, but ı haven't get >>any answer.And I thought that may be it could be better to use a header like

Re: Does python have the static function member like C++

2007-04-10 Thread 7stud
On Apr 10, 9:08 pm, "人言落日是天涯,望极天涯不见家" <[EMAIL PROTECTED]> wrote: > I define the class like this: > class AAA: >     counter = 0 >     def __init__(self): >         pass >     def counter_increase(): >         AAA.counter += 1 >         print "couter now :", AAA.counter > > But how could I call the

Re: Does python have the static function member like C++

2007-04-10 Thread 7stud
On Apr 10, 9:08 pm, "人言落日是天涯,望极天涯不见家" <[EMAIL PROTECTED]> wrote: > I define the class like this: > class AAA: >     counter = 0 >     def __init__(self): >         pass >     def counter_increase(): >         AAA.counter += 1 >         print "couter now :", AAA.counter > > But how could I call the

Does python have the static function member like C++

2007-04-10 Thread 人言落日是天涯,望极天涯不见家
I define the class like this: class AAA: counter = 0 def __init__(self): pass def counter_increase(): AAA.counter += 1 print "couter now :", AAA.counter But how could I call the function "counter_incrrease" ? Thanks ! -- http://mail.python.org/mailman/listinf

How to get IP address of client from CGI module?

2007-04-10 Thread John Nagle
The documentation for Python's CGI module doesn't seem to say how to get the IP address of the client. Don't see an obvious way to get that info from reading the source, either. Ideas? John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Universal Feed Parser issue

2007-04-10 Thread Gabriel Genellina
En Tue, 10 Apr 2007 14:58:42 -0300, i3dmaster <[EMAIL PROTECTED]> escribió: > I have a sample Atom feed like this: > > > ... > > > > > After parsed by feedparser, the timezone element does not get the > attribute "America/Mountain". Same thing on status element. This does > not sound an

Re: Please help!!!

2007-04-10 Thread Paul McGuire
On Apr 10, 3:59 pm, "gslm" <[EMAIL PROTECTED]> wrote: > On 10 Nisan, 23:16, "Paul McGuire" <[EMAIL PROTECTED]> wrote: > > > > > On Apr 10, 2:43 pm, "gslm" <[EMAIL PROTECTED]> wrote: > > > In fact ý know this, but I asked some questions like this, but ý haven't > > get any answer.And I thought that

Re: tuples, index method, Python's design

2007-04-10 Thread Terry Reedy
"Paul Boddie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | always enlightening/entertaining to see the rationales given for the | rejection of this and other features, in contrast to things like "y if | x else z" which just seem to mysteriously acquire momentum and then | power t

Re: tuples, index method, Python's design

2007-04-10 Thread Terry Reedy
"BJörn Lindqvist" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On 4/10/07, Steve Holden <[EMAIL PROTECTED]> wrote: > One might perversely allow extension to lists and tuples to allow > >[3, 4] in [1, 2, 3, 4, 5, 6] > > to succeed, but that's forcing the use case beyond normal l

__file__

2007-04-10 Thread 7stud
Hi, I'm having trouble understanding what the definition of __file__ is. With this program: -- #data.py: def show(): print __file__ if __name__ == "__main__": show() --- if I run data.py with the prompt pointing to the directory that contains data.py, then __file__ produces a f

Re: Check for keypress on Linux xterm ?

2007-04-10 Thread hlubenow
I wrote: > Hello, > > I'd like to check, if a single key is pressed on a Linux xterm. > My problem is, I don't want my program to wait for the keypress. > I just want to check, if a key is currently pressed and if not, I'd like > to continue with my program (like "INKEY$" in some BASIC-dialects).

Re: problem with UDP broadcast on Windows XP

2007-04-10 Thread Irmen de Jong
Paul McGuire wrote: > I would investigate Windows security settings as a likely culprit. My > guess is that you are running WinXP SP2 with the default security > policies, which are likely to prohibit such promiscuous behavior. > > Here's a URL that may shed some light, it seems surprisingly > i

Re: XML-RPC SSL and client side certs?

2007-04-10 Thread Jeff McNeil
I apologize for not giving you a Python specific answer, but for the XMLRPC services I've deployed, I front them with Apache and proxy back to localhost:8080. I do all of the encryption and authentication from within the Apache proper and rely on mod_proxy to forward validated requests on. I've s

RE: Why NOT only one class per file?

2007-04-10 Thread Delaney, Timothy (Tim)
Bruno Desthuilliers wrote: > I came to this conclusion from my own experience, and it seems that > quite a few other programmers (most of them either better and/or more > experimented than me) came to the same conclusion. But feel free to Been more experimented on, or have experimented more on ot

RE: tuples, index method, Python's design

2007-04-10 Thread Delaney, Timothy (Tim)
Carsten Haese wrote: > assert current_player in p > opponents = tuple(x for x in p if x is not current_player) That would perform better as: opponents = tuple(x for x in p if x is not current_player) assert opponents Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: About Eggs

2007-04-10 Thread Mark Elston
* Rob Wolfe wrote (on 4/10/2007 1:38 PM): > Mark Elston <[EMAIL PROTECTED]> writes: > >> This is probably a *really* stupid question but... >> I have looked at all the documentation I have for 2.4.3 >> and all the docs I can download for 2.5 and I simply cannot >> find anything, anywhere that docu

Re: About Trolltech QT OpenSource license.

2007-04-10 Thread Damjan
> @ Kevin and Jarek : > thanks for the enlightening of that GPL thing. So, if i understand, i > create my Python software using Qt as my GUI, i earn the money for it > with the obligation to release my source code and somewhere in my > files i explicilty write that this software is under the GPL li

Re: About Trolltech QT OpenSource license.

2007-04-10 Thread Kevin Walzer
king kikapu wrote: > > > @ Kevin and Jarek : > thanks for the enlightening of that GPL thing. So, if i understand, i > create my Python software using Qt as my GUI, i earn the money for it > with the obligation to release my source code and somewhere in my > files i explicilty write that this so

Re: grabbing Pictures from the web

2007-04-10 Thread Josh Bloom
I don't have any experience with TK so I can't comment on that but for getting pics from the web, you will need to do the following: 1) Work with the flickr API or flickr feeds to get the url for each picture that you want to work with. 2) Either download the image to disk or read it into memory t

Re: Why NOT only one class per file?

2007-04-10 Thread Bruno Desthuilliers
Sherm Pendley a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > > >>Sherm Pendley a écrit : >> >>>Bruno Desthuilliers <[EMAIL PROTECTED]> writes: >>> >>> >>> Sherm Pendley a écrit : In my book, it's huge classes and methods that are usually a smell of a design problem

Re: tuples, index method, Python's design

2007-04-10 Thread BJörn Lindqvist
> > while not game_has_ended: > > for current_player in p: > > player_does_something(current_player) > > > > I'm curious why someone would even consider using a tuple in this case > regardless. I think that much of the desire for tuple.index is because > people use a tuple where they could ha

Re: menu drop down icons (inactive) look horrible in Windows Classic Theme

2007-04-10 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, ilikewine wrote: > The menu drop down icons (only the gray inactive icons) look horrible > in Windows Classic Theme. Once they are active and have color, they > look fine. If we switch to XP theme, they look just fine. Anyone else > run into this problem with python rewriti

Re: About Trolltech QT OpenSource license.

2007-04-10 Thread king kikapu
Ο/Η Peter Decker έγραψε: > There is another alternative: Dabo, which wraps the wxPython toolkit. > It has a GUI designer, although not as polished as the Qt Designer. > Check out some of their screencasts to see their tools in action. You > can find them at http://dabodev.com/documentation I am a

menu drop down icons (inactive) look horrible in Windows Classic Theme

2007-04-10 Thread ilikewine
The menu drop down icons (only the gray inactive icons) look horrible in Windows Classic Theme. Once they are active and have color, they look fine. If we switch to XP theme, they look just fine. Anyone else run into this problem with python rewriting "shotty" inactive icons in the Windows Classic

XML-RPC SSL and client side certs?

2007-04-10 Thread Eli Criffield
Does anyone have an example setup of a XML-RPC sever using client side certs for authentication? And instead of having a list of certs allowed to connect, I'd like to allow any cert signed by my CA. It doesn't seem like it would be to hard to do and I'll probably spend some time setting it up he

Re: Parsing log in SQL DB to change IPs to hostnames

2007-04-10 Thread KDawg44
On Apr 10, 2:47 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > KDawg44 wrote: > > On Apr 10, 11:11 am, "Kushal Kumaran" <[EMAIL PROTECTED]> > > wrote: > >> On Apr 10, 8:37 pm, "KDawg44" <[EMAIL PROTECTED]> wrote: > > >>> Hi, > >>> I am brand new to Python. In learning anything, I find it useful to

Re: block scope?

2007-04-10 Thread Bruno Desthuilliers
Paul Rubin a écrit : > [EMAIL PROTECTED] (Alex Martelli) writes: > >locals['x']=5 >> >>Traceback (most recent call last): >> File "", line 1, in >>TypeError: 'builtin_function_or_method' object does not support item >>assignment > > > > Whoops, yeah, meant "locals()['x'] = 5". > > >>I t

Re: Custom Python Runtime

2007-04-10 Thread Martin v. Löwis
Jack schrieb: > Thanks for all the replies. It would be great to have all customization > related information on one doc page. Please put it into a wiki page, at wiki.python.org > 1. One Windows, it's possible to zip all files in a Python24.zip. I'm not > very clear if it's used in the stardard d

Re: Please help!!!

2007-04-10 Thread gslm
On 10 Nisan, 23:16, "Paul McGuire" <[EMAIL PROTECTED]> wrote: > On Apr 10, 2:43 pm, "gslm" <[EMAIL PROTECTED]> wrote: > > > In fact ı know this, but I asked some questions like this, but ı haven't get > any answer.And I thought that may be it could be better to use a header like > this for help.S

Re: About Trolltech QT OpenSource license.

2007-04-10 Thread Jarek Zgoda
king kikapu napisał(a): >> This is a bullsh*t. Qt is free (as in "free speech") on GPL. Nothing >> stops you from using it in any commercial project if only it fits the >> licensing terms (i.o.w. it's free software). This specially applies to >> inhouse development, as in such case there's no "dis

Re: About Trolltech QT OpenSource license.

2007-04-10 Thread Peter Decker
On 10 Apr 2007 12:29:36 -0700, king kikapu <[EMAIL PROTECTED]> wrote: > Hi to all, > > i am coming from the Microsoft (.net) world and at the quest of > finding the right GUI toolkit that i can use from Python, i have two > obvious choices to choose from: wxPython and Qt. > > Both are looking very

Re: About Trolltech QT OpenSource license.

2007-04-10 Thread Kevin Walzer
king kikapu wrote: > As i said, i do not fully understand all this license stuff. All i > want to ask is, i can make GPL software and gain money from this ? Yes. Nothing in the GPL prevents you from developing and marketing an application for as high a price as you can get from it. HOWEVER: yo

Re: Problem with getting an option value

2007-04-10 Thread Nanjundi
On Apr 10, 10:23 am, "Lucas Malor" <[EMAIL PROTECTED]> wrote: > Peter Otten wrote: > > Lucas Malor wrote: > > >> The problem is options is an instance, so options."delete", for example, > >> is wrong; I should pass options.delete . How can I do? > > > Use getattr(): > > Thank you. Do you know also

Re: pluie documentation in english

2007-04-10 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > On Apr 10, 3:14 am, "Méta-MCI" <[EMAIL PROTECTED]> > wrote: > >>Bonjour ! >> >>Avec Internet-Explorer 6 : >> >>Dans Internet-explorer, par le menu, faire : Outils + Options_internet >>Aller sur le dernier onglet (Avancé), et cocher : autoriser le contenu actif >>

Re: NLTK, Random Sentence Generators?

2007-04-10 Thread James Stroud
Passer By wrote: > James Stroud <[EMAIL PROTECTED]> writes: > > >>Passer By wrote: >> >> >>>Has any created or not of examples of random sentence generators >>>using n-gram models (or other models might be interesting). I >>>know of one example from a course at MIT, but besides that >>>nothing.

Re: problem with UDP broadcast on Windows XP

2007-04-10 Thread Paul McGuire
On Apr 10, 3:30 pm, Irmen de Jong <[EMAIL PROTECTED]> wrote: > > Hendrik van Rooyen wrote: > >> I am not sure if this is at all relevant - but I seem to recall seeing > >> something once that had a list of socket numbers, splitting them > >> between UDP & TCP - can the socket actually rx UDP? > Yea

Re: About Eggs

2007-04-10 Thread Rob Wolfe
Mark Elston <[EMAIL PROTECTED]> writes: > This is probably a *really* stupid question but... > I have looked at all the documentation I have for 2.4.3 > and all the docs I can download for 2.5 and I simply cannot > find anything, anywhere that documents what egg files are. > > I have read posts re

Re: About Eggs

2007-04-10 Thread kyosohma
On Apr 10, 3:30 pm, Mark Elston <[EMAIL PROTECTED]> wrote: > This is probably a *really* stupid question but... > I have looked at all the documentation I have for 2.4.3 > and all the docs I can download for 2.5 and I simply cannot > find anything, anywhere that documents what egg files are. > > I

Re: Can I get the exit code "n" passed to sys.exit(n) ?

2007-04-10 Thread Gabriel Genellina
En Tue, 10 Apr 2007 15:15:57 -0300, Yujo <[EMAIL PROTECTED]> escribió: > In the following code of the finish() function, is there any way to > get the exit code passed to sys.exit() ? > > def finish() : >RETURN_CODE_FROM_SYS_EXIT = # how can I get it ? >if RETURN_CODE_FROM_SYS_EX

Re: [offtopic?] problem with UDP broadcast on Windows XP

2007-04-10 Thread Irmen de Jong
> Hendrik van Rooyen wrote: >> I am not sure if this is at all relevant - but I seem to recall seeing >> something once that had a list of socket numbers, splitting them >> between UDP & TCP - can the socket actually rx UDP? Yeah, as I wrote: when I'm sending UDP packets to the port directly on t

Re: About Trolltech QT OpenSource license.

2007-04-10 Thread king kikapu
Ο/Η Jarek Zgoda έγραψε: > king kikapu napisa³(a): > > This is a bullsh*t. Qt is free (as in "free speech") on GPL. Nothing > stops you from using it in any commercial project if only it fits the > licensing terms (i.o.w. it's free software). This specially applies to > inhouse development, as in s

About Eggs

2007-04-10 Thread Mark Elston
This is probably a *really* stupid question but... I have looked at all the documentation I have for 2.4.3 and all the docs I can download for 2.5 and I simply cannot find anything, anywhere that documents what egg files are. I have read posts referring to them and have been able to deduce that th

Re: About Trolltech QT OpenSource license.

2007-04-10 Thread Jarek Zgoda
king kikapu napisał(a): > I saw at the forum here that a lot of debate is coming from the > "strange" interpretation of it's Open Source Edition lisence. > After a lot of reading i was under the impression (and many others > with me) that even a stand alone developer working in-house at company >

Re: Please help!!!

2007-04-10 Thread Paul McGuire
On Apr 10, 2:43 pm, "gslm" <[EMAIL PROTECTED]> wrote: > Hi to all! > I want to do a calendar with pictures near months. > I have designed the form's view.But unfortunately, I am not be able to > save this view as an image file.And so I am not be able to print this > image file too. > Question: > Ho

Re: NLTK, Random Sentence Generators?

2007-04-10 Thread [EMAIL PROTECTED]
On Apr 10, 1:59 pm, Paulo da Silva <[EMAIL PROTECTED]> wrote: > gene tani escreveu: > > > On Apr 10, 1:36 am, Passer By <[EMAIL PROTECTED]> wrote: > >> Has any created or not of examples of random sentence generators using > >> n-gram models (or other models might be interesting). > > >> I know of

Re: OT: Question about RGB color method

2007-04-10 Thread Paul McGuire
Ah, the Wikipedia article for "Primary Colors" is much better at explaining this than the one for "RGB Color". For instance, in the Tempra-paint-compatible subtractive system, you probably recall mixing red, yellow, and blue, and getting black, or at least a dark muddy brown. Conversely, in the a

Re: OT: Question about RGB color method

2007-04-10 Thread Paul McGuire
On Apr 10, 2:32 pm, John Salerno <[EMAIL PROTECTED]> wrote: > Sorry for this non-Python question, but since it's computer related I > know you guys will have an answer, and I don't really know where else to > ask. Mainly I'm just curious anyway. > > I'm wondering, why do computers use a RGB color s

Re: OT: Question about RGB color method

2007-04-10 Thread Grant Edwards
On 2007-04-10, John Salerno <[EMAIL PROTECTED]> wrote: > Sorry for this non-Python question, but since it's computer related It isn't. Computer-related, that is. > I'm wondering, why do computers use a RGB color scheme instead > of the primary colors? The same reason televisions and all other

Re: OT: Question about RGB color method

2007-04-10 Thread Carsten Haese
On Tue, 2007-04-10 at 15:32 -0400, John Salerno wrote: > Sorry for this non-Python question, but since it's computer related I > know you guys will have an answer, and I don't really know where else to > ask. Mainly I'm just curious anyway. > > I'm wondering, why do computers use a RGB color sch

Re: OT: Question about RGB color method

2007-04-10 Thread kyosohma
On Apr 10, 2:32 pm, John Salerno <[EMAIL PROTECTED]> wrote: > Sorry for this non-Python question, but since it's computer related I > know you guys will have an answer, and I don't really know where else to > ask. Mainly I'm just curious anyway. > > I'm wondering, why do computers use a RGB color s

Re: OT: Question about RGB color method

2007-04-10 Thread Matimus
On Apr 10, 12:32 pm, John Salerno <[EMAIL PROTECTED]> wrote: > Sorry for this non-Python question, but since it's computer related I > know you guys will have an answer, and I don't really know where else to > ask. Mainly I'm just curious anyway. > > I'm wondering, why do computers use a RGB color

Re: Problem with getting an option value

2007-04-10 Thread Gabriel Genellina
En Tue, 10 Apr 2007 11:23:37 -0300, Lucas Malor <[EMAIL PROTECTED]> escribió: > Peter Otten wrote: >> Lucas Malor wrote: >>> >>> The problem is options is an instance, so options."delete", for >>> example, >>> is wrong; I should pass options.delete . How can I do? >> >> Use getattr(): > > Than

Re: Parsing log in SQL DB to change IPs to hostnames

2007-04-10 Thread Steve Holden
KDawg44 wrote: > On Apr 10, 11:11 am, "Kushal Kumaran" <[EMAIL PROTECTED]> > wrote: >> On Apr 10, 8:37 pm, "KDawg44" <[EMAIL PROTECTED]> wrote: >> >> >> >>> Hi, >>> I am brand new to Python. In learning anything, I find it useful to >>> actually try to write a useful program to try to tackle an ac

Please help!!!

2007-04-10 Thread gslm
Hi to all! I want to do a calendar with pictures near months. I have designed the form's view.But unfortunately, I am not be able to save this view as an image file.And so I am not be able to print this image file too. Question: How can I determine the coordinates of a button?Namely How can I use t

OT: Question about RGB color method

2007-04-10 Thread John Salerno
Sorry for this non-Python question, but since it's computer related I know you guys will have an answer, and I don't really know where else to ask. Mainly I'm just curious anyway. I'm wondering, why do computers use a RGB color scheme instead of the primary colors? Is there something you can't

Re: Parsing log in SQL DB to change IPs to hostnames

2007-04-10 Thread KDawg44
On Apr 10, 1:54 pm, "KDawg44" <[EMAIL PROTECTED]> wrote: > On Apr 10, 11:11 am, "Kushal Kumaran" <[EMAIL PROTECTED]> > wrote: > > > > > On Apr 10, 8:37 pm, "KDawg44" <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I am brand new to Python. In learning anything, I find it useful to > > > actually tr

About Trolltech QT OpenSource license.

2007-04-10 Thread king kikapu
Hi to all, i am coming from the Microsoft (.net) world and at the quest of finding the right GUI toolkit that i can use from Python, i have two obvious choices to choose from: wxPython and Qt. Both are looking very good. Qt has Qt designer, a tool that really reminds me of the forms designers tha

Re: itertools, functools, file enhancement ideas

2007-04-10 Thread Klaas
On Apr 8, 9:34 am, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > > a) def flip(f): return lambda x,y: f(y,x) > > Curious resemblance to: > >itemgetter(1,0) > > Not sure I understand that. I think he read it as lambda (x, y): (y, x) More interesting would

Re: NLTK, Random Sentence Generators?

2007-04-10 Thread Paulo da Silva
gene tani escreveu: > On Apr 10, 1:36 am, Passer By <[EMAIL PROTECTED]> wrote: >> Has any created or not of examples of random sentence generators using >> n-gram models (or other models might be interesting). >> >> I know of one example from a course at MIT, but besides that nothing. >> >> Any hel

Problems with curses.start_color()

2007-04-10 Thread skip
Environment: Solaris 10, Python 2.4.2. I'm trying to convert a very simple (display-wise) program to use curses. This is my first try at using curses. I have wrapped my main: try: sys.exit(curses.wrapper(main, *sys.argv[1:])) except (KeyboardInterrupt, SystemExit): sys.e

Re: Parsing log in SQL DB to change IPs to hostnames

2007-04-10 Thread KDawg44
On Apr 10, 11:11 am, "Kushal Kumaran" <[EMAIL PROTECTED]> wrote: > On Apr 10, 8:37 pm, "KDawg44" <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > I am brand new to Python. In learning anything, I find it useful to > > actually try to write a useful program to try to tackle an actual > > problem. > >

Re: installing pyqt4 on ubuntu 6.06

2007-04-10 Thread Joshua J. Kugler
On Tuesday 10 April 2007 07:35, Pradnyesh Sawant wrote: > Any pointers regarding what packages should i install to get the > system into working condition would be very helpful It's next to impossible, due to conflicts with SIP, and other dependencies. See these two threads (both started by me)

Re: exec statement Syntax Error on string pulled from MySQL

2007-04-10 Thread [EMAIL PROTECTED]
On Apr 10, 2:19 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Now I just have to figure out how the '\r' are getting in > there. I entered that piece of code using PHPMyAdmin so that could be > doing it, or MySQLdb could be doing it when returning it, or it could > be something about the DB

Re: writing my own extension

2007-04-10 Thread kyosohma
On Apr 10, 12:52 pm, "spohle" <[EMAIL PROTECTED]> wrote: > hi, > > i use a lot the enumerate in my scripts and got really interested in > possibly writing my own enumerate as an extension, for which i would > want to extend it to be able to pass a start and step attribute. > > can anyone point me o

Mysterious argument count error to __new__

2007-04-10 Thread Clarence
I'm having problems with JPype and am trying to change the way it creates Python classes as proxies for Java classes and interfaces. I'm trying to get around "inconsistent mro" problems, but in doing so, I've run into a real mystery. Here's the original code. It first makes a metaclass, then makes

Re: Can I get the exit code "n" passed to sys.exit(n) ?

2007-04-10 Thread kyosohma
On Apr 10, 1:15 pm, "Yujo" <[EMAIL PROTECTED]> wrote: > Hello everybody, > > In the following code of the finish() function, is there any way to > get the exit code passed to sys.exit() ? > > def finish() : >RETURN_CODE_FROM_SYS_EXIT = # how can I get it ? >if RETURN_CODE_FROM_SYS_E

Re: Kill thread or at least socket.getaddrinfo

2007-04-10 Thread Chris Mellon
On 10 Apr 2007 11:07:51 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On 26 Mar., 18:08, [EMAIL PROTECTED] wrote: > > you know the pid, you can kill it, but that's not always a > > clean way of accomplishing the task. > > So I have to open the connection in a new process... Sigh.. How I hat

Re: exec statement Syntax Error on string pulled from MySQL

2007-04-10 Thread [EMAIL PROTECTED]
On Apr 10, 4:49 am, Georg Brandl <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > > > > It's the strangest thing, I'm pulling some text out of a MySQL table > > and trying to run exec on it, and it keeps giving me a syntax error, > > always at the end of the first line. > > > Thanks in

Can I get the exit code "n" passed to sys.exit(n) ?

2007-04-10 Thread Yujo
Hello everybody, In the following code of the finish() function, is there any way to get the exit code passed to sys.exit() ? def finish() : RETURN_CODE_FROM_SYS_EXIT = # how can I get it ? if RETURN_CODE_FROM_SYS_EXIT = 0 : # process ended OK else : # process ended wit

Re: Kill thread or at least socket.getaddrinfo

2007-04-10 Thread [EMAIL PROTECTED]
On 26 Mar., 18:08, [EMAIL PROTECTED] wrote: > you know the pid, you can kill it, but that's not always a > clean way of accomplishing the task. So I have to open the connection in a new process... Sigh.. How I hate this part of Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: tuples, index method, Python's design

2007-04-10 Thread Chris Mellon
On 4/10/07, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Tue, 2007-04-10 at 19:21 +0200, BJörn Lindqvist wrote: > > On 4/10/07, Carsten Haese <[EMAIL PROTECTED]> wrote: > > > > > opponents = tuple(x for x in p if x is not current_player) > > > > > > > > > Your alternative is wrong because it wont

Universal Feed Parser issue

2007-04-10 Thread i3dmaster
I have a sample Atom feed like this: http://app.example.com/fjie4id939xdl3io23 foo bar [EMAIL PROTECTED] 2007-04-09T22:14:15.000Z After parsed by feedparser, the timezone element does not get the attribute "America/Mountain". Same thing on status element. This does

writing my own extension

2007-04-10 Thread spohle
hi, i use a lot the enumerate in my scripts and got really interested in possibly writing my own enumerate as an extension, for which i would want to extend it to be able to pass a start and step attribute. can anyone point me on my way with good examples for that and how to write extensions ? t

Re: Having trouble with relative imports

2007-04-10 Thread Echo
On 4/9/07, Echo <[EMAIL PROTECTED]> wrote: > Here is my setup: > rpg > -objects > --__init__.py > --gameobject.py > --material.py > -__init__.py > -run_tests.py > -stats.py > > the contents of run_test.py is: > import objects as o > > the contents of objects/__init__.py is: > from material import *

ANN: pywinauto 0.3.7 now released

2007-04-10 Thread Mark Mc Mahon
Hi, 0.3.7 release of pywinauto is now available. pywinauto is an open-source (LGPL) package for using Python as a GUI automation 'driver' for Windows NT based Operating Systems (NT/W2K/XP/Vista?). SourceForge project page: http://sourceforge.net/projects/pywinauto Download from SourceForge http

Re: tuples, index method, Python's design

2007-04-10 Thread Carsten Haese
On Tue, 2007-04-10 at 19:21 +0200, BJörn Lindqvist wrote: > On 4/10/07, Carsten Haese <[EMAIL PROTECTED]> wrote: > > > > opponents = tuple(x for x in p if x is not current_player) > > > > > > > Your alternative is wrong because it wont raise ValueError if > > > current_player is not present in the

Re: Database in memory

2007-04-10 Thread Nicko
On Apr 10, 1:10 pm, "Nicko" <[EMAIL PROTECTED]> wrote: > If you expect to do exact-match look-up where the keys are not unique > then build a dictionary containing 'set' objects which are the sets of > records which have the given key. This lets you neatly find the > intersection of selections on m

Re: Why is __getslice__ still implemented?

2007-04-10 Thread Steven Bethard
Torsten Bronger wrote: > Hallöchen! > > Steven Bethard writes: > >> Torsten Bronger wrote: >> >>> [...] >>> >>> [...] It forces people to implement a deprecated function after >>> all. I think the docs should say that you still have to override >>> __getslice__ when subclassing from a built-in

Re: tuples, index method, Python's design

2007-04-10 Thread BJörn Lindqvist
On 4/10/07, Carsten Haese <[EMAIL PROTECTED]> wrote: > > > opponents = tuple(x for x in p if x is not current_player) > > > > > Your alternative is wrong because it wont raise ValueError if > > current_player is not present in the tuple. Please revise your > > "solution." > > You have a point. Here

Re: tuples, index method, Python's design

2007-04-10 Thread bearophileHUGS
BJörn Lindqvist: > > One might perversely allow extension to lists and tuples to allow > >[3, 4] in [1, 2, 3, 4, 5, 6] > > to succeed, but that's forcing the use case beyond normal limits. The > > point I am trying to make is that circumstances alter cases, and that we > > can't always rely on

grabbing Pictures from the web

2007-04-10 Thread Juan Vazquez
I am new to python (2 weeks old) and I would like to write a script that grabs pictures from the web (specifically flickr) and put them on a Tk Canvas for a slide show/editing program. my 2 questions are 1) How do I grab a picture from the web 2) is the use of the Tk canvas for working with the p

Re: Why is __getslice__ still implemented?

2007-04-10 Thread Torsten Bronger
Hallöchen! Steven Bethard writes: > Torsten Bronger wrote: > >> [...] >> >> [...] It forces people to implement a deprecated function after >> all. I think the docs should say that you still have to override >> __getslice__ when subclassing from a built-in type, unless I >> really don't underst

Re: NLTK, Random Sentence Generators?

2007-04-10 Thread gene tani
On Apr 10, 1:36 am, Passer By <[EMAIL PROTECTED]> wrote: > Has any created or not of examples of random sentence generators using > n-gram models (or other models might be interesting). > > I know of one example from a course at MIT, but besides that nothing. > > Any help would be great. Markov ch

Re: Check for keypress on Linux xterm ?

2007-04-10 Thread hlubenow
Grant Edwards wrote: > I do make mistakes, but before telling somebody he's wrong, it > might be a good idea to actually try what he's suggested. ;) I completely agree. The script waited at first for key-input, so I thought, I was right. But I was not. I apologize ! H. -- http://mail.python.org

Re: tuples, index method, Python's design

2007-04-10 Thread Antoon Pardon
On 2007-04-10, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Tue, 2007-04-10 at 13:21 +, Antoon Pardon wrote: >> > But if you are so eager to rewrite, how about the following: >> > >> > I am using the struct module to get binary data from a file. >> > Sometimes I want to skip until I find a p

Re: Check for keypress on Linux xterm ?

2007-04-10 Thread Grant Edwards
On 2007-04-10, hlubenow <[EMAIL PROTECTED]> wrote: >>> My problem is, I don't want my program to wait for the >>> keypress. I just want to check, if a key is currently pressed >>> and if not, I'd like to continue with my program (like >>> "INKEY$" in some BASIC-dialects). >> >> The answer to this

  1   2   >