SQLObject 0.12.0

2009-10-21 Thread Oleg Broytman
Hello! I'm pleased to announce version 0.12.0, the first stable release of branch 0.12 of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be

Setuptools 0.6c11 released

2009-10-21 Thread P.J. Eby
Oops! - Due to a couple of last-minute issues with the 0.6c10 release, I've released an 0.6c11 update at: http://pypi.python.org/setuptools/ It fixes an error when running the sdist command on a package with no README, and includes the 64-bit Windows fix that was promised in 0.6c10

Re: Frameworks

2009-10-21 Thread Emmanuel Surleau
On Oct 20, 2009, at 4:59 PM, Emmanuel Surleau wrote: Compared to custom tags in, say, Mako? Having to implement a mini- parser for each single tag when you can write a stupid Python function is needless complication. I like Mako a lot and in fact web2py template took some inspiration

Re: help to convert c++ fonction in python

2009-10-21 Thread Paul Rudin
Gary Herron gher...@islandtraining.com writes: geremy condra wrote: And always apply ROT13 twice for extra security. +1 for quote of the week Even if it's at least 30 years old :) -- http://mail.python.org/mailman/listinfo/python-list

Re: a simple unicode question

2009-10-21 Thread Mark Tolonen
George Trojan george.tro...@noaa.gov wrote in message news:hbktk6$8b...@news.nems.noaa.gov... Thanks for all suggestions. It took me a while to find out how to configure my keyboard to be able to type the degree sign. I prefer to stick with pure ASCII if possible. Where are the literals (i.e.

win32com lotus notes: not opened

2009-10-21 Thread Threader Slash
Hi Everybody, Hope someone can point me some direction... I got python linking to lotus notes, under Eclipse IDE. The code is: import pythoncom import pywintypes from win32com.client import Dispatch session=Dispatch(Lotus.NotesSession) session print pythoncom.CreateGuid() try:

mysql select some sort of caching

2009-10-21 Thread Threader Slash
-- Forwarded message -- From: David Sfiligoi sfili...@gmail.com To: python-list@python.org Date: Tue, 20 Oct 2009 21:41:10 -0500 Subject: mysql select some sort of caching Hi I am normally an SQLlite person because it just works... but I decided to keep inproving my skills set and

Re: how to knock a page out of file cache

2009-10-21 Thread Paul Rubin
birdsong david.birds...@gmail.com writes: Does anybody know of a system call that will 'knock' the file out of file cache? Can madvise or fadvise do this? I don't think so. Best I can think of is unmount and remount the file system. And I don't know if even that is guaranteed if you don't

Re: Struct on on x86_64 mac os x

2009-10-21 Thread Mark Tolonen
Tommy Grav tg...@pha.jhu.edu wrote in message news:d705ab12-0bee-495a-b1e5-c43245e40...@pha.jhu.edu... I have created a binary file that saves this struct from some C code: struct recOneData { char label[3][84]; char constName[400][6]; double timeData[3]; long

Re: a simple unicode question

2009-10-21 Thread Scott David Daniels
George Trojan wrote: Scott David Daniels wrote: ... And if you are unsure of the name to use: import unicodedata unicodedata.name(u'\xb0') 'DEGREE SIGN' Thanks for all suggestions. It took me a while to find out how to configure my keyboard to be able to type the degree sign. I prefer

Re: how to knock a page out of file cache

2009-10-21 Thread Ishwor Gurung
[...] I thought of simply opening and writing to the file to dirty it's pages, but there no guarantee that pdflush will have already written the dirty pages to disk -pretty sure it depends on all the dirty ratio and intervals. Does anybody know of a system call that will 'knock' the file out

Re: how to knock a page out of file cache

2009-10-21 Thread Ishwor Gurung
[...] Also, are you looking for sync(2) http://linux.die.net/man/2/sync? Also, maybe mmap.flush([offset, size]) @ http://docs.python.org/library/mmap.html ? Get the file, mmap it and flush it. The docs has more info on flush(...) Afaik, ultimately the kernel will control the writebacks of

Re: help to convert c++ fonction in python

2009-10-21 Thread Processor-Dev1l
On Oct 18, 8:13 am, Toff christophed...@gmail.com wrote: On 18 oct, 02:13, geremy condra debat...@gmail.com wrote: On Sat, Oct 17, 2009 at 7:57 PM, David Robinow drobi...@gmail.com wrote: On Sat, Oct 17, 2009 at 7:48 PM, geremy condra debat...@gmail.com wrote: For the love of baby

Re: Simple audio

2009-10-21 Thread Peter Chant
Simon Forman wrote: Someone else will probably give you better advice, but have you looked at pygame? IIRC they have a pretty simple audio playback api. I'm using pygame for something else. Will it work without the graphics side being used? I suppose trying it is the best plan! Pete --

Re: Checking a Number for Palindromic Behavior

2009-10-21 Thread Lie Ryan
ru...@yahoo.com wrote: 1) It may look like a homework problem to you but it probably isn't. Seehttp://groups.google.com/group/comp.lang.python/msg/8ac6db43b09fdc92 Homework comes in many forms - school driven homework should be treated the same as self driven research, IMO. You're not doing

Re: Struct on on x86_64 mac os x

2009-10-21 Thread Ulrich Eckhardt
Tommy Grav wrote: I have created a binary file that saves this struct from some C code: struct recOneData { char label[3][84]; char constName[400][6]; double timeData[3]; long int numConst; double AU; double EMRAT; long int

md5 strange error

2009-10-21 Thread catalinf...@gmail.com
I have this error , what happen ? Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38) [GCC 4.3.2 20080917 (Red Hat 4.3.2-4)] on linux2 Type help, copyright, credits or license for more information. import md5 pass = md5.new() File stdin, line 1 pass = md5.new() ^ SyntaxError:

Re: Checking a Number for Palindromic Behavior

2009-10-21 Thread rurpy
On 10/20/2009 11:48 AM, Falcolas wrote: On Oct 20, 11:18 am, ru...@yahoo.com wrote: Why *not* answering a question in comp.lang.python because you think it is homework is BAD. I got a little over-hyperbolic above and muddied the waters. More accurately, this should have been, Why insisting

Re: Checking a Number for Palindromic Behavior

2009-10-21 Thread Falcolas
On Oct 20, 11:18 am, ru...@yahoo.com wrote: Why *not* answering a question in comp.lang.python because you think it is homework is BAD. 1) It may look like a homework problem to you but it  probably isn't.  Seehttp://groups.google.com/group/comp.lang.python/msg/8ac6db43b09fdc92 Homework

