Re: Variable + String Format

2009-02-09 Thread Joel Ross
Joel Ross wrote: Hi all, I have this piece of code: # wordList = "/tmp/Wordlist" file = open(wordList, 'r+b') def readLines(): for line in file.read(): if not line: break print line + '.co

Re: Python binaries with VC++ 8.0?

2009-02-09 Thread Paul Rubin
In case anyone is interested: Gideon Smeding of the University of Utrecht has written a masters' thesis titled "An executable operational semantics for Python". It is actually a formal semantics for a Python subset called minpy. Per the blurb, the semantics are described in literate Haskell that

Re: can multi-core improve single funciton?

2009-02-09 Thread Paul McGuire
On Feb 10, 12:43 am, Chris Rebert wrote: > Considering the GIL, I highly doubt it so. Also, the algorithm is > fundamentally linear -- each result depends on previous results -- so > I don't think you can easily parallelize it (if at all). You'd > probably get greater speedup using memoization. >

Re: AJAX Post requests

2009-02-09 Thread Tim Roberts
PJ wrote: > >I have a simple web server using BaseHTTPServer, and the def do_POST >(self) function works fine for regular forms that are submitted to it, >but when I send an AJAX POST to it it does nothing (I've tried to just >get it to print to check it's nothing else but it doesn't even do >tha

Problem with Tkinter's scale function.

2009-02-09 Thread Nicholas Feinberg
Not the widget, the function in Canvas. So far as I can tell, integer values for scale work fine; you can scale something to a factor of 2, 3, 17, etc. Float values for scale - such as you might use if you were, say, trying to scale a rectangle to half its current size - also work, insofar as the t

Re: can multi-core improve single funciton?

2009-02-09 Thread Steven D'Aprano
On Tue, 10 Feb 2009 14:28:15 +0800, oyster wrote: > I mean this > [code] > def fib(n): > if n<=1: > return 1 > return fib(n-1)+fib(n-2) > > useCore(1) > timeit(fib(500)) #this show 20 seconds > > useCore(2) > timeit(fib(500)) #this show 10 seconds [/code] > > Is it possible? Wh

Re: Python binaries with VC++ 8.0?

2009-02-09 Thread Tim Roberts
Carl Banks wrote: > >I'm pretty sure 2.6.1 is compiled with 8.0. However, I think the >Visual C++ 8.0 uses msvcrt90.dll. No, the two digits of the DLL match the version number of C++. The confusion arises because the product is called "Visual Studio 2008", but it includes Visual C++ 9.0, and he

Re: What's wrong with my python? I can't use string

2009-02-09 Thread Frank Potter
On Feb 10, 3:20 pm, Chris Rebert wrote: > On Mon, Feb 9, 2009 at 11:13 PM, Frank Potter wrote: > > I have a xxx.py which has code as below: > > > import string > > > print dir(string) > > print string.printable > > > when I run it, I got the strange error: > > > "\n" > > "\n" > > "##result##\n" >

Re: What's wrong with my python? I can't use string

2009-02-09 Thread Chris Rebert
On Mon, Feb 9, 2009 at 11:13 PM, Frank Potter wrote: > I have a xxx.py which has code as below: > > import string > > print dir(string) > print string.printable > > > when I run it, I got the strange error: > > "\n" > "\n" > "##result##\n" > "##msg##\n" > "##pass_no##\n" > "##pot_num##\n" > "##pot

What's wrong with my python? I can't use string

2009-02-09 Thread Frank Potter
I have a xxx.py which has code as below: import string print dir(string) print string.printable when I run it, I got the strange error: "\n" "\n" "##result##\n" "##msg##\n" "##pass_no##\n" "##pot_num##\n" "##pots_mashed##\n" "##yb_used##\n" "##right##\n" "\n" ['__builtins__', '__doc__', '__fil

Re: wxPython vs Glade?

2009-02-09 Thread Hendrik van Rooyen
"Steve Holden" wrote: > There's something called PythonCard built on top of wxPython that's > fairly newb-friendly, though it gets clunkier as your demands grow. > > You might also want to look at Dabo, which is a much more comprehensive > framework that also hides much of wxPython's complexity.

Re: select error 10093 on winxp

2009-02-09 Thread Gabriel Genellina
En Tue, 10 Feb 2009 04:11:31 -0200, Ken escribió: I was testing select on windows xp with python 2.6.1, the code is simple: See the note in the documentation of module select: http://docs.python.org/library/select.html#select.select "Note: File objects on Windows are not acceptable, but sock

Re: 'Import sys' succeeds in C++ embedded code, but module is not fully visible

2009-02-09 Thread greg
Ben Sizer wrote: Yes, this seems to fix it, thanks. But why? Can some Python guru explain why these two dictionaries must be the same? (Or what steps we must take if we want them to be separate?) What's happening is that the import statement is binding the name 'sys' in the locals, not the glob

Re: can multi-core improve single funciton?

2009-02-09 Thread Chris Rebert
On Mon, Feb 9, 2009 at 10:28 PM, oyster wrote: > I mean this > [code] > def fib(n): >if n<=1: >return 1 >return fib(n-1)+fib(n-2) > > useCore(1) > timeit(fib(500)) #this show 20 seconds > > useCore(2) > timeit(fib(500)) #this show 10 seconds > [/code] > > Is it possible? > > and mo

can multi-core improve single funciton?

2009-02-09 Thread oyster
I mean this [code] def fib(n): if n<=1: return 1 return fib(n-1)+fib(n-2) useCore(1) timeit(fib(500)) #this show 20 seconds useCore(2) timeit(fib(500)) #this show 10 seconds [/code] Is it possible? and more, can threads/multi-processors/clusters be used to improve fib? thanx --

select error 10093 on winxp

2009-02-09 Thread Ken
I was testing select on windows xp with python 2.6.1, the code is simple: import sys import select def testSelect(): r = select.select([sys.stdin], [], [], 5.0) print r if __name__ == "__main__": try: testSelect() except select.error, e: print e While an error ra

Re: generator object or 'send' method?

2009-02-09 Thread Steven D'Aprano
On Tue, 10 Feb 2009 05:28:26 +, John O'Hagan wrote: > On Mon, 9 Feb 2009, Aaron Brady wrote: >> Hello, >> >> I am writing a generator to return a sequence of numbers with some >> variation. The parameters of the variation can be changed by the >> caller, even after the generator is started. >

Re: "Super()" confusion

2009-02-09 Thread Michele Simionato
On Feb 10, 4:29 am, "Gabriel Genellina" > AFAIK, all facts appearing in said article are still true (except for 3.x   > which uses a shorter form). If super usage had been clearly documented in   > the first place, this had not happened. > Perhaps you could point us to some resource explaining how

Re: generator object or 'send' method?

2009-02-09 Thread John O'Hagan
On Mon, 9 Feb 2009, Aaron Brady wrote: > Hello, > > I am writing a generator to return a sequence of numbers with some > variation. The parameters of the variation can be changed by the > caller, even after the generator is started. [...] I would love to see a simple code example of this if you

Re: adodb has no attribute connect

2009-02-09 Thread Rahul
On Feb 10, 5:01 am, "Diez B. Roggisch" wrote: > Rahul schrieb: > > > Hello all, > > > I have to access data from database usingadodbso I did > > > Importadodb > > Conn=adodb.NewADOConnection("odbc") > > > Upto this it works properly but when I say > > It does not. It returns None, thus the followi

Re: Small socket problem

2009-02-09 Thread John O'Hagan
On Mon, 9 Feb 2009, Gabriel Genellina wrote: > En Mon, 09 Feb 2009 07:43:36 -0200, John O'Hagan > > escribió: > > I'm using the socket module (python 2.5) like this (where 'options' > > refers to > > an optparse object) to connect to the Fluidsynth program: > > > > host = "localhost" >

Re: Best 3d graphics kit for CAD program???

2009-02-09 Thread r
OpenCascade looks promising. I had look at this before a while back and forgot about it. For now i am taking the OpenGL plunge and I will see where that takes me...? Thanks Duane -- http://mail.python.org/mailman/listinfo/python-list

Re: Scanning a file character by character

2009-02-09 Thread Steven D'Aprano
On Mon, 09 Feb 2009 19:10:28 -0800, Spacebar265 wrote: > How would I do separate lines into words without scanning one character > at a time? Scan a line at a time, then split each line into words. for line in open('myfile.txt'): words = line.split() should work for a particularly simple-

Re: "Super()" confusion

2009-02-09 Thread Steven D'Aprano
On Mon, 09 Feb 2009 17:34:05 -0800, Daniel Fetchinson wrote: ... Consider whether you really need to use super(). http://fuhm.net/super-harmful/ >>> >>>Did you actually read that article, understood it, went through the >>>tons of responses from python-dev team members, including Gu

Python Launcher.app on OS X

2009-02-09 Thread kpp9c
I am very confused about the current state of Python on OS X 10.5. Looks like Apple ships with 2.5.1 and that is also the latest installer for OS 10.5. The notes on the wiki page found here: http://wiki.python.org/moin/MacPython/Leopard Say: Mac OS X 10.5.x (Leopard) comes with the 2.5.1 Python

Re: "Super()" confusion

2009-02-09 Thread Gabriel Genellina
En Mon, 09 Feb 2009 23:34:05 -0200, Daniel Fetchinson escribió: Hello. I've been scouring the web looking for something to clear up a little confusion about the use of "super()" but haven't found anything that really helps. Here's my simple example: [snip] "super(Child,self).__init__(fil

Re: Scanning a file character by character

2009-02-09 Thread Spacebar265
On Feb 9, 5:13 pm, Steve Holden wrote: > Spacebar265 wrote: > > On Feb 7, 2:17 am, Jorgen Grahn wrote: > >> On Wed, 4 Feb 2009 22:48:13 -0800 (PST), Spacebar265 > >> wrote: > >>> Hi. Does anyone know how to scan a filecharacterbycharacterand > >>> have eachcharacterso I can put it into a variab

python-list

2009-02-09 Thread Daniel Zhou
python-list -- http://mail.python.org/mailman/listinfo/python-list

Re: "Super()" confusion

2009-02-09 Thread Benjamin Peterson
Jean-Paul Calderone divmod.com> writes: > Consider whether you really need to use super(). > > http://fuhm.net/super-harmful/ This article chiefly deals with super()'s harm in multiple inteheritance situations. For the simple case, though, like that presented by the OP, I believe super() is perf

Re: "Super()" confusion

2009-02-09 Thread Jean-Paul Calderone
On Mon, 9 Feb 2009 17:34:05 -0800, Daniel Fetchinson wrote: Hello. I've been scouring the web looking for something to clear up a little confusion about the use of "super()" but haven't found anything that really helps. Here's my simple example: [snip] "super(Child,self).__init__(filePath) Ty

Re: how to find out vesion of a python module

2009-02-09 Thread Atishay
> > There is no standard way.  However many module authors do include soch > information, usually in an attribute named version or __version__, or > VERSION.  PIL uses the VERSION > > import Image > print Image.VERSION Thank you very much. This works > > > Secondly, I get error if I say "import

ANN: SuPy 1.0 for Windows

2009-02-09 Thread Greg Ewing
SuPy 1.0 - Windows -- I have created a Windows binary of SuPy. http://www.cosc.canterbury.ac.nz/greg.ewing/SuPy/ Currently only Python 2.3 is supported. (I'm working on a Python 2.5 version, but there are problems.) It has only been tested with Sketchup 7, although there's a

Re: wsdl2py/ZSI and complex types with arrays

2009-02-09 Thread Cameron Simpson
On 04Feb2009 15:55, eviljonny wrote: | I have been trying to write a web service using ZSI with wsdl2py. I have | read 'The Zolera Soap Infrastructure User’s Guide Release 2.0.0' and some | older guides (a guide by Nortel called Using ZSI with wsdl2py) and am | unable to find any working exampl

Re: "Super()" confusion

2009-02-09 Thread Daniel Fetchinson
Hello. I've been scouring the web looking for something to clear up a little confusion about the use of "super()" but haven't found anything that really helps. Here's my simple example: [snip] "super(Child,self).__init__(filePath) TypeError: super() argument 1 mus

PyCon 2009: Call for sprint projects

2009-02-09 Thread Jacob Kaplan-Moss
Python-related projects: join the PyCon Development Sprints! The development sprints are a key part of PyCon, a chance for the contributors to open-source projects to get together face-to-face for up to four days of intensive learning and development. Newbies sit at the same table as the gurus, go

Re: "Super()" confusion

2009-02-09 Thread Jean-Paul Calderone
On Mon, 9 Feb 2009 17:19:41 -0800, Daniel Fetchinson wrote: Hello. I've been scouring the web looking for something to clear up a little confusion about the use of "super()" but haven't found anything that really helps. Here's my simple example: [snip] "super(Child,self).__init__(filePath) Ty

Re: "Super()" confusion

2009-02-09 Thread Daniel Fetchinson
>>Hello. I've been scouring the web looking for something to clear up a >>little confusion about the use of "super()" but haven't found anything >>that really helps. Here's my simple example: >> >> [snip] >> >>"super(Child,self).__init__(filePath) >>TypeError: super() argument 1 must be type, not c

Re: how to find out vesion of a python module

2009-02-09 Thread Gary Herron
Atishay wrote: > I have Python Image Library installed. I do not know how to find out > its version. How can I do that? > There is no standard way. However many module authors do include soch information, usually in an attribute named version or __version__, or VERSION. PIL uses the VERSION

AJAX Post requests

2009-02-09 Thread PJ
Hi, I have a simple web server using BaseHTTPServer, and the def do_POST (self) function works fine for regular forms that are submitted to it, but when I send an AJAX POST to it it does nothing (I've tried to just get it to print to check it's nothing else but it doesn't even do that, although it

Re: Simple question - stock market simulation

2009-02-09 Thread cptn.spoon
On Feb 10, 10:26 am, Robert Kern wrote: > On 2009-02-09 17:10, cptn.spoon wrote: > > > > > On Feb 9, 6:48 pm, "Hendrik van Rooyen"  wrote: > >> "cptn.spoon"  wrote: > > >> On Feb 9, 3:58 pm, Paul Rubin  wrote: > > >>> Thanks Paul! I thought this might be the case. So

how to find out vesion of a python module

2009-02-09 Thread Atishay
I have Python Image Library installed. I do not know how to find out its version. How can I do that? Secondly, I get error if I say "import ImageFont" ImportError: The _imaging C module is not installed I have _imaging module though [bash]# file PIL/_imaging.so PIL/_imaging.so: ELF 32-bit LSB

Re: "Super()" confusion

2009-02-09 Thread Jean-Paul Calderone
On Mon, 9 Feb 2009 16:18:34 -0800 (PST), Lionel wrote: On Feb 9, 4:04 pm, Jean-Paul Calderone wrote: On Mon, 9 Feb 2009 15:20:05 -0800 (PST), Lionel wrote: >Hello. I've been scouring the web looking for something to clear up a >little confusion about the use of "super()" but haven't found any

Re: "Super()" confusion

2009-02-09 Thread Chris Rebert
On Mon, Feb 9, 2009 at 4:18 PM, Lionel wrote: > On Feb 9, 4:04 pm, Jean-Paul Calderone wrote: >> On Mon, 9 Feb 2009 15:20:05 -0800 (PST), Lionel >> wrote: >> >Hello. I've been scouring the web looking for something to clear up a >> >little confusion about the use of "super()" but haven't found

Re: "Super()" confusion

2009-02-09 Thread Lionel
On Feb 9, 4:04 pm, Jean-Paul Calderone wrote: > On Mon, 9 Feb 2009 15:20:05 -0800 (PST), Lionel > wrote: > >Hello. I've been scouring the web looking for something to clear up a > >little confusion about the use of "super()" but haven't found anything > >that really helps. Here's my simple examp

Re: wxPython vs Glade?

2009-02-09 Thread Michael Torrie
Michael Pobega wrote: > I'm looking for opinions on the best toolkit for a beginner to use with > wxPython. It doesn't necessarily need to be the most efficient toolkit, > but something I can use for basic programs (a Twitter client, Wordpress > blogging client, etc) just to learn Python. > > wxWi

Re: adodb has no attribute connect

2009-02-09 Thread Diez B. Roggisch
Rahul schrieb: Hello all, I have to access data from database using adodb so I did Import adodb Conn=adodb.NewADOConnection("odbc") Upto this it works properly but when I say It does not. It returns None, thus the following error you see. Conn.Connect("","","") It gives error as [Attribu

Re: "Super()" confusion

2009-02-09 Thread Jean-Paul Calderone
On Mon, 9 Feb 2009 15:20:05 -0800 (PST), Lionel wrote: Hello. I've been scouring the web looking for something to clear up a little confusion about the use of "super()" but haven't found anything that really helps. Here's my simple example: [snip] "super(Child,self).__init__(filePath) TypeErro

Re: "Super()" confusion

2009-02-09 Thread Scott David Daniels
Lionel wrote: Hello. I've been scouring the web looking for something to clear up a little confusion about the use of "super()" but haven't found anything that really helps. Here's my simple example: class Parent: def __init__(self, filePath):... class Child(Parent): def __init__(sel

Re: "Super()" confusion

2009-02-09 Thread Robert Kern
On 2009-02-09 17:20, Lionel wrote: Hello. I've been scouring the web looking for something to clear up a little confusion about the use of "super()" but haven't found anything that really helps. Here's my simple example: class Parent: def __init__(self, filePath): . .

Re: Simple question - stock market simulation

2009-02-09 Thread Robert Kern
On 2009-02-09 17:10, cptn.spoon wrote: On Feb 9, 6:48 pm, "Hendrik van Rooyen" wrote: "cptn.spoon" wrote: On Feb 9, 3:58 pm, Paul Rubin wrote: Thanks Paul! I thought this might be the case. So how would I get the StockMarket class instance to contain many Stoc

"Super()" confusion

2009-02-09 Thread Lionel
Hello. I've been scouring the web looking for something to clear up a little confusion about the use of "super()" but haven't found anything that really helps. Here's my simple example: class Parent: def __init__(self, filePath): . . Do some processing with "filePath"

Re: Simple question - stock market simulation

2009-02-09 Thread cptn.spoon
On Feb 9, 6:48 pm, "Hendrik van Rooyen" wrote: > "cptn.spoon" wrote: > > On Feb 9, 3:58 pm, Paul Rubin wrote: > > >Thanks Paul! I thought this might be the case. So how would I get the > >StockMarket class instance to contain many Stock class instances and > >then b

Re: Simple question - stock market simulation

2009-02-09 Thread cptn.spoon
On Feb 10, 3:29 am, Anthra Norell wrote: > cptn.spoon wrote: > > I'm trying to create an incredibly simple stock market simulator to be > > used in a childrens classroom and I'm wondering whether someone can > > point me in the right direction. > > > I basically want to be able to have a stock str

Re: Best 3d graphics kit for CAD program???

2009-02-09 Thread TheSeeker
On Feb 9, 2:08 pm, r wrote: > On Feb 9, 1:33 pm, Stef Mientki wrote: > > > Maya ? > > Blender ? > > I forgot: > > pySoy > > Intensity > > Thanks Stef, > I actually got OpenGL to install(finally) and now i am thinking ? > maybe? i should just go with OpenGL using the wxglcanvas. I have been > also

Re: Putting asterisks around text

2009-02-09 Thread Martin
Hi, 2009/2/9 todp...@hotmail.com : > I'm trying to write a program that puts asterisks around the input text > using while loop. > I can do this without using while loop, but how can you do that using while > loop? > > Example: > > Enter a string: Hello world > > ** > *Hello world* > *

Re: problem with import path on a python C extension

2009-02-09 Thread Carsten Haese
fredbasset1...@gmail.com wrote: > I can only get it to work if I copy the .so file to the directory > where daemon.py is and change the import to "import diomodule". And to supplement my previous reply, another solution is to make sure that /root/project/drivers/dio is in your PYTHONPATH. Then you

Re: problem with import path on a python C extension

2009-02-09 Thread Carsten Haese
fredbasset1...@gmail.com wrote: > [...] > So my question is why can't Python locate the new extension module > when I try to import it with "import project.drivers.dio.diomodule"? This import statement binds the module to the name "project.drivers.dio.diomodule". It does not bind anything to the na

Python 3D CAD -- need collaborators, or just brave souls :)

2009-02-09 Thread rantingrick
Hello all, It has long been my dream to create an open source 3D CAD program and i am starting to crawl my way into the first steps. I now believe i am ready to start this endeavor and i am currently looking for fellow Python programmers (no matter what skill level) to get started brainstorming th

Re: Calling into Python from a C thread

2009-02-09 Thread Christian Heimes
Philip Semanchuk wrote: > Yes, that's accurate except for the word "forgot". To forget something > one must first know it. =) I found the threading API documentation > difficult to follow, but I suppose that what I'm doing is a little > unusual so if it is not well-documented territory, that's what

problem with import path on a python C extension

2009-02-09 Thread fredbasset1000
Hi All, I've written a simple Python extension module in C, but Python is having problems trying to locate it when I import it into an existing Python file. In my example, I wrote a C extension called "diomodule" which exists in the directory : /root/project/drivers/dio/ diomodule.c. It has comp

compound regex

2009-02-09 Thread spir
Hello, (new here) Below an extension to standard module re. The point is to allow writing and testing sub-expressions individually, then nest them into a super-expression. More or less like using a parser generator -- but keeping regex grammar and power. I used the format {sub_expr_name}: as i

Re: Calling into Python from a C thread

2009-02-09 Thread Philip Semanchuk
On Feb 9, 2009, at 2:35 PM, Christian Heimes wrote: Philip Semanchuk wrote: I didn't know there *was* such a thing. Thanks for the tip! For those who might be interested, the list is here: http://mail.python.org/mailman/listinfo/capi-sig FYI, I got my code working and it is in the latest rel

Re: Best 3d graphics kit for CAD program???

2009-02-09 Thread r
On Feb 9, 1:33 pm, Stef Mientki wrote: > Maya ? > Blender ? > I forgot: > pySoy > Intensity Thanks Stef, I actually got OpenGL to install(finally) and now i am thinking ? maybe? i should just go with OpenGL using the wxglcanvas. I have been also "messing" around with Bender but i think i want a

Re: generator object or 'send' method?

2009-02-09 Thread andrew cooke
If I were experimenting with Python to see just how far I could push coroutines at the moment, I would use .send() and look at how I could factor things into a small library (containing, for example, your trap-and-response secondary generator). But if this was paid work, I would write a class wit

Re: thread. question

2009-02-09 Thread Christian Heimes
Tim Wintle schrieb: > Thanks for both replies, > > On Mon, 2009-02-09 at 15:59 +0100, Christian Heimes wrote: >> You shouldn't use the thread module directly. It's not meant to be used >> by a user. Please stick to the threading module. You won't notice a >> slowdown, trust me :) > I'm aware that

Re: version in setup.cfg

2009-02-09 Thread Diez B. Roggisch
Jasiu schrieb: Hi guys, I have a question about setup.py and setup.cfg: I work in a company and we use Subversion to keep our stuff. We have a post-commit rule that does the following: whenever there is a commit to /tags/ directory, a binary package is built automatically. The tag's name is the

Re: py2exe and distutils

2009-02-09 Thread Maxim Demenko
Gabriel Genellina schrieb: En Sat, 07 Feb 2009 18:39:19 -0200, Thomas Heller escribió: Maxim Demenko schrieb: Hi, i have installed Python 2.5.4 on WinXP, setuptools-0.6c9 and py2exe 0.6.9 Now i can't list installed modules, here is the stacktrace: [...] Any suggestion, how to fix this is

Re: wxPython vs Glade?

2009-02-09 Thread Mike Driscoll
On Feb 9, 7:23 am, Michael Pobega wrote: > I'm looking for opinions on the best toolkit for a beginner to use with > wxPython. It doesn't necessarily need to be the most efficient toolkit, > but something I can use for basic programs (a Twitter client, Wordpress > blogging client, etc) just to lea

Re: Calling into Python from a C thread

2009-02-09 Thread Christian Heimes
Philip Semanchuk wrote: > I didn't know there *was* such a thing. Thanks for the tip! For those > who might be interested, the list is here: > http://mail.python.org/mailman/listinfo/capi-sig > > > FYI, I got my code working and it is in the latest release of posix_ipc: > http://semanchuk.com/phi

Re: Best 3d graphics kit for CAD program???

2009-02-09 Thread Stef Mientki
Gary Herron wrote: rantingrick wrote: I want to build a 3D CAD visualization program with Python. Now before you say this is not possible with Python here me out :) I know OpenGL is probably my best bet BUT i want something a little higher level than that. I am not ready for OpenGL yet. I woul

Re: Best 3d graphics kit for CAD program???

2009-02-09 Thread Stef Mientki
Gary Herron wrote: rantingrick wrote: I want to build a 3D CAD visualization program with Python. Now before you say this is not possible with Python here me out :) I know OpenGL is probably my best bet BUT i want something a little higher level than that. I am not ready for OpenGL yet. I woul

Re: wxPython vs Glade?

2009-02-09 Thread Stef Mientki
Michael Pobega wrote: I'm looking for opinions on the best toolkit for a beginner to use with wxPython. It doesn't necessarily need to be the most efficient toolkit, but something I can use for basic programs (a Twitter client, Wordpress blogging client, etc) just to learn Python. wxWidgets seem

Re: generator object or 'send' method?

2009-02-09 Thread Terry Reedy
Aaron Brady wrote: Hello, I am writing a generator to return a sequence of numbers with some variation. The parameters of the variation can be changed by the caller, even after the generator is started. My question is, is it better to wrap the generator in an object, so that the parameters can

Re: Putting asterisks around text

2009-02-09 Thread Tim Chase
D'Arcy J.M. Cain wrote: On Mon, 9 Feb 2009 10:09:26 -0800 "todp...@hotmail.com" wrote: I'm trying to write a program that puts asterisks around the input text using while loop. I can do this without using while loop, but how can you do that using while loop? Example:Enter a string: Hello world*

Re: Putting asterisks around text

2009-02-09 Thread Tim Rowe
2009/2/9 todp...@hotmail.com : > I'm not necessarily asking for an answer. A hint would be grateful as well. Great. Well, first you need to read: http://www.catb.org/~esr/faqs/smart-questions.html Especially the section on "Before you ask". Then you should be able to give us a question that sho

RE: Putting asterisks around text

2009-02-09 Thread todp...@hotmail.com
From: todp...@hotmail.comto: python-l...@python.orgsubject: Putting asterisks around textDate: Mon, 9 Feb 2009 10:09:26 -0800 I'm trying to write a program that puts asterisks around the input text using while loop.I can do this without using while loop, but how can you do that using while l

Re: Help needed to retrieve text from a text-file using RegEx

2009-02-09 Thread Paul McGuire
On Feb 9, 11:22 am, Oltmans wrote: > Here is the scenario: > > It's a command line program. I ask user for a input string. Based on > that input string I retrieve text from a text file. My text file looks > like following > > Text-file: > - > AbcManager=C:\source\code\Modules\Code-AbcM

Help needed to retrieve text from a text-file using RegEx

2009-02-09 Thread rdmurray
Oltmans wrote: > Here is the scenario: > > It's a command line program. I ask user for a input string. Based on > that input string I retrieve text from a text file. My text file looks > like following > > Text-file: > - > AbcManager=C:\source\code\Modules\Code-AbcManager\ > AbcTest=

Re: Putting asterisks around text

2009-02-09 Thread MRAB
D'Arcy J.M. Cain wrote: On Mon, 9 Feb 2009 10:09:26 -0800 "todp...@hotmail.com" wrote: I'm trying to write a program that puts asterisks around the input text using while loop. I can do this without using while loop, but how can you do that using while loop?Example:Enter a string: Hello world

Re: Putting asterisks around text

2009-02-09 Thread D'Arcy J.M. Cain
On Mon, 9 Feb 2009 10:09:26 -0800 "todp...@hotmail.com" wrote: > I'm trying to write a program that puts asterisks around the input text using > while loop. > I can do this without using while loop, but how can you do that using while > loop?Example:Enter a string: Hello world***Hello wo

Re: Help needed to retrieve text from a text-file using RegEx

2009-02-09 Thread Bruno Desthuilliers
Oltmans a écrit : Here is the scenario: It's a command line program. I ask user for a input string. Based on that input string I retrieve text from a text file. My text file looks like following Text-file: - AbcManager=C:\source\code\Modules\Code-AbcManager\ AbcTest=C:\source\code\M

Putting asterisks around text

2009-02-09 Thread todp...@hotmail.com
I'm trying to write a program that puts asterisks around the input text using while loop. I can do this without using while loop, but how can you do that using while loop?Example:Enter a string: Hello world***Hello world***

generator object or 'send' method?

2009-02-09 Thread Aaron Brady
Hello, I am writing a generator to return a sequence of numbers with some variation. The parameters of the variation can be changed by the caller, even after the generator is started. My question is, is it better to wrap the generator in an object, so that the parameters can be changed just by a

Re: Help needed to retrieve text from a text-file using RegEx

2009-02-09 Thread Chris Rebert
On Mon, Feb 9, 2009 at 9:22 AM, Oltmans wrote: > Here is the scenario: > > It's a command line program. I ask user for a input string. Based on > that input string I retrieve text from a text file. My text file looks > like following > > Text-file: > - > AbcManager=C:\source\code\Modul

How to use buildout with a scripts directory?

2009-02-09 Thread Jon
Hello, I am trying to use buildout and am having trouble to figure out how to get it to install the scripts that come with a package. They are present inside the egg which is installed by buildout, but they don't end up in the bin directory. After running buildout my bin directory is empty, but I

Re: wxPython vs Glade?

2009-02-09 Thread Bruno Desthuilliers
Michael Pobega a écrit : I'm looking for opinions on the best toolkit for a beginner to use with wxPython. wxPython *is* a GUI toolkit (or, more exactly, a python binding for wxWidgets). wxWidgets seems nice because it's portable, but I'm not sure how many of my libraries are portable (a l

Re: Calling into Python from a C thread

2009-02-09 Thread Philip Semanchuk
On Feb 9, 2009, at 12:02 PM, Aahz wrote: [posted & e-mailed] In article , Philip Semanchuk wrote: I'm trying call Python from inside of a C thread that's running in a Python extension I've written and I am not having much luck. My C thread function consists of simply this, and I get a segm

Re: global name 'sqrt' is not defined

2009-02-09 Thread Rob
> Any ideas? If I do something like "import math" in the subfunction, > then the error changes to "global name 'math' is not defined". Presumably ipython does an import so you need to import it yourself something like: from math import sqrt at the top of your source file. I don't know why mat

Help needed to retrieve text from a text-file using RegEx

2009-02-09 Thread Oltmans
Here is the scenario: It's a command line program. I ask user for a input string. Based on that input string I retrieve text from a text file. My text file looks like following Text-file: - AbcManager=C:\source\code\Modules\Code-AbcManager\ AbcTest=C:\source\code\Modules\Code-AbcTest\

Re: Threading / Queue management

2009-02-09 Thread Aahz
In article , Power Button wrote: > >I wonder if anyone can help with the following. I have written a >script which polls a server and if it finds and pending orders, it >instantiates an new object (foo) - in a new thread and processes some >data. In the new object (foo), there are also some long

Re: Flattening lists

2009-02-09 Thread ptn
On Feb 5, 2:07 pm, rdmur...@bitdance.com wrote: > Quoth J Kenneth King : > > > > > mk writes: > > > > Hello everybody, > > > > Any better solution than this? > > > > def flatten(x): > > >     res = [] > > >     for el in x: > > >         if isinstance(el,list): > > >             res.extend(flatten

GAE read binary file into db.BlobProperty()

2009-02-09 Thread alex goretoy
How to read Binary file into GAE(Google App Engine) db.BlobProperty() datastore? -Alex Goretoy http://www.goretoy.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling into Python from a C thread

2009-02-09 Thread Aahz
[posted & e-mailed] In article , Philip Semanchuk wrote: > >I'm trying call Python from inside of a C thread that's running in a >Python extension I've written and I am not having much luck. My C >thread function consists of simply this, and I get a segmentation >fault from Python: Becaus

Re: programming by evolution?

2009-02-09 Thread Xah Lee
Xah Lee wrote: > ... > if you want software engineering books, i suggest try some books that > are based on statistical survey, as opposed to some dignitary's > “opinion” or current fashion & trends that comes with a jargon. These > type of books are a dime a dozen, every year, they come and go. Th

Re: Simple question - stock market simulation

2009-02-09 Thread Anthra Norell
cptn.spoon wrote: I'm trying to create an incredibly simple stock market simulator to be used in a childrens classroom and I'm wondering whether someone can point me in the right direction. I basically want to be able to have a stock struct as follows: StockName = "Test" StockPriceList = (12,13

Re: easy_install

2009-02-09 Thread hall . jeff
I had it downloaded and sitting in the root c:\ but didn't get it to run because I didn't think about the \scripts folder not being in the Path. Problem solved and fixed. Thank you all for your help. On a side note, "easy_install MySQL-python" produced the following messages: Searching for MySQL-p

Re: Local python web server problem

2009-02-09 Thread Rob
> I run the cherrypy hello world! example and when I visit > 127.0.0.1:8080 > on firefox, a nice "Hello World" appears. I am on ubuntu and my ip in > local network is 192.168.100.18 > but when I visit 192.168.100.18, there is another page: "It Works!". > What is "It Works!"? and when I type 192.168

Network packets processor advice

2009-02-09 Thread Krzysztof Retel
Hi, I am wrting a network packet processor. The processor listens on a specific port for incomming UDP or TCP packets. When the packet arrives it has to parse it, store in DB and if this succeed it has to acknowledge the packet to the client. Now the problem is that I want to have a control over p

Re: cannot install

2009-02-09 Thread Benjamin Kaplan
On Mon, Feb 9, 2009 at 9:05 AM, Vladimír Župka wrote: > I have Mac OS X Leopard 10.5.6 and I downloaded and unpacked Python 3.0 > into a folder (/Library/Frameworks/Python.framework) and ran commands: > > cd /Library/Frameworks/Python.framework/Python-3.0 > python setup.py install > > and got the

Re: thread. question

2009-02-09 Thread Jean-Paul Calderone
On Mon, 09 Feb 2009 15:34:02 +, Tim Wintle wrote: Thanks for both replies, On Mon, 2009-02-09 at 15:59 +0100, Christian Heimes wrote: You shouldn't use the thread module directly. It's not meant to be used by a user. Please stick to the threading module. You won't notice a slowdown, trust

  1   2   >