Re: Pythonic way to determine if one char of many in a string

2009-02-18 Thread Steven D'Aprano
On Wed, 18 Feb 2009 07:08:04 +1100, Jervis Whitley wrote: >> This moves the for-loop out of slow Python into fast C and should be >> much, much faster for very large input. >> >> > _Should_ be faster. Yes, Python's timing results are often unintuitive. > Here is my test on an XP system Python

Re: Found a very nice, small, cross-platform GUI toolkit for Python.

2009-02-18 Thread Tim Roberts
laplacia...@gmail.com wrote: > >> For applications installing the full wxWidgets or Qt toolkits would be >> less disk space and dependcies than OceanGUI > >What? Qt and wX are *huge* compared to OcempGUI. Well, not compared to OcempGUI + SDL + PyGame. Note that I'm not trying to run down the prod

urllib confusion

2009-02-18 Thread Tim H
When I attempt to open 2 different pages on the same site I get 2 copies of the first page. ?? ie links = [ 'http://site.org/foo/1/bar', 'http://site.org/foo/2/bar' ] for url in links: print "url:", url f = urlopen(url, params) print "Actual url:", f.geturl()

2 very interesting python projects - Financial industry

2009-02-18 Thread David Russell
Dear Python experts, First of all sorry for the unsolicited email, I have attached two very interesting long term Python projects in the Frankfurt area, Financial industry. I am working exclusively with the client on both requirements, interviews and contracts can be arranged very quick

Directory

2009-02-18 Thread gtillmon
Hello. I am new to the Python language. I would like to know how to display and store the path of each mondule that is called. Similar to the old READY TRACE in COBOL of long ago. Thanks, George -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there something easier than ORM?

2009-02-18 Thread Michele Simionato
On Feb 17, 5:35 pm, Philip Semanchuk wrote: > > I don't intend this as a criticism of SqlAlchemy. On the contrary I am   > impressed by what it does. But I often see people promoting ORM as the   > solution to all database access problems, and I certainly don't feel   > like it is. I am also not

Re: flexible find and replace ?

2009-02-18 Thread OdarR
Thanks to everybody. I need to test your propositions now :) Olivier -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib confusion

2009-02-18 Thread Steven D'Aprano
On Wed, 18 Feb 2009 01:17:40 -0700, Tim H wrote: > When I attempt to open 2 different pages on the same site I get 2 copies > of the first page. ?? ... > Any thoughts? What does your browser do? What does your browser do if you turn off cookies, re-directions and/or referers? -- Steven -- h

Re: numpy.memmap advice?

2009-02-18 Thread Carl Banks
On Feb 17, 3:08 pm, Lionel wrote: > Hello all, > > On a previous thread (http://groups.google.com/group/comp.lang.python/ > browse_thread/thread/64da35b811e8f69d/67fa3185798ddd12? > hl=en&lnk=gst&q=keene#67fa3185798ddd12) I was asking about reading in > binary data. Briefly, my data consists of co

Building python with sqlite3

2009-02-18 Thread Justin Li
I'm building and installing Ptyhon 2.6.1 on Linux. After configure, make, make install, to import sqlite3 leads to ImportError. It looks like I have to build Python with sqlite. I have sqlite3 installed on my system. How should I build Python with it? I did not find any options relating with sqlit

Calling a script requiring user input from another script

2009-02-18 Thread mzagu...@gmail.com
I'm kind of new to this so bear with me. I have a script made that requires user input (lets call it script A) while it's running. However, I would like to create another script (script B) that can batch process (i.e. run script A over and over with different user inputs based on script B). Is t

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

2009-02-18 Thread r
Hello Josh, Blender is a lost cause. It is a powerful app but the UI is horrible. Even the Blender folks admit only a complete rewrite could solve the major flaws that plague the design. So maybe i could salvage some code but for what i have in mind, Blender will look like a piece of software from

PyYaml in standard library?

2009-02-18 Thread Brendan Miller
I'm just curious whether PyYaml is likely to end up in the standard library at some point? -- http://mail.python.org/mailman/listinfo/python-list

Re: Building python with sqlite3

2009-02-18 Thread Christian Heimes
Justin Li schrieb: > I'm building and installing Ptyhon 2.6.1 on Linux. After configure, > make, make install, to import sqlite3 leads to ImportError. It looks > like I have to build Python with sqlite. I have sqlite3 installed on > my system. How should I build Python with it? I did not find any >

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

2009-02-18 Thread r
Yes i want linux, windows, and mac support. I think you are good for a few years though :). Getting something up and working is the easy part. Adding all the features that are required to compete with something the likes of SolidWorks or ACAD takes time. One way or another i am going to build thi