Re: Struct on on x86_64 mac os x

2009-10-21 Thread Mark Dickinson
On Oct 20, 10:51 pm, Tommy Grav tg...@pha.jhu.edu wrote: I have created a binary file that saves this struct from some C code:    struct recOneData {           char label[3][84];           char constName[400][6];         double timeData[3];       long int numConst;         double AU;      

Text file to XML representation

2009-10-21 Thread kak...@gmail.com
Hello, I would like to make a program that takes a text file with the following representation: outlook = sunny | humidity = 70: yes (2.0) | humidity 70: no (3.0) outlook = overcast: yes (4.0) outlook = rainy | windy = TRUE: no (2.0) | windy = FALSE: yes (3.0) and convert it to xml file

Re: Frameworks

2009-10-21 Thread Bruno Desthuilliers
Emmanuel Surleau a écrit : Emmanuel Surleau a écrit : Django : very strong integration, excellent documentation and support, huge community, really easy to get started with. And possibly a bit more mature and stable... One strong point in favour of Django: it follows Python's philosophy of

Re: md5 strange error

2009-10-21 Thread Super Zyper
On 21 oct, 10:11, catalinf...@gmail.com catalinf...@gmail.com wrote: I have this error , what happen ? Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38) [GCC 4.3.2 20080917 (Red Hat 4.3.2-4)] on linux2 Type help, copyright, credits or license for more information. import md5 pass =

Re: md5 strange error

2009-10-21 Thread Xavier Ho
On Wed, Oct 21, 2009 at 6:11 PM, catalinf...@gmail.com catalinf...@gmail.com wrote: pass = md5.new() File stdin, line 1 pass = md5.new() ^ SyntaxError: invalid syntax pass is a keyword in Python, you can't use it as an identifier. Try password instead. Cheers, Xav --

Re: What is Islam?-1

2009-10-21 Thread omer azazi
On 12 أكتوبر, 05:42, TerryP bigboss1...@gmail.com wrote: On Oct 11, 11:25 pm, omer azazi omariman...@gmail.com wrote: I appologise if I appear _rude_, but this is comp.lang.python -- it is for the discussion of Python and related projects that were created by men and women. A discussion about

Re: Struct on on x86_64 mac os x

