Re: building a GUI

2007-09-23 Thread Diez B. Roggisch
stef mientki schrieb: > Phil Thompson wrote: >> On Sunday 23 September 2007, stef mientki wrote: >> >>> Diez B. Roggisch wrote: >>> stef mientki schrieb: > Thomas Dybdahl Ahle wrote: > >> Den Sun, 23 Sep 2007 17:28:38 +0200 skrev stef mientki: >>

scope, modyfing outside object from inside the method

2007-09-23 Thread Marcin Stępnicki
Hello. I thought I understand this, but apparently I don't :(. I'm missing something very basic and fundamental here, so redirecting me to the related documentation is welcomed as well as providing working code :). Trivial example which works as expected: >>> x = {'a':123, 'b': 456} >>> y = x >

RE: I could use some help making this Python code run faster usingonly Python code.

2007-09-23 Thread Delaney, Timothy (Tim)
Python Maniac wrote: > Some benchmarks showing the effectiveness of using Psyco: > > scramble: 4.210 > scramble_listcomp: 2.343 > scramble_gencomp: 2.599 > scramble_map: 1.960 > scramble_imap: 2.231 > scramble_dict: 2.387 > scramble_dict_map: 0.535 > scramble_dict_imap:

Re: building a GUI

2007-09-23 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, stef mientki wrote: > ... I never looked at PyQt seriously, because of their weird license. What's weird about it? Lots of software products are dual-licensed, e.g. MySQL, Perl. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie completely confused

2007-09-23 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Gabriel Genellina wrote: > En Fri, 21 Sep 2007 13:34:40 -0300, Jeroen Hegeman > <[EMAIL PROTECTED]> escribi�: > >> class ModerateClass: >> def __init__(self): >> return >> def __del__(self): >> pass >> return >> >> class HugeCla

Database Abstraction Layer And/Or ORM

2007-09-23 Thread BJ Dierkes
Hello all, I am looking for opinions on preferred methods of Database Abstraction Layer or Object Relation Mapper (I'm using Python 2.5). I have found a number of options such as those listed here: http://wiki.python.org/moin/HigherLevelDatabaseProgramming I'm not looking for a holy war b

Re: database persistence with mysql, sqlite

2007-09-23 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, coldpizza wrote: > So far, with mysql I use 'SELECT * FROM TABLE LIMIT L1, L2' where L1 > and L2 define the range for the 'Next' and 'Previous' commands. I > have to run the query every time a click a 'Next/Prev' link. But I am > not sure that this is the best and

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-23 Thread Cristian
On Sep 21, 5:21 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Ok, then what about classes ? They also are objects-like-any-other, > after all. So should we have this syntax too ? > > MyClass = class(ParentClass): >__init__ = function (self, name): > self.name = name > > ?-) For co

Re: subprocess -popen - reading stdout from child - hangs

2007-09-23 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Well, using this subclass of subprocess.Popen fixes the problem > (http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554) > > I don't understand how it works though. Would anyone mind > explaining? I'm thinking there's somethin

Re: [Bulk] Re: Writing Object Data to Disk

2007-09-23 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Amit Kumar Saha wrote: > I appreciate the XML related comment, but as of now I am ready-to-roll > with Python specific pickling. XML will be used in a later version of my > code! Will you need to maintain backward compatibility with data written by the current vers

Re: subprocess -popen - reading stdout from child - hangs

2007-09-23 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Let's say I have this Python file called loop.py: > > import sys > print 'hi' > sys.stdout.flush() > while 1: > pass > > And I want to call it from another Python process and read the value > 'hi'. How would I do it? > > So far I h

Re: An Editor that Skips to the End of a Def

2007-09-23 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Manuel Graune wrote: > Matthew Woodcraft <[EMAIL PROTECTED]> writes: > >> Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote:> >> >>> >> > And "cursor keys"? Please, every self respecting editor has ways f

Re: Preemption in python

2007-09-23 Thread Kurtis Heimerl
Thanks a ton! Just for the eventual webcrawler that logs this, the gtk package requires a separate thread init function to allow python threads to play nice. On 9/23/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > En Sun, 23 Sep 2007 16:10:03 -0300, Kurtis Heimerl <[EMAIL PROTECTED]> > escri

Re: Getting rid of bitwise operators in Python 3?