Re: Calling a script requiring user input from another script

2009-02-18 Thread Chris Rebert
On Wed, Feb 18, 2009 at 1:00 AM, mzagu...@gmail.com wrote: > I'm kind of new to this so bear with me. > > I have a script made that requires user input (lets call it script A) > while it's running. However, I would like to create another script > (script B) that can batch process (i.e. run script

Re: Python-list Digest, Vol 65, Issue 365

2009-02-18 Thread M Kumar
I think the given statement below will give you what you r looking .__file__print On Wed, Feb 18, 2009 at 2:43 PM, wrote: > Send Python-list mailing list submissions to >python-list@python.org > > To subscribe or unsubscribe via the World Wide Web, visit >http://mail.python.org/m

Re: PyYaml in standard library?

2009-02-18 Thread Chris Rebert
On Wed, Feb 18, 2009 at 1:11 AM, Brendan Miller wrote: > I'm just curious whether PyYaml is likely to end up in the standard > library at some point? I don't personally have a direct answer to your question, but I can point out that JSON and YAML are mostly compatible (JSON is almost a perfect YA

Re: "Maximum recursion depth exceeded"...why?

2009-02-18 Thread rdmurray
alex23 wrote: > On Feb 18, 11:36=A0am, Paul Rubin wrote: > > Thomas Allen writes: > > > attempting. Basically, I'm transforming a live site to a local one and > > > > Something wrong with wget -R ? > > Did you mean wget -r ? > > That will just grab the entire site

Re: "Maximum recursion depth exceeded"...why?

2009-02-18 Thread alex23
On Feb 18, 7:34 pm, rdmur...@bitdance.com wrote: > Yeah, but wget -r -k will do that bit of it, too. Wow, nice, I don't know why I never noticed that. Cheers! -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there something easier than ORM?

2009-02-18 Thread M.-A. Lemburg
On 2009-02-17 13:27, 一首诗 wrote: > Hi all, > > Recently I am studying some python ORM libraries, such as sqlalchemy. > > These are very powerful technologies to handle database. But I think > my project are not complicated to enough to benefit from a complete > ORM system. > > What I really want

os.popen encoding!

2009-02-18 Thread SMALLp
Hy. I'm playing with os.popen function. a = os.popen("somecmd").read() If one of the lines contains characters like "è", "æ"or any other it loks line this "velja\xe8a 2009" with that "\xe8". It prints fine if i go: for i in a: print i: How to solve this and where exectly is problem with pri

Re: memory recycling/garbage collecting problem

2009-02-18 Thread Tim Wintle
On Tue, 2009-02-17 at 17:04 +0100, Christian Heimes wrote: > Tim Wintle wrote: > > Basically malloc() and free() are computationally expensive, so Python > > tries to call them as little as possible - but it's quite clever at > > knowing what to do - e.g. if a list has already grown large then pyth

Re: os.popen encoding!

2009-02-18 Thread Gabriel Genellina
En Wed, 18 Feb 2009 10:09:24 -0200, SMALLp escribió: Hy. I'm playing with os.popen function. a = os.popen("somecmd").read() If one of the lines contains characters like "è", "æ"or any other it loks line this "velja\xe8a 2009" with that "\xe8". It prints fine if i go: for i in a: print i:

Re: Searching Google?

2009-02-18 Thread Johannes Bauer
Curt Hash schrieb: > You just need to change your User-Agent so that Google doesn't know a > Python script is making the request: Why would Google not send a response if the User-Agent header field is not a recognized browser? I doubt that's what's happening and the OP would just like the conveni

Crypto headaches.

2009-02-18 Thread SamG
Hi, Using the python's Crypto.Cipher.Blowfish is create and encrypted file in the CBC mode. Now... when try to decrypt it with OpenSSL i get an error stating "bad magic number". I tried $ cat encr-file | openssl bf-cbc -d -pass pass:sam > org-file or $ openssl bf-cbc -d -pass pass:sam -in encr-fi

Python/environment problem with char encoding/decoding

2009-02-18 Thread Gabriel Rossetti
Hello everyone, I originally posted this on the Twisted mailing list, but now it seams to be a more general python/environment problem. If I run the attached example in Eclipse, it works, if I run it from a terminal, it doesn't, I get : $ python xml_parser_test.py Traceback (most recent cal

Re: os.popen encoding!

2009-02-18 Thread Hrvoje Niksic
"Gabriel Genellina" writes: >> I'm playing with os.popen function. >> a = os.popen("somecmd").read() >> >> If one of the lines contains characters like "è", "æ"or any other it loks >> line this "velja\xe8a 2009" with that "\xe8". It prints fine if i go: >> >> for i in a: >> print i: > > '\xe8

Re: Crypto headaches.

2009-02-18 Thread M.-A. Lemburg
On 2009-02-18 14:23, SamG wrote: > Hi, > > Using the python's Crypto.Cipher.Blowfish is create and encrypted file > in the CBC mode. Now... when try to decrypt it with OpenSSL i get an > error stating "bad magic number". Are you getting the error message from openssl ? It looks a lot like an erro

Re: Python/environment problem with char encoding/decoding

2009-02-18 Thread Benjamin Kaplan
On Wed, Feb 18, 2009 at 8:43 AM, Gabriel Rossetti < gabriel.rosse...@arimaz.com> wrote: > Hello everyone, > > I originally posted this on the Twisted mailing list, but now it seams to > be a more general python/environment problem. If I run the attached example > in Eclipse, it works, if I run it

Re: Python/environment problem with char encoding/decoding

2009-02-18 Thread Peter Otten
Gabriel Rossetti wrote: > Hello everyone, > > I originally posted this on the Twisted mailing list, but now it seams > to be a more general python/environment problem. If I run the attached > example in Eclipse, it works, if I run it from a terminal, it doesn't, I > get : > > $ python xml_parse

Re: Directory

2009-02-18 Thread Steve Holden
gtillmon wrote: > Hello. I am new to the Python language. > I would like to know how to display and store the path of each mondule > that is called. Modules are imported, not called. > Similar to the old READY TRACE in COBOL of long ago. > It's certainly possible to trace function calls, if tha

Re: Python/environment problem with char encoding/decoding

2009-02-18 Thread Gabriel Rossetti
Peter Otten wrote: Gabriel Rossetti wrote: Hello everyone, I originally posted this on the Twisted mailing list, but now it seams to be a more general python/environment problem. If I run the attached example in Eclipse, it works, if I run it from a terminal, it doesn't, I get : $ python

Re: _socket.so source?

2009-02-18 Thread mbarry
On Feb 17, 6:47 pm, Christian Heimes wrote: > mbarry schrieb: > > > Hello, > > > The socket module in Python uses_socket.so for most of its behavior. > > I want to modify the code that generates the_socket.so file. > > I need the source file and instructions on how tocompileand build > >_socket.so

Re: Python-list Digest, Vol 65, Issue 365

2009-02-18 Thread Steve Holden
M Kumar wrote: > > I think the given statement below will give you what you r looking > .__file__print > [followed by a whole Python list digest] When replying to a question from a digest posting, PLEASE change the subject line and only quote the relevant piece of the original posting. Thank you

Re: Musings: Using decorators to reduce duplicate exception handling

2009-02-18 Thread J Kenneth King
"Gabriel Genellina" writes: > En Tue, 17 Feb 2009 21:12:57 -0200, J Kenneth King > escribió: > >> I recently started a project called TracShell >> (http://code.google.com/p/tracshell) where I make heavy use of the >> xmlrpclib core module. >> >> When the number of RPC calls was small, wrapping

Re: Searching Google?

2009-02-18 Thread Alex
On Feb 18, 1:36 pm, Johannes Bauer wrote: > Curt Hash schrieb: > > > You just need to change your User-Agent so that Google doesn't know a > > Python script is making the request: > > Why would Google not send a response if the User-Agent header field is > not a recognized browser? Because making

Re: Threads in PyGTK: keep typing while ping-ing

2009-02-18 Thread bieffe62
On 17 Feb, 02:53, Mamahita Sela wrote: > Dear FB, > > > As you have been already told, join() blocks until the > > thread is > > terminated. and you should avoid that. > > A simple fix could by add a timeout to t.join, doing > > something like : > >         t.join(JOIN_TIMEOUT); > >         if not

Re: Best practice for upgrading the version of SQLite bundled with Python 2.6.1

2009-02-18 Thread python
Gabriel, > At least on Windows, you only have to replace sqlite3.dll (in the DLLs > directory) with the new one, and that's all. That's easy! :) Thank you, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Crypto headaches.

2009-02-18 Thread SamG
On Feb 18, 7:10 pm, "M.-A. Lemburg" wrote: > On 2009-02-18 14:23, SamG wrote: > > > Hi, > > > Using the python's Crypto.Cipher.Blowfish is create and encrypted file > > in the CBC mode. Now... when try to decrypt it with OpenSSL i get an > > error stating "bad magic number". > > Are you getting th

how to list all installed modules

2009-02-18 Thread harryos
hi Is there a way to list all the installed modules in my python installation.I recently installed pygame and when i tried to import it like >>import pygame it complained that no such module was found.I can see the pygame directory in F:\Python25\Lib\site-packages in my machine,but am unable to imp

Re: how to list all installed modules

2009-02-18 Thread Peter Otten
harryos wrote: > Is there a way to list all the installed modules in my python > installation.I recently installed pygame and when i tried to import it > like >>>import pygame > it complained that no such module was found.I can see the pygame > directory in F:\Python25\Lib\site-packages in my mach

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

2009-02-18 Thread Zamnedix
On Feb 9, 12:58 pm, rantingrick wrote: > 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 matte

Revision Control

2009-02-18 Thread Sam Clark
Any suggestions for a beginer on what to use for version control? It's just me, the lone person programming. I've already nailed one "version" of my code accidentaly. MS VSS is too expensive for the stuff I'm doing, plus I really don't like MS much... Any free open source stuff out there?

Re: how to list all installed modules

2009-02-18 Thread harryos
On Feb 18, 9:42 pm, Peter Otten <__pete...@web.de> wrote: > >>> help("modules") thanks Peter.That helped. > Regarding the original problem, do you have multiple Python installations? > If so, you may accidentally be running the "wrong" python. I have only one installation.It shows all other modul

Re: Revision Control

2009-02-18 Thread Chris Rebert
On Wed, Feb 18, 2009 at 9:08 AM, Sam Clark wrote: > Any suggestions for a beginer on what to use for version control? It's > just me, the lone person programming. I've already nailed one "version" of > my code accidentaly. MS VSS is too expensive for the stuff I'm doing, plus > I really don't

why do I get name not defined error

2009-02-18 Thread zaheer . agadi
Hi, I have the following declared in my class, I am trying tp call a method defined in the same class I am not sure why I am getting name not defined error if options.uploadFile != None : print "This is path", the_rest filePath = the_rest UploadFile(None,filePath) de

Re: why do I get name not defined error

2009-02-18 Thread Diez B. Roggisch
zaheer.ag...@gmail.com schrieb: Hi, I have the following declared in my class, I am trying tp call a method defined in the same class I am not sure why I am getting name not defined error if options.uploadFile != None : print "This is path", the_rest filePath = the_rest

Re: why do I get name not defined error

2009-02-18 Thread Peter Otten
zaheer.ag...@gmail.com wrote: > I have the following declared in my class, I am trying tp call a > method defined in the same class > I am not sure why I am getting name not defined error Assuming this is part of a method def method(self): > if options.uploadFile != None : > print

Re: Revision Control

2009-02-18 Thread Benjamin Kaplan
On Wed, Feb 18, 2009 at 12:08 PM, Sam Clark wrote: > Any suggestions for a beginer on what to use for version control? It's > just me, the lone person programming. I've already nailed one "version" of > my code accidentaly. MS VSS is too expensive for the stuff I'm doing, plus > I really don

Re: how to list all installed modules

2009-02-18 Thread Scott David Daniels
harryos wrote: Is there a way to list all the installed modules in my python installation.I recently installed pygame and when i tried to import it like import pygame it complained that no such module was found.I can see the pygame directory in F:\Python25\Lib\site-packages in my machine,but am

Re: "Maximum recursion depth exceeded"...why?

2009-02-18 Thread Thomas Allen
On Feb 18, 4:51 am, alex23 wrote: > On Feb 18, 7:34 pm, rdmur...@bitdance.com wrote: > > > Yeah, but wget -r -k will do that bit of it, too. > > Wow, nice, I don't know why I never noticed that. Cheers! Hm...doesn't do that over here. I thought it may have been because of absolute links (not to s

Re: Revision Control

2009-02-18 Thread skip
>> Any suggestions for a beginer on what to use for version control? Chris> I like Mercurial (hg) personally... Me too. It's perfect for little one-person things. (It's probably good for other stuff as well, but I certainly like how easy it is to use for standalone stuff.) -- Skip Mo

Re: Revision Control

2009-02-18 Thread Tim Chase
-CVS (One of the first RCS, I think most projects are moving away from this one.) I wouldn't suggest starting a new project with CVS. Subversion (svn) resolves several of the main issues with it, so using SVN instead wins over CVS in just about every possible way. - Subversion-(pretty popu

Re: numpy.memmap advice?

2009-02-18 Thread Lionel
On Feb 18, 12:56 am, Carl Banks wrote: > On Feb 17, 3:08 pm, Lionel wrote: > > > > > > > Hello all, > > > On a previous thread (http://groups.google.com/group/comp.lang.python/ > > browse_thread/thread/64da35b811e8f69d/67fa3185798ddd12? > > hl=en&lnk=gst&q=keene#67fa3185798ddd12) I was asking abo

PIL install driving me mad! With solution!

2009-02-18 Thread bleah
I'm trying to get PIL 1.16 installed on a SUSE SLES10 system, and cannot, for the life of me, get the thing to compile with jpeg support. The libjpeg-devel libraries are installed, and are present in /usr/lib JUST WHERE SPECIFIED in the setup.py file, and the jpeglib.h incliude file is present JU

Re: Pythonic way to determine if one char of many in a string

2009-02-18 Thread Jervis Whitley
> > What happens when you have hundreds of megabytes, I don't know. > > I hope I never have to test a word that is hundreds of megabytes long for a vowel :) -- http://mail.python.org/mailman/listinfo/python-list

PyGTK install

2009-02-18 Thread Lionel
Hello folks, I couldn't find a specific PyGTK forum so I thought I'd post here and hope someone new the answer. I feel it's a silly problem, maybe something to do with a path variable? The problem: I've downloaded the "all-in-one" windows binary installer for PyGTK from their website. After typing

Re: Pythonic way to determine if one char of many in a string

2009-02-18 Thread Steve Holden
Jervis Whitley wrote: >> What happens when you have hundreds of megabytes, I don't know. >> >> > I hope I never have to test a word that is hundreds of megabytes long > for a vowel :) I see you don't speak German ;-) -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC

Re: Pythonic way to determine if one char of many in a string

2009-02-18 Thread Peter Otten
Steven D'Aprano wrote: > On Wed, 18 Feb 2009 07:08:04 +1100, Jervis Whitley wrote: > > >>> This moves the for-loop out of slow Python into fast C and should be >>> much, much faster for very large input. >>> >>> >> _Should_ be faster. > > Yes, Python's timing results are often unintuitive. Ind

number theory libraries / project euler

2009-02-18 Thread eliben
Hello, What are some good & recommended number theory libs for Python (or accessible interfaces to C libs), for things like primes, factorization, etc. Naturally, speed is of utmost importance here. In other words, which Python libraries and tools to you use to help you solve Project Euler proble

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

2009-02-18 Thread Josh Dukes
You might also want to look in to open cascade. It supports a bunch of standard 3d model formats (stl, iges, step) and has python bindings. Salome is based on open cascade. http://www.pythonocc.org/ However, I'm not entirely clear on the license for this so that might be an issue. I know the Debian

Re: Pythonic way to determine if one char of many in a string

2009-02-18 Thread Peter Otten
Steve Holden wrote: > Jervis Whitley wrote: >>> What happens when you have hundreds of megabytes, I don't know. >>> >>> >> I hope I never have to test a word that is hundreds of megabytes long >> for a vowel :) > > I see you don't speak German ;-) I tried to come up with a funny way to point out

Re: number theory libraries / project euler

2009-02-18 Thread Kurt Smith
On Wed, Feb 18, 2009 at 2:18 PM, eliben wrote: > > Hello, > > What are some good & recommended number theory libs for Python (or > accessible interfaces to C libs), for things like primes, > factorization, etc. Naturally, speed is of utmost importance here. > > In other words, which Python librari

Re: number theory libraries / project euler

2009-02-18 Thread andrew cooke
eliben wrote: > Hello, > > What are some good & recommended number theory libs for Python (or > accessible interfaces to C libs), for things like primes, > factorization, etc. Naturally, speed is of utmost importance here. i just read the project site and one of the things they say on their front

Re: numpy.memmap advice?

2009-02-18 Thread Carl Banks
On Feb 18, 10:48 am, Lionel wrote: > Thanks Carl, I like your solution. Am I correct in my understanding > that memory is allocated at the slicing step in your example i.e. when > "reshaped_data" is sliced using "interesting_data = reshaped_data[:, > 50:100]"? In other words, given a huge (say 1Gb

Re: Musings: Using decorators to reduce duplicate exception handling

2009-02-18 Thread Cameron Simpson
On 17Feb2009 15:12, J Kenneth King wrote: | I recently started a project called TracShell | (http://code.google.com/p/tracshell) where I make heavy use of the | xmlrpclib core module. | | When the number of RPC calls was small, wrapping each call in try/except | was acceptable. [...] | To combat

Re: Directory

2009-02-18 Thread Gabriel Genellina
En Wed, 18 Feb 2009 12:15:25 -0200, Steve Holden escribió: gtillmon wrote: I would like to know how to display and store the path of each mondule that is called. It's certainly possible to trace function calls, if that would help. sys.settrace allows you to establish a function that gets ca

Delete lines which contain string in a file

2009-02-18 Thread Rudi Goldman
Hi, Go easy on me as I am a new to Python and am trying to solve a practical problem that is driving me bananas. Basically I have 2 text files, a source and a target. I want to be able to delete all of the lines in the target file which contain text from any line in the source file. i.e. Source:

PyTypeObject subclass

2009-02-18 Thread Aaron Brady
Hi, Is it ok to subclass PyTypeObject, so that my custom 'tp_' fields can appear at the bottom of it? Is there anything like size requirements going on in its code? Or is it better to use 'tp_dict' or slots? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Can't get the IPYthon ipapi object working

2009-02-18 Thread beetlecube
Hi , I found out from a random google search that I could use IPython to automatically import modules so that I could test Django views. I downloaded it (WIN XP), installed it. I'm able to import it, but I just can't seem to get the object working. The code: --- t

Re: Searching Google?

2009-02-18 Thread Tim Wintle
On Wed, 2009-02-18 at 13:36 +0100, Johannes Bauer wrote: > Curt Hash schrieb: > > > You just need to change your User-Agent so that Google doesn't know a > > Python script is making the request: > > Why would Google not send a response if the User-Agent header field is > not a recognized browser?

Re: PyGTK install

2009-02-18 Thread Lionel
On Feb 18, 11:43 am, Lionel wrote: > Hello folks, I couldn't find a specific PyGTK forum so I thought I'd > post here and hope someone new the answer. I feel it's a silly > problem, maybe something to do with a path variable? The problem: I've > downloaded the "all-in-one" windows binary installer

Newbie Q about Turtle Gfx

2009-02-18 Thread Neil
Hello Sorry if this is not an appropriate newsgroup for this problem. I am very new to Python but not new to programming. I am hoping to use Python to teach a class and have been looking at the online book 'Snake Wrangling for Kids'. I have followed the example >>>import turtle >>>t=turtle.pe

Re: Newbie Q about Turtle Gfx

2009-02-18 Thread Neil
Forgot to say, that after the error message the turtle window 'hangs' as unresponsive ... "Neil" wrote in message news:ifidnr_gysdmfqhunz2dnekdnzzin...@bt.com... > Hello > > Sorry if this is not an appropriate newsgroup for this problem. I am very > new to Python but not new to programming. >

Re: Delete lines which contain string in a file

2009-02-18 Thread Steve Holden
Rudi Goldman wrote: > Hi, > Go easy on me as I am a new to Python and am trying to solve a practical > problem that is driving me bananas. > Basically I have 2 text files, a source and a target. I want to be able > to delete all of the lines in the target file which contain text from > any line in

Re: Newbie Q about Turtle Gfx

2009-02-18 Thread sjbrown
It looks like there may be a bug if you were expecting t to be some object other than a dict. You can apparently contact the authour here: http://www.briggs.net.nz/log/contact/ On Feb 18, 2:16 pm, "Neil" wrote: > Hello > > Sorry if this is not an appropriate newsgroup for this problem. I am ver

Re: Directory

2009-02-18 Thread gtillmon
On Feb 18, 3:39 pm, "Gabriel Genellina" wrote: > En Wed, 18 Feb 2009 12:15:25 -0200, Steve Holden   > escribió: > > > gtillmon wrote: > >> I would like to know how to display and store the path of each mondule > >> that is called. > > It's certainly possible to trace function calls, if that would

Re: Directory

2009-02-18 Thread gtillmon
On Feb 18, 8:15 am, Steve Holden wrote: > gtillmon wrote: > > Hello.  I am new to the Python language. > > I would like to know how to display and store the path of each mondule > > that is called. > > Modules are imported, not called. > > > Similar to the old READY TRACE in COBOL of long ago. > >

Re: Revision Control

2009-02-18 Thread Tim Wintle
On Wed, 2009-02-18 at 09:08 -0800, Sam Clark wrote: > Any suggestions for a beginer on what to use for version control? > It's just me, the lone person programming. I've already nailed one > "version" of my code accidentaly. MS VSS is too expensive for the > stuff I'm doing, plus I really don't l

Re: Newbie Q about Turtle Gfx

2009-02-18 Thread Neil
Thanks for the very speedy reply! Not sure what your reply means but I have emailed the author with the problem! Cheers Neil "sjbrown" wrote in message news:9ba48cb7-d32b-40ef-a6a6-d22508863...@l33g2000pri.googlegroups.com... It looks like there may be a bug if you were expecting t to be som

Re: number theory libraries / project euler

2009-02-18 Thread Paul Rubin
eliben writes: > What are some good & recommended number theory libs for Python (or > accessible interfaces to C libs), for things like primes, > factorization, etc. Naturally, speed is of utmost importance here. The idea of Project Euler is you are supposed to find clever enough methods to solve

Re: PyYaml in standard library?

2009-02-18 Thread Brendan Miller
On Wed, Feb 18, 2009 at 1:34 AM, Chris Rebert wrote: > On Wed, Feb 18, 2009 at 1:11 AM, Brendan Miller wrote: >> I'm just curious whether PyYaml is likely to end up in the standard >> library at some point? > > I don't personally have a direct answer to your question, but I can > point out that J

Re: number theory libraries / project euler

2009-02-18 Thread Mensanator
On Feb 18, 2:18 pm, eliben wrote: > Hello, > > What are some good & recommended number theory libs for Python (or > accessible interfaces to C libs), for things like primes, > factorization, etc. Naturally, speed is of utmost importance here. > > In other words, which Python libraries and tools to

SVN/CVS and Branching

2009-02-18 Thread Jeff Dyke
Hello. I am curious about different ideas on how you handle branching your python projects. With some other languages this is trivial, but since python uses these directories as modules and i have the top level module starting imports all over the place, i am wondering what others do. In the pas

get descriptor from instance

2009-02-18 Thread Alan G Isaac
What is a reliable way to get the the property object for an instance attribute? (Or more generally, to get the descriptor controlling an attribute?) If class ``A`` defines the property ``x`` and ``a`` in an instance of ``A``, then you can just use ``type(a).__dict__['x']`` to get the property ob

Re: Newbie Q about Turtle Gfx

2009-02-18 Thread Scott David Daniels
Neil wrote: Forgot to say, that after the error message the turtle window 'hangs' as unresponsive ... "Neil" wrote in message news:ifidnr_gysdmfqhunz2dnekdnzzin...@bt.com... Hello I am hoping to use Python to teach a class and have been looking at the online book 'Snake Wrangling for Kids'.

Re: PyGTK install

2009-02-18 Thread Lionel
On Feb 18, 2:08 pm, Lionel wrote: > On Feb 18, 11:43 am, Lionel wrote: > > > > > > > Hello folks, I couldn't find a specific PyGTK forum so I thought I'd > > post here and hope someone new the answer. I feel it's a silly > > problem, maybe something to do with a path variable? The problem: I've >

fcntl.fcntl breaking on 64bit

2009-02-18 Thread PK
Hello Friends: I'm running into issues with using fcntl on a 64 bit servers. Python version: 2.4.3 system Arch: # uname -m x86_64 code keeps erroring out with: fcntl.fcntl(fd, rhn_fcntl.F_SETLKW, UNLOCK) IOError: [Errno 22] Invalid argument The same python code block runs fine on a i386/686.

Re: Can't get the IPYthon ipapi object working

2009-02-18 Thread Robert Kern
On 2009-02-18 15:49, beetlecube wrote: Hi , I found out from a random google search that I could use IPython to automatically import modules so that I could test Django views. I downloaded it (WIN XP), installed it. I'm able to import it, but I just can't seem to get the object working. The co

Re: PyGTK install

2009-02-18 Thread Lionel
On Feb 18, 3:03 pm, Lionel wrote: > On Feb 18, 2:08 pm, Lionel wrote: > > > > > > > On Feb 18, 11:43 am, Lionel wrote: > > > > Hello folks, I couldn't find a specific PyGTK forum so I thought I'd > > > post here and hope someone new the answer. I feel it's a silly > > > problem, maybe something

Re: get descriptor from instance

2009-02-18 Thread Gabriel Genellina
En Wed, 18 Feb 2009 20:48:17 -0200, Alan G Isaac escribió: What is a reliable way to get the the property object for an instance attribute? (Or more generally, to get the descriptor controlling an attribute?) If class ``A`` defines the property ``x`` and ``a`` in an instance of ``A``, then y

Re: Newbie Q about Turtle Gfx

2009-02-18 Thread Mensanator
On Feb 18, 4:16 pm, "Neil" wrote: > Hello > > Sorry if this is not an appropriate newsgroup for this problem. I am very > new to Python but not new to programming. > > I am hoping to use Python to teach a class and have been looking at the > online book 'Snake Wrangling for Kids'. > > I have follo

Re: numpy.memmap advice?

2009-02-18 Thread sturlamolden
On 18 Feb, 00:08, Lionel wrote: > 1) What is "recarray"? An ndarray of what C programmers know as a "struct", in which each field is accessible by its name. That is, struct rgba{ unsigned char r; unsigned char g; unsigned char b; unsigned char a; }; struct rgba arr[480][640]; is simi

Re: Newbie Q about Turtle Gfx

2009-02-18 Thread Neil
Thanks everyone! It appears the info in the book is wrong. Trying what you have all suggested has got it to work! Many thanks, and I am sure I will be back here again with other newbie problems! Neil "Neil" wrote in message news:ifidnr_gysdmfqhunz2dnekdnzzin...@bt.com... > Hello > > Sorry if

Re: Can't get the IPYthon ipapi object working

2009-02-18 Thread beetlecube
On Feb 18, 3:12 pm, Robert Kern wrote: > On 2009-02-18 15:49, beetlecube wrote: > > > > > Hi , I found out from a random google search that I could use IPython > > to automatically import modules so that I could test Django views. > > > I downloaded it (WIN XP), installed it.  I'm able to import i

Re: Threading and tkinter

2009-02-18 Thread gert
On Feb 18, 8:25 am, "Hendrik van Rooyen" wrote: > "gert" wrote: > > > After reading the docs and seeing a few examples i think this should > > work ? > > Am I forgetting something here or am I doing something stupid ? > > Anyway I see my yellow screen, that has to count for something :) > > > from

Calling a class instance like a function

2009-02-18 Thread Uberman
I'm wondering if there's a way to invoke a "function" operator on a Python class instance. For example, given a class instance: myClass = MyClass() I want to call that instance like a function, with an argument value: myClass(5.0) I can override the "()" operator in C++, so I'm

Re: SVN/CVS and Branching

2009-02-18 Thread andrew cooke
maybe this is just me, but i don't have a clue what your problem is. what does "starting imports all over the place" mean? what do you mean by "retired"? i use svn with python in exactly the same way as with java (and, i thought, in the same way as anyone uses svn with any language; java uses t

Re: Calling a class instance like a function

2009-02-18 Thread Filip Gruszczyński
__call__ 2009/2/19 Uberman : > I'm wondering if there's a way to invoke a "function" operator on a Python > class instance. For example, given a class instance: > >myClass = MyClass() > > I want to call that instance like a function, with an argument value: > >myClass(5.0) > > I c

  1   2   >