2009-10-21 Thread Mark Dickinson
On Oct 21, 9:18 am, Mark Dickinson dicki...@gmail.com wrote: On Oct 20, 10:51 pm, Tommy Grav tg...@pha.jhu.edu wrote:      def read_header(cls):          hdrData = 84s*3          constNData = 6s*400 I'm confused:  why is this not 400s*6 rather than 6s*400? Doesn't constName[400][6] mean

Re: a simple unicode question

2009-10-21 Thread Chris Jones
On Wed, Oct 21, 2009 at 12:20:35AM EDT, Nobody wrote: On Tue, 20 Oct 2009 17:56:21 +, George Trojan wrote: [..] Where are the literals (i.e. u'\N{DEGREE SIGN}') defined? You can get them from the unicodedata module, e.g.: import unicodedata for i in xrange(0x1):

Re: md5 strange error

2009-10-21 Thread Tim Golden
catalinf...@gmail.com wrote: I have this error , what happen ? Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38) [GCC 4.3.2 20080917 (Red Hat 4.3.2-4)] on linux2 Type help, copyright, credits or license for more information. import md5 pass = md5.new() File stdin, line 1 pass = md5.new()

Re: md5 strange error

2009-10-21 Thread Kushal Kumaran
On Wed, Oct 21, 2009 at 1:41 PM, catalinf...@gmail.com catalinf...@gmail.com wrote: I have this error , what happen ? Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38) [GCC 4.3.2 20080917 (Red Hat 4.3.2-4)] on linux2 Type help, copyright, credits or license for more information. import md5

Re: Unicode again ... default codec ...

2009-10-21 Thread Lele Gaifax
Gabriel Genellina gagsl-...@yahoo.com.ar writes: DON'T do that. Really. Changing the default encoding is a horrible, horrible hack and causes a lot of problems. ... More reasons: http://tarekziade.wordpress.com/2008/01/08/syssetdefaultencoding-is-evil/ See also this recent thread in

Re: What is Islam?-1

2009-10-21 Thread Ben Finney
omer azazi omariman...@gmail.com writes: On 12 أكتوبر, 05:42, TerryP bigboss1...@gmail.com wrote: On Oct 11, 11:25 pm, omer azazi omariman...@gmail.com wrote: I appologise if I appear _rude_, but this is comp.lang.python -- it is for the discussion of Python and related projects that

Re: Text file to XML representation

2009-10-21 Thread Bruno Desthuilliers
kak...@gmail.com a écrit : Hello, I would like to make a program that takes a text file with the following representation: outlook = sunny | humidity = 70: yes (2.0) | humidity 70: no (3.0) outlook = overcast: yes (4.0) outlook = rainy | windy = TRUE: no (2.0) | windy = FALSE: yes

Re: a simple unicode question

2009-10-21 Thread Bruno Desthuilliers
beSTEfar a écrit : (snip) When parsing strings, use Regular Expressions. And now you have _two_ problems g For some simple parsing problems, Python's string methods are powerful enough to make REs overkill. And for any complex enough parsing (any recursive construct for example - think XML,

Re: Struct on on x86_64 mac os x