2007-09-23 Thread [david]
[EMAIL PROTECTED] wrote: > On Sep 22, 7:04 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> On Sat, 22 Sep 2007 21:17:38 +, Bryan Olson wrote: >>> The operator module offers pow(). Is there any good reason for >>> pow() as a built-in? >> The `operator.pow()` is just the function for

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-23 Thread Kay Schluehr
On 22 Sep., 02:14, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Kay Schluehr a écrit : > (snip) > > > > > I checked out Io once and I disliked it. I expected Io's prototype OO > > being just a more flexible variant of class based OO but Io couples a > > prototype very closely to its offspring.

Re: TRying to import files from my folder not pythons lib folder

2007-09-23 Thread Luis M . González
Steve Holden wrote: > [EMAIL PROTECTED] wrote: > > On Sep 21, 12:32 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > wrote: > >> Hi, > >> > >> I'm trying to create my own lib of functions, but it seems like I can > >> only import them if they are in pythons lib folder. > >> > >> Example > >> I have

Re: building a GUI

2007-09-23 Thread Grant Edwards
On 2007-09-23, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Sep 23, 4:28 pm, stef mientki <[EMAIL PROTECTED]> wrote: >> yadin wrote: >> > if i were up to make a GUI chich are the advantages of choosing python >> > over matlab or java? >> >> As MatLab has a very lousy GUI, >> any other language

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-23 Thread Ron Adam
Scott David Daniels wrote: > Ron Adam wrote: >> Scott David Daniels wrote: >>> Ron Adam wrote: How about this? def integrate(fn, x1, x2, n=100):... >>> The point was a pedagogic suggestion, ... >> I understood your point. I just found it interesting since I've been >> trying to

Re: __contains__() and overload of in : Bug or Feature ???

2007-09-23 Thread Colin J. Williams
[EMAIL PROTECTED] wrote: > Thanks for your quick response. > >>> I need to overload the operator in and let him >>> return an object ... It seems it is not a >>> behavior Python expect : >>> >> class A: >>> ...def __contains__(self,a): >>> ...return 'yop' >>> ... >> a=A() >

Re: Writing Object Data to Disk

2007-09-23 Thread Colin J. Williams
Amit Kumar Saha wrote: > Actually, language independence is really not a consideration here. I am > happy at having it tied to Python :-) > > BTW, do we have something like array of objects here? In numpy, one can have a multi-dimensional array of objects. It would be good to have this notion

http://www.agloco.com/r/BBFR2592

2007-09-23 Thread kasim
http://kgsm.websitesiekle.com/ Thanks 1. Hi everyone, For all of you that are asking for caculations for how much pay, just consider this. There is truly no way anyone can calculate with all variables. The pay is dependent upon the advertisers paying agloco, the search engines paying agloco,

Re: building a GUI