2009-10-21 Thread Dave Angel
Mark Dickinson wrote: On Oct 20, 10:51 pm, Tommy Grav tg...@pha.jhu.edu wrote: I have created a binary file that saves this struct from some C code: struct recOneData { char label[3][84]; char constName[400][6]; double timeData[3]; long int numConst;

Re: odd mmap behavior

2009-10-21 Thread Carl Banks
On Oct 20, 5:03 pm, Brett brettgra...@gmail.com wrote: I'm trying to read and write from /dev/mem on a linux system using the mmap module. When I run this minimal example: --- import os, mmap MAP_MASK = mmap.PAGESIZE - 1 addr = 0x48088024 f = os.open(/dev/mem,

Re: PySide PyQt

2009-10-21 Thread Carl Banks
On Oct 20, 6:45 pm, rm rmcorresp...@gmail.com wrote: On Oct 20, 6:14 pm, Robert Kern robert.k...@gmail.com wrote: On 2009-10-20 16:48 PM, rm wrote: Have you guys heard about PySide: http://www.pyside.org/ It is basically the same as PyQt (Qt bindings for Python), but licensed

Re: SimpleXMLRPCServer clobbering sys.stderr? (2.5.2)

2009-10-21 Thread Brian Quinlan
Do you have some code that we could see that provokes the problem? Cheers, Brian Joseph Turian wrote: I was having a mysterious problem with SimpleXMLRPCServer. (I am using Python 2.5.2) The request handlers were sometimes failing without any error message to the log output. What I discovered

Re: odd mmap behavior

2009-10-21 Thread Brett
On Oct 21, 8:02 am, Carl Banks pavlovevide...@gmail.com wrote: On Oct 20, 5:03 pm, Brett brettgra...@gmail.com wrote: I'm trying to read and write from /dev/mem on a linux system using the mmap module. When I run this minimal example: --- import os, mmap

Optimal Character recognition using python

2009-10-21 Thread pytart
Hello , I have a project to develop a basic character recognition module in python using backpropagation and artificial neural networks. I would be very helpful if u cud give me some helpful links for the project. I am having problems with the implementation part of the project, the

Re: Optimal Character recognition using python

2009-10-21 Thread Diez B. Roggisch
pytart wrote: Hello , I have a project to develop a basic character recognition module in python using backpropagation and artificial neural networks. I would be very helpful if u cud give me some helpful links for the project. I am having problems with the implementation part of the

Re: odd mmap behavior

2009-10-21 Thread Carl Banks
On Oct 21, 6:50 am, Brett brettgra...@gmail.com wrote: I also posted this question to the linux-omap list and received some helpful (and timely) assistance. I'm running this on an ARM (omap 3530, gumstix). Here is the take-home message (from the omap technical reference and reported to me

Re: Simple audio

2009-10-21 Thread AK Eric
Yep, you can run it without any kind of GUI to my knowledge. -- http://mail.python.org/mailman/listinfo/python-list

Re: PySide PyQt

2009-10-21 Thread Robert Kern
On 2009-10-21 07:11 AM, Carl Banks wrote: One thing PySide has going against it is the shared library binaries are a lot larger than PyQT4's, because of its use of boost::python. Not a good thing for something that exists so that it can be put on a mobile device. I believe the consensus

error when using Pmw.BLT

2009-10-21 Thread Yang
I tried to follow the following code demonstrating the use of Pwm.BLT: from Tkinter import * import Pmw master = Tk() g = Pmw.Blt.Graph( master ) I got the following error message after I typed the last line: Traceback (most recent call last): File stdin, line 1, in module File

error when using Pmw.BLT

2009-10-21 Thread Yang Yang
Hello, I tried to follow the following code demonstrating the use of Pmw.BLT: from Tkinter import * import Pmw master = Tk() g = Pmw.Blt.Graph( master ) I got the following error message after I typed the last line: Traceback (most recent call last): File stdin, line 1, in module File

Re: help to convert c++ fonction in python

2009-10-21 Thread geremy condra
On Wed, Oct 21, 2009 at 3:28 AM, Processor-Dev1l processor.de...@gmail.com wrote: On Oct 18, 8:13 am, Toff christophed...@gmail.com wrote: On 18 oct, 02:13, geremy condra debat...@gmail.com wrote: On Sat, Oct 17, 2009 at 7:57 PM, David Robinow drobi...@gmail.com wrote: On Sat, Oct 17,

Re: error when using Pmw.BLT

2009-10-21 Thread Robert Kern
On 2009-10-21 10:50 AM, Yang Yang wrote: Hello, I tried to follow the following code demonstrating the use of Pmw.BLT: from Tkinter import * import Pmw master = Tk() g = Pmw.Blt.Graph( master ) I got the following error message after I typed the last line: Traceback (most recent call

Python Developer role in San Francisco

2009-10-21 Thread Jaime Bott
Hello: Would it be okay to post a San Francisco-based contract Python Developer role on this group list? Here is the link to the URL: http://docs.google.com/View?id=dtc9xms_77hsrm8pc3. Unfortunately since the company is in stealth, I can't give out to much info via email. You can find a bit more

Re: a simple unicode question

2009-10-21 Thread Nobody
On Wed, 21 Oct 2009 05:16:56 -0400, Chris Jones wrote: Where are the literals (i.e. u'\N{DEGREE SIGN}') defined? You can get them from the unicodedata module, e.g.: import unicodedata for i in xrange(0x1): n = unicodedata.name(unichr(i),None) if n is not

Re: Checking a Number for Palindromic Behavior

2009-10-21 Thread rurpy
On 10/21/2009 01:40 AM, Lie Ryan wrote: ru...@yahoo.com wrote: 1) It may look like a homework problem to you but it probably isn't. Seehttp://groups.google.com/group/comp.lang.python/msg/8ac6db43b09fdc92 Homework comes in many forms - school driven homework should be treated the same as

Re: ANN: Testoob 1.15 released

2009-10-21 Thread Jorgen Grahn
On Mon, 2009-10-19, oripel wrote: On Oct 14, 5:59 pm, Jorgen Grahn grahn+n...@snipabacken.se wrote: But this sentence on the home page     The documentation is sadly outdated, but may be     a starting point: made me stop looking.  As far as I can tell, you cannot even find out what's so

Re: error when using Pmw.BLT

2009-10-21 Thread Yang
On Oct 21, 12:13 pm, Robert Kern robert.k...@gmail.com wrote: On 2009-10-21 10:50 AM, Yang Yang wrote: Hello, I tried to follow the following code demonstrating the use of Pmw.BLT:   from Tkinter import *   import Pmw   master = Tk()   g = Pmw.Blt.Graph( master ) I got the

Re: error when using Pmw.BLT

2009-10-21 Thread Robert Kern
On 2009-10-21 12:38 PM, Yang wrote: Here is another question on this. I am running Python 2.6.3 which uses Tcl 8.5. I could not find the BLT binary source for Tcl 8.5. The latest version is for Tcl 8.4. How could I install BLT? For example, can I change the default Tcl version that Python has

Re: Cpython optimization

2009-10-21 Thread Francesco Bochicchio
Il Wed, 21 Oct 2009 10:28:55 -0700, Qrees ha scritto: Hello As my Master's dissertation I chose Cpython optimization. That's why i'd like to ask what are your suggestions what can be optimized. Well, I know that quite a lot. I've downloaded the source code (I plan to work on Cpython 2.6

Windows file paths, again

2009-10-21 Thread Dan Guido
I'm trying to write a few methods that normalize Windows file paths. I've gotten it to work in 99% of the cases, but it seems like my code still chokes on '\x'. I've pasted my code below, can someone help me figure out a better way to write this? This seems overly complicated for such a simple

Re: a simple unicode question

2009-10-21 Thread rurpy
On Oct 21, 4:59 am, Bruno Desthuilliers bruno. 42.desthuilli...@websiteburo.invalid wrote: beSTEfar a écrit : (snip)   When parsing strings, use Regular Expressions. And now you have _two_ problems g For some simple parsing problems, Python's string methods are powerful enough to make REs

Re: best vi / emacs python features

2009-10-21 Thread Hans Georg Schaathun
On Wed, 07 Oct 2009 18:44:03 +0200, Jean-Michel Pichavant jeanmic...@sequans.com wrote: : When opposing vi to emacs, there's is no possibility you get : constructive and objective answer, because basically, what can do with : one, you can also do it with the other. You seem rather

Re: Windows file paths, again

2009-10-21 Thread Diez B. Roggisch
Dan Guido wrote: I'm trying to write a few methods that normalize Windows file paths. I've gotten it to work in 99% of the cases, but it seems like my code still chokes on '\x'. I've pasted my code below, can someone help me figure out a better way to write this? This seems overly complicated

Re: convert pyc (python 2.4) to py

2009-10-21 Thread Peng Yu
On Tue, Oct 20, 2009 at 4:42 PM, Diez B. Roggisch de...@nospam.web.de wrote: Peng Yu schrieb: I have a .pyc file generated by python 2.4. My current python is of version 2.6. I'm wondering how to generate the corresponding .py file from it. http://www.crazy-compilers.com/decompyle/ Is

Re: convert pyc (python 2.4) to py

2009-10-21 Thread Chris Rebert
On Wed, Oct 21, 2009 at 11:35 AM, Peng Yu pengyu...@gmail.com wrote: On Tue, Oct 20, 2009 at 4:42 PM, Diez B. Roggisch de...@nospam.web.de wrote: Peng Yu schrieb: I have a .pyc file generated by python 2.4. My current python is of version 2.6. I'm wondering how to generate the corresponding

equivalent to globals(), locals() for nonlocal variables?

2009-10-21 Thread geremy condra
I decided to play around with nonlocal declarations today, and was somewhat surprised when a call to nonlocals() resulted in 'nonlocals is not defined'. Is there an a standard equivalent to globals() or locals() for variables in outer nested scopes? Geremy Condra --

Re: Windows file paths, again

2009-10-21 Thread Dan Guido
Hi Diez, The source of the string literals is ConfigParser, so I can't just mark them with an 'r'. config = ConfigParser.RawConfigParser() config.read(filename) crazyfilepath = config.get(name, ImagePath) normalfilepath = normalize_path(crazyfilepath) The ultimate origin of the strings is the

Re: a splitting headache

2009-10-21 Thread David C Ullrich
On Tue, 20 Oct 2009 15:22:55 -0700, Mensanator wrote: On Oct 20, 1:51 pm, David C Ullrich dullr...@sprynet.com wrote: On Thu, 15 Oct 2009 18:18:09 -0700, Mensanator wrote: All I wanted to do is split a binary number into two lists, a list of blocks of consecutive ones and another list of

Re: Windows file paths, again

2009-10-21 Thread Anthony Tolle
On Oct 21, 3:20 pm, Dan Guido dgu...@gmail.com wrote: Hi Diez, The source of the string literals is ConfigParser, so I can't just mark them with an 'r'. config = ConfigParser.RawConfigParser() config.read(filename) crazyfilepath = config.get(name, ImagePath) normalfilepath =

Re: Windows file paths, again

2009-10-21 Thread Ethan Furman
Dan Guido wrote: I'm trying to write a few methods that normalize Windows file paths. I've gotten it to work in 99% of the cases, but it seems like my code still chokes on '\x'. I've pasted my code below, can someone help me figure out a better way to write this? This seems overly complicated

Re: Frameworks

2009-10-21 Thread Emmanuel Surleau
Emmanuel Surleau a écrit : Emmanuel Surleau a écrit : Django : very strong integration, excellent documentation and support, huge community, really easy to get started with. And possibly a bit more mature and stable... One strong point in favour of Django: it follows Python's

Re: Windows file paths, again

2009-10-21 Thread Dan Guido
Hi Anthony, Thanks for your reply, but I don't think your tests have any control characters in them. Try again with a \v, a \n, or a \x in your input and I think you'll find it doesn't work as expected. -- Dan Guido On Wed, Oct 21, 2009 at 3:50 PM, Anthony Tolle anthony.to...@gmail.com wrote:

Re: Object Relational Mappers are evil (a meditation)

2009-10-21 Thread Aaron Watters
On Oct 16, 10:35 am, mario ruggier mario.rugg...@gmail.com wrote: On Oct 5, 4:25 pm, Aaron Watters aaron.watt...@gmail.com wrote: Occasionally I fantasize about making a non-trivial change to one of these programs, but I strongly resist going further than that because the ORM meatgrinder

Re: Windows file paths, again

2009-10-21 Thread Dave Angel
Dan Guido wrote: Hi Diez, The source of the string literals is ConfigParser, so I can't just mark them with an 'r'. config =onfigParser.RawConfigParser() config.read(filename) crazyfilepath =onfig.get(name, ImagePath) normalfilepath =ormalize_path(crazyfilepath) The ultimate origin of the

Re: Windows file paths, again

2009-10-21 Thread Lie Ryan
Dan Guido wrote: Hi Anthony, Thanks for your reply, but I don't think your tests have any control characters in them. Try again with a \v, a \n, or a \x in your input and I think you'll find it doesn't work as expected. A path read from a file, config file, or winreg would never contain

Re: Checking a Number for Palindromic Behavior

2009-10-21 Thread Tim Chase
ru...@yahoo.com wrote: On 10/21/2009 01:40 AM, Lie Ryan wrote: ru...@yahoo.com wrote: 1) It may look like a homework problem to you but it probably isn't. Seehttp://groups.google.com/group/comp.lang.python/msg/8ac6db43b09fdc92 Homework comes in many forms - school driven homework should be

Re: Windows file paths, again

2009-10-21 Thread Dan Guido
I'm writing a test case right now, will update in a few minutes :-). I'm using Python 2.6.x I need to read these values in from a configparser file or the windows registry and get MD5 sums of the actual files on the filesystem and copy the files to a new location. The open() method completely

PyQt4 - remember widget positions

2009-10-21 Thread nusch
Is there any simple command which allows me to save position of all windows: QMainWindow, QDialogs and qdockwidgets with their sizes, dock state and positions ? Or do I need to store those values manually, how can I do it fast? -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking a Number for Palindromic Behavior

2009-10-21 Thread Lie Ryan
ru...@yahoo.com wrote: On 10/21/2009 01:40 AM, Lie Ryan wrote: ru...@yahoo.com wrote: 1) It may look like a homework problem to you but it probably isn't. Seehttp://groups.google.com/group/comp.lang.python/msg/8ac6db43b09fdc92 Homework comes in many forms - school driven homework should be

Re: Cpython optimization

2009-10-21 Thread Qrees
If you don't know yet, you could find interesting this project:    http://code.google.com/p/unladen-swallow/ I know about this project. I'll have a look at it, but I'd like to create something of my own. They too are trying to improve CPython speed. If you are thinking of language

Re: Windows file paths, again

2009-10-21 Thread Terry Reedy
Dan Guido wrote: Hi Diez, The source of the string literals is ConfigParser, so I can't just mark them with an 'r'. Python string literals only exist in Python source code. Functions and methods only return *strings*, not literals. If you mistakenly put the str() representation of a string

Re: which dictionary with attribute-style access?

2009-10-21 Thread Andreas Balogh
Gabriel, thanks for your hint. I've managed to create an implementation of an AttrDict passing Gabriels tests. Any more comments about the pythonicness of this implementation? class AttrDict(dict): A dict whose items can also be accessed as member variables. def __init__(self, *args,

Re: a splitting headache

2009-10-21 Thread Mensanator
On Oct 21, 2:46 pm, David C Ullrich dullr...@sprynet.com wrote: On Tue, 20 Oct 2009 15:22:55 -0700, Mensanator wrote: On Oct 20, 1:51 pm, David C Ullrich dullr...@sprynet.com wrote: On Thu, 15 Oct 2009 18:18:09 -0700, Mensanator wrote: All I wanted to do is split a binary number into two