2007-09-23 Thread David Boddie
On Mon Sep 24 00:08:09 CEST 2007, stef mientki wrote: > Phil Thompson wrote: > > On Sunday 23 September 2007, stef mientki wrote: > > >> Could well be, > >> but I never looked at PyQt seriously, > >> because of their weird license. > > > > It's not weird. It's either GPL or proprietary. Your choic

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-23 Thread Bruno Desthuilliers
Cristian a écrit : > On Sep 21, 4:47 pm, "Sean Tierney" <[EMAIL PROTECTED]> wrote: > >>Just tell him that "functions are like all other variables and can >>therefore be passed by other functions or returned by other functions. >>" >> > > > > > I could """Just tell him that "functions are like

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-23 Thread Bruno Desthuilliers
Kay Schluehr a écrit : > On 22 Sep., 23:17, Erik Max Francis <[EMAIL PROTECTED]> wrote: > > >>The attribute and method (not made distinct in Io; they're called >>"slots") is much the same as with Python; the current instance is >>checked for the object, then its parents, then _its_ parents, and s

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-23 Thread Bruno Desthuilliers
Kay Schluehr a écrit : (snip) > > I checked out Io once and I disliked it. I expected Io's prototype OO > being just a more flexible variant of class based OO but Io couples a > prototype very closely to its offspring. When A produces B and A.f is > modified after production of B also B.f is modif

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-23 Thread Bruno Desthuilliers
Cristian a écrit : (snip) > To me, the biggest setback for new programmers is the different syntax > Python has for creating functions. Instead of the common (and easy to > grasp) syntax of foo = bar It's actually a mostly *un*common syntax when it comes to functions. The only "mainstream" langua

SimPy, audio interview with creators of

2007-09-23 Thread UrsusMaximus
SimpPy is a powerful simulation package for Python. I have just posted an interview (podcast) with Dr. Klaus Muller in Amsterdam and Professor Tony Vignaux in New Zealand about their creation, SimPY, an object-oriented, process-based discrete-event simulation language based on standard Python. Ch

Re: strange behavious of the logging module?

2007-09-23 Thread Gabriel Genellina
En Sun, 23 Sep 2007 18:53:53 -0300, Christian Meesters <[EMAIL PROTECTED]> escribi�: > import logging > logging.basicConfig(level=logging.ERROR, > format='%(levelname)-8s %(message)s', > filename='mc_rigid.log', > filemode='w') > # defi

Re: Properties and Objects...

2007-09-23 Thread Gabriel Genellina
En Sat, 22 Sep 2007 15:06:38 -0300, George V. Neville-Neil <[EMAIL PROTECTED]> escribi�: > I have been trying to switch this over to using properties, which seem > at first glance to be cleaner, but which I am having a lot of problems > with. In particular I want to add a property to an object,

Re: building a GUI

2007-09-23 Thread stef mientki
Phil Thompson wrote: > On Sunday 23 September 2007, stef mientki wrote: > >> Diez B. Roggisch wrote: >> >>> stef mientki schrieb: >>> Thomas Dybdahl Ahle wrote: > Den Sun, 23 Sep 2007 17:28:38 +0200 skrev stef mientki: > >> yadin wrote: >

strange behavious of the logging module?

2007-09-23 Thread Christian Meesters
Hi, having the following code: import logging logging.basicConfig(level=logging.ERROR, format='%(levelname)-8s %(message)s', filename='mc_rigid.log', filemode='w') # define a Handler which writes INFO messages or higher to the sys.stderr

Re: building a GUI

2007-09-23 Thread Phil Thompson
On Sunday 23 September 2007, stef mientki wrote: > Diez B. Roggisch wrote: > > stef mientki schrieb: > >> Thomas Dybdahl Ahle wrote: > >>> Den Sun, 23 Sep 2007 17:28:38 +0200 skrev stef mientki: > yadin wrote: > > if i were up to make a GUI chich are the advantages of choosing > > pyth

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-23 Thread Scott David Daniels
Ron Adam wrote: > Scott David Daniels wrote: >> Ron Adam wrote: >>> How about this? >>> def integrate(fn, x1, x2, n=100):... >> The point was a pedagogic suggestion, ... > I understood your point. I just found it interesting since I've been > trying to extend my math (for use with python) s

Re: Preemption in python

2007-09-23 Thread Gabriel Genellina
En Sun, 23 Sep 2007 16:10:03 -0300, Kurtis Heimerl <[EMAIL PROTECTED]> escribi�: > I'll explain a bit more. This thread is spawned, I also have the main > thread > running a gtk windowed gui. The gui has it's own threads to deal with > button > presses and such. The problem is that the gui n

Re: Small changes in side library

2007-09-23 Thread Gabriel Genellina
En Sat, 22 Sep 2007 22:07:27 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribi�: > I have the side library which provides wide set of different > functions, but I'm going to replace some of them with mine and > provided such 'modified' library thought my project. > > The following way works w

Re: os.popen and lengthy operations

2007-09-23 Thread Tommy Nordgren
On 20 sep 2007, at 08.31, Dmitry Teslenko wrote: > Hello! > I'm using os.popen to perform lengthy operation such as building some > project from source. > It looks like this: > def execute_and_save_output( command, out_file, err_file): > > import os > > def execute_and_save_output( command, out_f

Re: building a GUI

2007-09-23 Thread Kelvie Wong
On 9/23/07, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > stef mientki schrieb: > > Thomas Dybdahl Ahle wrote: > >> Den Sun, 23 Sep 2007 17:28:38 +0200 skrev stef mientki: > >> > >>> yadin wrote: > >>> > >>> > if i were up to make a GUI chich are the advantages of choosing > python > ov

Re: building a GUI

2007-09-23 Thread stef mientki
Diez B. Roggisch wrote: > stef mientki schrieb: > >> Thomas Dybdahl Ahle wrote: >> >>> Den Sun, 23 Sep 2007 17:28:38 +0200 skrev stef mientki: >>> >>> yadin wrote: > if i were up to make a GUI chich are the advantages of choosing python > ov

Re: building a GUI

2007-09-23 Thread Kelvie Wong
On 9/23/07, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > stef mientki schrieb: > > Thomas Dybdahl Ahle wrote: > >> Den Sun, 23 Sep 2007 17:28:38 +0200 skrev stef mientki: > >> > >>> yadin wrote: > >>> > >>> > if i were up to make a GUI chich are the advantages of choosing > python > ov

Latest software downloads!!!!!

2007-09-23 Thread freesoftwareweb
http://freesoftwareupgrades.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Travel around the globe...

2007-09-23 Thread travelingwebs1
http://world-traveling-destinations.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Untrusted python code

2007-09-23 Thread Paul Rubin
Thomas Dybdahl Ahle <[EMAIL PROTECTED]> writes: > Hi, I have an application for which I want users to be able to make > themes. > I've planed a rather advanced model (in xml), which gives themes the > option to redefine various drawing methods. > Now I don't want those themes to be able to take o

Re: database persistence with mysql, sqlite

2007-09-23 Thread Bryan Olson
coldpizza wrote: > I want to run a database query and then display the first 10 records > on a web page. Then I want to be able to click the 'Next' link on the > page to show the next 10 records, and so on. > My question is how to implement paging, i.e. the 'Next/Prev' NN > records without reestab

Re: Preemption in python

2007-09-23 Thread Kurtis Heimerl
I ran a brief program to just test the threading properties of my VM, it seems to be preempting that application. Are there any interesting locks in the gtk package that I might not be playing well with? The reader thread that only runs on a blocking call is at the end of my response. I'll expla

Re: Preemption in python

2007-09-23 Thread Evan Klitzke
On Sat, 2007-09-22 at 19:28 -0700, Kurtis Heimerl wrote: > Hi, I'm developing my first python application, a multi-threaded cell > phone gadget on ubuntu 7.10. I've just split off my first thread, and > I've noticed something extremely strange: There doesn't seem to be any > preemption. There are c

Re: building a GUI

2007-09-23 Thread Diez B. Roggisch
stef mientki schrieb: > Thomas Dybdahl Ahle wrote: >> Den Sun, 23 Sep 2007 17:28:38 +0200 skrev stef mientki: >> >>> yadin wrote: >>> >>> if i were up to make a GUI chich are the advantages of choosing python over matlab or java? >>> The best is Delphi, >>> second i

Re: building a GUI

2007-09-23 Thread stef mientki
Thomas Dybdahl Ahle wrote: > Den Sun, 23 Sep 2007 17:28:38 +0200 skrev stef mientki: > >> yadin wrote: >> >> >>> if i were up to make a GUI chich are the advantages of choosing python >>> over matlab or java? >>> >>> >> The best is Delphi, >> second is VB, >> > > That sounds mos

Untrusted python code

2007-09-23 Thread Thomas Dybdahl Ahle
Hi, I have an application for which I want users to be able to make themes. I've planed a rather advanced model (in xml), which gives themes the option to redefine various drawing methods. Now I don't want those themes to be able to take over the current user, but I'd still like the scripts to b

Re: building a GUI

2007-09-23 Thread Thomas Dybdahl Ahle
Den Sun, 23 Sep 2007 17:28:38 +0200 skrev stef mientki: > yadin wrote: > >> if i were up to make a GUI chich are the advantages of choosing python >> over matlab or java? >> > The best is Delphi, > second is VB, That sounds mostly like a personal preference :) I would certainly suggest Python ver

Re: I could use some help making this Python code run faster using only Python code.

2007-09-23 Thread Matt McCredie
> Yes, Digital Mars D is what I was referring to and yes I know D is not > as efficient as C++. If I knew of a good C++ compiler that is not > from Microsoft that works natively with Windows I would be happy to > consider using it. I've had good luck with MinGW (gcc compiled for windows). http:/

Re: [Bulk] Re: Writing Object Data to Disk

2007-09-23 Thread Amit Kumar Saha
On Sun, 2007-09-23 at 18:34 +0200, David wrote: > > I would like to know if "Pickling" the class object is the only way of > > writing it to disk for persistent storage. Also, do we have a concept > > similar to "array of objects" in Python? The number of objects is only > > known at "run-time". >

Re: An Editor that Skips to the End of a Def

2007-09-23 Thread Manuel Graune
Matthew Woodcraft <[EMAIL PROTECTED]> writes: > Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote:> > >> > > An interesting story. They say they picked a test for the express > purpose of proving that in some circumstances cursor keys ca

Re: Factory function with keyword arguments

2007-09-23 Thread Ron Adam
Steven D'Aprano wrote: > On Sun, 23 Sep 2007 03:55:45 -0500, Ron Adam wrote: > >> Steven D'Aprano wrote: >>> I'm writing a factory function that needs to use keywords in the >>> produced function, not the factory. Here's a toy example: > > [snip] > > Thanks everyone who answered, you've given

Re: Writing Object Data to Disk

2007-09-23 Thread David
> I would like to know if "Pickling" the class object is the only way of > writing it to disk for persistent storage. Also, do we have a concept > similar to "array of objects" in Python? The number of objects is only > known at "run-time". Have a look at YAML. http://freshmeat.net/projects/syck/

Re: building a GUI

2007-09-23 Thread brice . fernandes
On Sep 23, 4:28 pm, stef mientki <[EMAIL PROTECTED]> wrote: > yadin wrote: > > if i were up to make a GUI chich are the advantages of choosing python > > over matlab or java? > > As MatLab has a very lousy GUI, > any other language would be an advantage ;-) > > The best is Delphi, > second is VB, >

Re: annoying stdin/stdout + pipes problem

2007-09-23 Thread Damjan
> I want to create a program that reads input from stdio that can prompt > a user for input while doing so without getting into problems. ... > As you can see I have commented out what I'd like to do but do not > know how to. Can I somehow halt the previous print to stdout (cat > input.txt) - if so

Re: building a GUI

2007-09-23 Thread stef mientki
yadin wrote: > if i were up to make a GUI chich are the advantages of choosing python > over matlab or java? > > As MatLab has a very lousy GUI, any other language would be an advantage ;-) The best is Delphi, second is VB, then comes SciLab, Python, etc I don't know where Java fits in. But as

Re: can I run pythons IDLE from a command line??

2007-09-23 Thread Stargaming
On Sat, 22 Sep 2007 17:53:09 +0200, Thomas Jollans wrote: > On Saturday 22 September 2007, [EMAIL PROTECTED] wrote: >> Hi, >> Is their a version of pythons IDLE that will run in a dos command line? >> The reason is that I would like to be able to run python code >> interactively from my parable by

Re: building a GUI

2007-09-23 Thread Wildemar Wildenburger
yadin wrote: > if i were up to make a GUI chich are the advantages of choosing python > over matlab or java? > This question is WAY to broad to give sane advice. You might want to state your context, objectives and restrictions are. Since you brought up Matlab, I suspect you're going after a sci

Re: Getting rid of bitwise operators in Python 3?

2007-09-23 Thread c d saunter
: arguments and dicts, which are lot more versatile. Another major use, : talking to hardware, is not something oft done in Python either. Are you sure? I've been doing lots of exactly that for 4 years, and I'm not the only one round here... Python makes an excellent language for talking to

building a GUI

2007-09-23 Thread yadin
if i were up to make a GUI chich are the advantages of choosing python over matlab or java? -- http://mail.python.org/mailman/listinfo/python-list

Re: newb: Question regarding custom exception

2007-09-23 Thread Lawrence Oluyede
crybaby <[EMAIL PROTECTED]> wrote: > Why you specify type and name of the exception in your custom > exceptions, It's up to you, if you're interested in the actual exception object you catch it, otherwise not. Take a look at this: -- Law

Re: newb: Question regarding custom exception

2007-09-23 Thread Steven D'Aprano
On Sun, 23 Sep 2007 05:32:28 -0700, crybaby wrote: > Why you specify type and name of the exception in your custom > exceptions, > but not in built in exceptions > except IOError: > print "no file by the name ccy_rates*.txt" > > except MyError, e: > print e.msg Yo

annoying stdin/stdout + pipes problem

2007-09-23 Thread per9000
Hi, I want to create a program that reads input from stdio that can prompt a user for input while doing so without getting into problems. A simplified version of what I want: I have an input file ***>cat input.txt foo bar baz fubar barooba xyxxyt raboof txet black knight And a file that replaces

newb: Question regarding custom exception

2007-09-23 Thread crybaby
Why you specify type and name of the exception in your custom exceptions, but not in built in exceptions except IOError: print "no file by the name ccy_rates*.txt" except MyError, e: print e.msg Also, when you do: try: raise MyError(23) In "try: MyError(23) ", y

Re: An Editor that Skips to the End of a Def

2007-09-23 Thread John J. Lee
Paul Rubin writes: > [EMAIL PROTECTED] (John J. Lee) writes: >> > I think mousing takes more mental work than typing, >> I'm not sure this is a matter for debate, as much as physical >> measurement. > > I don't know of any way to physically measure mental work. fMRI is

Re: Factory function with keyword arguments

2007-09-23 Thread Ben Finney
Steven D'Aprano <[EMAIL PROTECTED]> writes: > A valuable lesson... always measure before guessing whether code > will be slow or not. And after measuring, don't guess then either :-) -- \"Science doesn’t work by vote and it doesn’t work by | `\ authority." —Richard D

Re: Factory function with keyword arguments

2007-09-23 Thread Steven D'Aprano
On Sun, 23 Sep 2007 03:55:45 -0500, Ron Adam wrote: > Steven D'Aprano wrote: >> I'm writing a factory function that needs to use keywords in the >> produced function, not the factory. Here's a toy example: [snip] Thanks everyone who answered, you've given me a lot of good ideas. I've run some t

Naples is burning

2007-09-23 Thread Hidalgo Vel�zquez
Please, dear Mr Bush: we don't have weapons of destruction mass, but bomb my people and save us. Please, dear old friend Vesuvio: wake up and save us. Please, dear Jesus Christ: give us the Big One and save us... http://www.youtube.com/watch?v=eU3fNRcBtQw -- http://mail.python.org/mailman/listinf

directpython question

2007-09-23 Thread veki
Hello, I've got IBM Thinkpad 30 laptop with configuration: IBM Thinkpad R30 P3 Mobile Celeron 900mhz 128mb sdram pc133 15gb hdd cd-rom Teac cd-224e 56K V.90/92 10/100 Ethernet lpt port ps2 port 2 x usb port vga-out pcmcia ,then I have been install directx 9.0c,Python 2.5 and directpython for pyth

Re: Factory function with keyword arguments

2007-09-23 Thread David
On 9/23/07, Ron Adam <[EMAIL PROTECTED]> wrote: > > > Steven D'Aprano wrote: > > I'm writing a factory function that needs to use keywords in the produced > > function, not the factory. Here's a toy example: > http://docs.python.org/whatsnew/pep-309.html -- http://mail.python.org/mailman/listinfo

Re: Factory function with keyword arguments

2007-09-23 Thread Ron Adam
Steven D'Aprano wrote: > I'm writing a factory function that needs to use keywords in the produced > function, not the factory. Here's a toy example: > I thought of doing this: > > def factory(flag): > if flag: kw = 'spam' > else: kw = 'ham' > def foo(obj, arg): > kwargs =

Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-23 Thread Ron Adam
Scott David Daniels wrote: > Ron Adam wrote: >> >> Scott David Daniels wrote: >>> Cristian wrote: On Sep 21, 3:44 pm, Ron Adam <[EMAIL PROTECTED]> wrote: > I think key may be to discuss names and name binding with your friend. >>> Here's an idea: >>> >>> import math >>> >>> def sin_

Re: newb: glob on windows os.renames creates many nested folders

2007-09-23 Thread Peter Otten
crybaby wrote: > when I do this in my python code and run it in windows xp, it creates > ctemp//.../.../../ so on and creates file t. Not file starting > with the name complist and ending with .txt (complist*.txt). Any idea > why this may be? glob only works in *nix not on windows? > > os.r

Re: subprocess -popen - reading stdout from child - hangs

2007-09-23 Thread Karthik Gurusamy
On Sep 22, 8:28 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Let's say I have this Python file called loop.py: > > import sys > print 'hi' > sys.stdout.flush() Add sys.stdout.close() > while 1: > pass > > And I want to call it from another Python process and read the value > 'hi'. Ho