Re: The rap against while True: loops

2009-10-21 Thread Jorgen Grahn
On Wed, 2009-10-14, Steven D'Aprano wrote: ... Setting up a try...except block is cheap in Python. According to my tests, the overhead is little more than that of a single pass statement. But actually raising and catching the exception is not cheap. If you use a lot of exceptions for flow

Re: a simple unicode question

2009-10-21 Thread Terry Reedy
Nobody wrote: Just curious, why did you choose to set the upper boundary at 0x? Characters outside the 16-bit range aren't supported on all builds. They won't be supported on most Windows builds, as Windows uses 16-bit Unicode extensively: Python 2.5.1 (r251:54863, Apr 18 2007,

Re: How to schedule system calls with Python

2009-10-21 Thread Jorgen Grahn
On Thu, 2009-10-15, TerryP wrote: ... launching external programs, irregardless of language, generally falls into 3 major categories: 0.) blocks until program is done; like system 1.) replaces your program with process, never returns; like exec 2.) quickly return after asynchronously

Re: How to schedule system calls with Python

2009-10-21 Thread Jorgen Grahn
On Fri, 2009-10-16, Jeremy wrote: On Oct 15, 6:32 pm, MRAB pyt...@mrabarnett.plus.com wrote: TerryP wrote: On Oct 15, 7:42 pm, Jeremy jlcon...@gmail.com wrote: I need to write a Python script that will call some command line programs (using os.system).  I will have many such calls, but I

Re: Windows file paths, again

2009-10-21 Thread Jerry Hill
On Wed, Oct 21, 2009 at 5:40 PM, Dan Guido dgu...@gmail.com wrote: This doesn't give me quite the results I expected, so I'll have to take a closer look at my project as a whole tomorrow. The test cases clearly show the need for all the fancy parsing I'm doing on the path though. To get back

Re: md5 strange error

2009-10-21 Thread Stephen Fairchild
Tim Golden wrote: catalinf...@gmail.com wrote: I have this error , what happen ? Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38) [GCC 4.3.2 20080917 (Red Hat 4.3.2-4)] on linux2 Type help, copyright, credits or license for more information. import md5 pass = md5.new() File stdin,

Re: md5 strange error

2009-10-21 Thread Rhodri James
On Wed, 21 Oct 2009 23:28:24 +0100, Stephen Fairchild someb...@somewhere.com wrote: Tim Golden wrote: catalinf...@gmail.com wrote: I have this error , what happen ? Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38) [GCC 4.3.2 20080917 (Red Hat 4.3.2-4)] on linux2 Type help, copyright,

Re: Spam reported

2009-10-21 Thread Peter Pearson
On Wed, 21 Oct 2009 09:06:50 +1100, Ben Finney wrote: Grant Edwards inva...@invalid.invalid writes: On 2009-10-20, Peter Pearson ppear...@nowhere.invalid wrote: Reported to Google's groups-abuse. What are these postings supposed to mean? That the posting which started the thread (which

Re: Unicode again ... default codec ...

2009-10-21 Thread Gabriel Genellina
En Wed, 21 Oct 2009 06:24:55 -0300, Lele Gaifax l...@metapensiero.it escribió: Gabriel Genellina gagsl-...@yahoo.com.ar writes: DON'T do that. Really. Changing the default encoding is a horrible, horrible hack and causes a lot of problems. ... More reasons:

Re: How to schedule system calls with Python

2009-10-21 Thread Al Fansome
Jorgen Grahn wrote: On Fri, 2009-10-16, Jeremy wrote: On Oct 15, 6:32 pm, MRAB pyt...@mrabarnett.plus.com wrote: TerryP wrote: On Oct 15, 7:42 pm, Jeremy jlcon...@gmail.com wrote: I need to write a Python script that will call some command line programs (using os.system). I will have many

Re: mysql select some sort of caching

2009-10-21 Thread David Sfiligoi
On Wed, 21 Oct 2009 00:45:21 -0300, Gabriel Genellina wrote: If you want to keep the cursor open, you must commit the (implicit) current transaction, even if it only contains selects (a rollback would work too). Alternatively, lower the transaction isolation level below repeatable reads.

python, emacs, pylint, epylint, flymake

2009-10-21 Thread Richard Riley
I have asked in emacs help too, but basically does anyone here have pylint integrated with emacs so that you can actually read the error description? I am set up as described here:- http://tinyurl.com/yfshb5b or

How to write a facebook client?

2009-10-21 Thread holmes86
Hi,everyone I'm a python newbie,and I want to write a facebook client.But I don't know how to do it.Meanwhile I have any write web experience,so I also don't know how to analyse web page.Any help will be appreciate. -- http://mail.python.org/mailman/listinfo/python-list

Re: PyQt4 - remember widget positions

2009-10-21 Thread TerryP
On Oct 21, 9:04 pm, nusch nusc...@gmail.com wrote: Is there any simple command which allows me to save position of all windows:  QMainWindow, QDialogs and qdockwidgets with their sizes, dock state and positions ? Or do I need to store those values manually, how can I do it fast? Both fast

problems on installing PyGTK in Windows XP

2009-10-21 Thread Yang
Python 2.6.3 is installed on my Windows XP throught the binary file provided by Python.org. Then I followed the steps described here: http://faq.pygtk.org/index.py?req=showfile=faq21.001.htp to install PyGTK. However, I still get the following error: import pygtk pygtk.require('2.0') import

Re: Windows file paths, again

2009-10-21 Thread Dave Angel
Dan Guido wrote: This doesn't give me quite the results I expected, so I'll have to take a closer look at my project as a whole tomorrow. The test cases clearly show the need for all the fancy parsing I'm doing on the path though. Looks like I'll return to this tomorrow and post an update as

Re: How to write a facebook client?

2009-10-21 Thread geremy condra
On Wed, Oct 21, 2009 at 9:45 PM, holmes86 holme...@gmail.com wrote: Hi,everyone I'm a python newbie,and I want to write a facebook client.But I don't know how to do it.Meanwhile I have any write web experience,so I also don't know how to analyse web page.Any help will be appreciate. --

Re: Fallen Sword

2009-10-21 Thread Ben Finney
Richard Riley rileyrg...@gmail.com writes: Ben Finney ben+pyt...@benfinney.id.au writes: Reported to service provider as spam. Please don't reply to SPAM. You just make it visible to those of us with better filters. Hint : spammers do not read your reply. I didn't quote the spam except to

Re: Fallen Sword

2009-10-21 Thread Paul Huber
On Thu, 22 Oct 2009 14:00:03 +1100, Ben Finney ben+pyt...@benfinney.id.au wrote: Ben Finney ben+pyt...@benfinney.id.au writes: Reported to service provider as spam. Please don't reply to SPAM. You just make it visible to those of us with better filters. Hint : spammers do not read your

subprocess executing shell

2009-10-21 Thread Tim Arnold
Hi, I'm writing a script to capture a command on the commandline and run it on a remote server. I guess I don't understand subprocess because the code below exec's the user's .cshrc file even though by default shell=False in the Popen call. Here's the code. I put a line in my .cshrc file: echo

Re: Cpython optimization

2009-10-21 Thread John Nagle
Qrees wrote: Hello As my Master's dissertation I chose Cpython optimization. That's why i'd like to ask what are your suggestions what can be optimized. Well, I know that quite a lot. I've downloaded the source code (I plan to work on Cpython 2.6 and I've downloaded 2.6.3 release). By looking

Re: mysql select some sort of caching

2009-10-21 Thread Gabriel Genellina
En Wed, 21 Oct 2009 22:24:49 -0300, David Sfiligoi sfili...@gmail.com escribió: On Wed, 21 Oct 2009 00:45:21 -0300, Gabriel Genellina wrote: If you want to keep the cursor open, you must commit the (implicit) current transaction, even if it only contains selects (a rollback would work too).

  1   2   >