Re: Problem with variables assigned to variables???

2008-04-29 Thread Lutz Horn
Hi, 2008/4/30 <[EMAIL PROTECTED]>: > mylist = ('name1', 'name2', 'name3') > > I also assigned variables for each SQL expression: > name1 = "\"field_a\" LIKE '021'" > name2 = "\"field_a\" LIKE '031'" > name3 = "\"field_a\" LIKE '041'" > my intended output is: > name1.shp "field_a LIKE '021

Re: sed to python: replace Q

2008-04-29 Thread Lutz Horn
Hi, 2008/4/30 Raymond <[EMAIL PROTECTED]>: > For some reason I'm unable to grok Python's string.replace() function. replace() does not work with regular expressions. > Is there a decent description of string.replace() somewhere? Use re.sub(). >>> import re >>> line = "date process text [ip] m

Re: simple chemistry in python

2008-04-29 Thread Noel O'Boyle
2008/4/30 Astan Chee <[EMAIL PROTECTED]>: > > Wow, that is the jackpot. > Is that color node supposed to be the actual color of the element? or just > representation? Representation. There are certain de facto standards, such as blue for nitrogen and so on. Google "CPK colors" for the origin of

Re: computing with characters

2008-04-29 Thread Lutz Horn
Hi, 2008/4/30 Gary Herron <[EMAIL PROTECTED]>: > SL wrote: > > How can I compute with the integer values of characters in python? > > Like 'a' + 1 equals 'b' etc > > You can get an integer value from a character with the ord() function. So just for completion, the solution is: >>> chr(ord('a')

Re: computing with characters

2008-04-29 Thread Gary Herron
SL wrote: How can I compute with the integer values of characters in python? Like 'a' + 1 equals 'b' etc -- http://mail.python.org/mailman/listinfo/python-list You can get an integer value from a character with the ord() function. Gary Herron -- http://mail.python.org/mailman/listinfo/python-

Re: File IO Issues, help :(

2008-04-29 Thread Tim Roberts
Kevin K <[EMAIL PROTECTED]> wrote: >On Apr 29, 12:38 am, "Eric Wertman" <[EMAIL PROTECTED]> wrote: >> chuck in a jsfile.close(). The buffer isn't flushing with what you >> are doing now. jsfile.flush() might work... not sure. Closing and >> re-opening the file for sure will help though. >> > >Y

computing with characters

2008-04-29 Thread SL
How can I compute with the integer values of characters in python? Like 'a' + 1 equals 'b' etc -- http://mail.python.org/mailman/listinfo/python-list

sed to python: replace Q

2008-04-29 Thread Raymond
For some reason I'm unable to grok Python's string.replace() function. Just trying to parse a simple IP address, wrapped in square brackets, from Postfix logs. In sed this is straightforward given: line = "date process text [ip] more text" sed -e 's/^.*\[//' -e 's/].*$//' yet the following Pyt

Problem with variables assigned to variables???

2008-04-29 Thread grepla
I have a simple line of code that requires the following inputs - an input file, output file and a SQL expression. the code needs to be run with several different SQL expressions to produce multiple output files. To do this I first created a list of a portion of the output filename: mylist = ('na

Re: timeout

2008-04-29 Thread Bill
maehhheeyy wrote, On 4/29/2008 6:02 PM: Hi, I was just wondering if there was such thing as a timeout module. Take a look at the Timer class, which is a subclass of the Thread class. Here's a link to the official Python documentation: http://www.python.org/doc/2.3.5/lib/timer-objects.htm

ffmpeg hangs when executed from python

2008-04-29 Thread Andrew English
I have tried a few methods of executing ffmpeg from within python and it has hanged every time. Two of the configurations I tried are: def convertFileToFlash(filename): commandString = "./convertasftoswf.sh " + getSaveDirectory() + " " + filename logging.debug("RUNNING: " + commandString)

Re: Python's doc problems: sort

2008-04-29 Thread George Sakkis
On Apr 29, 11:13 pm, Jürgen Exner <[EMAIL PROTECTED]> wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > Is this self-promoting maniac still going at it? > > >Although i disliked Perl very much [...] > > Then why on earth do you bother polluting this NG? > > Back into the killfile you g

Re: swig -python can't find _xxx.dll for windows

2008-04-29 Thread Dongpyo Hong
Well, after several hours' googling I just found that Python for Windows only allow .pyd instead of .dll. When I just renamed .dll to .pyd, it just worked fine. But I don't still get the reason why. Anyone can explain this? --Dongpyo On Apr 30, 2008, at 12:00 PM, Dongpyo Hong wrote: Dear all,

Re: Python's doc problems: sort

2008-04-29 Thread J�rgen Exner
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: Is this self-promoting maniac still going at it? >Although i disliked Perl very much [...] Then why on earth do you bother polluting this NG? Back into the killfile you go jue -- http://mail.python.org/mailman/listinfo/python-list

QA-Test Jobs at Cisco-IronPort

2008-04-29 Thread [EMAIL PROTECTED]
Cisco-IronPort is looking for a topnotch Quality Assurance/ Test Engineers with experience in one or more of the following: aPython, utomation framework, performance testing, email encryption, FreeBSD, white.gray box testing, API testing, web security appliances, UNIX, RAID, LDAP, SSH, DNS, SMTP, H

QA-Test Jobs at Cisco-IronPort

2008-04-29 Thread [EMAIL PROTECTED]
Cisco-IronPort is looking for a topnotch Quality Assurance/ Test Engineers with experience in one or more of the following: aPython, utomation framework, performance testing, email encryption, FreeBSD, white.gray box testing, API testing, web security appliances, UNIX, RAID, LDAP, SSH, DNS, SMTP, H

xml.dom.minidom weirdness: bug?

2008-04-29 Thread JYA
Hi. I was writing an xmltv parser using python when I faced some weirdness that I couldn't explain. What I'm doing, is read an xml file, create another dom object and copy the element from one to the other. At no time do I ever modify the original dom object, yet it gets modified. Unless I

Re: ]ANN[ Vellum 0.16: Lots Of Documentation and Watching

2008-04-29 Thread Ben Finney
"Zed A. Shaw" <[EMAIL PROTECTED]> writes: > Just putting out an announcement that I've released a new version of > Vellum numbered 0.16. When announcing new versions of Foo software, please always include (near the top) a "What is Foo?" or "About Foo" section, so that people know what you're talk

Re: ssh

2008-04-29 Thread Eric Wertman
I don't know about the best way.. I use this function, it works ok for me. I have an ssh key stashed already for my user ID, but you could look at the ssh options and supply one on the command line if you needed to. from popen2 import Popen3 def ssh(host,command) : ''' Wraps ssh commands '''

Cheap Cabinets - Why You Don't Have To Sacrifice Quality To Find Cabinets At A Discount Price

2008-04-29 Thread kitchen . kabinets
Kitchen Cabinets: http://the-kitchen-cabinets.blogspot.com, With the demand for cheaper building materials and the rapid housing boom a couple of years back, many kitchen cabinet manufacturers started looking overseas for a way to make a cheaper kitchen cabinet. In order to conform to the KCMA sta

Re: MatplotLib errors

2008-04-29 Thread Andrew Lee
Thomas Philips wrote: I have just started using MatPlotLib, and use it to generate graphs from Python simulations. It often happens that the graph is generated and a Visual C++ Runtime Library error then pops up: Runtime Error! Program C:\Pythin25\Pythonw.exe This application has requested the

ssh

2008-04-29 Thread gert
Is this the best way to use ssh ? How can i use ssh keys instead of passwords ? I dont understand what happens when pid does not equal 0 , where does the cmd get executed when pid is not 0 ? How do you close the connection ? # http://mail.python.org/pipermail/python-list/2002-July/155390.html impo

Re: how to convert a multiline string to an anonymous function?

2008-04-29 Thread Matimus
On Apr 29, 3:39 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Danny Shevitz schrieb: > > > > > Simple question here: > > > I have a multiline string representing the body of a function. I have > > control > > over the string, so I can use either of the following: > > > str = ''' > > print st

Re: list.reverse()

2008-04-29 Thread Roy Smith
In article <[EMAIL PROTECTED]>, blaine <[EMAIL PROTECTED]> wrote: > Check out this cool little trick I recently learned: > >>> x=range(5) > >>> x.reverse() or x > [4, 3, 2, 1, 0] > > Useful for returning lists that you need to sort or reverse without > wasting that precious extra line :) > >

Re: Simple unicode-safe version of str(exception)?

2008-04-29 Thread Jim
I often struggle with the problem outlined in part in this thread. I know that I'm going to repeat some of what is said elsewhere but I'd like to present the question all in one place. I believe that the routines in the Python standard library do not document which exceptions they could raise (I

Re: simple chemistry in python

2008-04-29 Thread Astan Chee
Wow, that is the jackpot. Is that color node supposed to be the actual color of the element? or just representation? Thanks again Astan baoilleach wrote: If you are familiar with parsing XML, much of the data you need is stored in the following file: http://bodr.svn.sourceforge.net/viewvc/*che

best way to host a membership site

2008-04-29 Thread Magdoll
Hi, I know this is potentially off-topic, but because python is the language I'm most comfortable with and I've previously had experiences with plone, I'd as much advice as possible on this. I want to host a site where people can register to become a user. They should be able to maintain the

Re: python command mis-interprets arrow keys

2008-04-29 Thread Rahul
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in news:67pq47F2plmb8U1 @mid.uni-berlin.de: > > The question is if python is build with readline support. Did the python > version work before, and somehow got messed up, or did you build it > yourself and it never actually worked? I suspect we upg

Code/test ratio wrt static vs dynamic typing [was: Re: Python Success stories]

2008-04-29 Thread George Sakkis
On Apr 29, 2:25 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > There are around 30 000 lines of Python in the production code and > about 120 000 lines of Python code in the test framework. A rather off-topic and perhaps naive question, but isn't a 1:4 production/test ratio a bit too much ? Is there a

swig -python can't find _xxx.dll for windows

2008-04-29 Thread Dongpyo Hong
Dear all, I wrapped c++ code with swig, and made _xxx.dll file. But, when I import xxx.py file from Python interpreter: import xxx it keeps saying that "ImportError: No module named _xxx" I checked sys.path and PATH environment. Why is that? Any explanation? --Dongpyo = Dongpyo Hong Researc

Re: Sending Cntrl-C ??

2008-04-29 Thread Christian Heimes
gamename schrieb: > Thanks, Christian. Would that work on win32 as well? No, Windows doesn't support the same, rich set of signal as Unix OSes. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: python command mis-interprets arrow keys

2008-04-29 Thread Diez B. Roggisch
Rahul schrieb: "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: Is libreadline installed? Thanks for your help Diez. I did a locate and found: /usr/lib/libreadline.a /usr/lib/libreadline.so /usr/lib/libreadline.so.5 /usr/lib/libreadline.so.5.1 /usr/local/src/Python-2.

Re: python command mis-interprets arrow keys

2008-04-29 Thread Rahul
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > Is libreadline installed? Thanks for your help Diez. I did a locate and found: /usr/lib/libreadline.a /usr/lib/libreadline.so /usr/lib/libreadline.so.5 /usr/lib/libreadline.so.5.1 /usr/local/src/Python-2.4.4/Doc/lib/li

Re: API's and hardware communication. Newbie

2008-04-29 Thread Diez B. Roggisch
Grayham schrieb: It seems to me that python needs to be extended with C in some form to able to do what i need. I think instead of learning two languages i am going to put all my efforts in to learning C as it seems that's where i am going to end up. It's your decision of course. But you will e

Re: python command mis-interprets arrow keys

2008-04-29 Thread Diez B. Roggisch
Rahul schrieb: My python command line seems messed up. I can't seem to be able to use my backspace key nor my arrow keys. I only get control characters: ^[[A^[[D^[[D^[[D^[[C^[[C^[[C etc. I access my Linux box via a SecureCRT console. Only after opening the python interpreter does this occur

Re: timeout

2008-04-29 Thread Diez B. Roggisch
maehhheeyy schrieb: Hi, I was just wondering if there was such thing as a timeout module. time.sleep? Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: how to convert a multiline string to an anonymous function?

2008-04-29 Thread Diez B. Roggisch
Danny Shevitz schrieb: Simple question here: I have a multiline string representing the body of a function. I have control over the string, so I can use either of the following: str = ''' print state return True ''' str = ''' def f(state): print state return True ''' and I want to convert

how to convert a multiline string to an anonymous function?

2008-04-29 Thread Danny Shevitz
Simple question here: I have a multiline string representing the body of a function. I have control over the string, so I can use either of the following: str = ''' print state return True ''' str = ''' def f(state): print state return True ''' and I want to convert this into the function:

Re: i want to add a timeout to my code

2008-04-29 Thread John Krukoff
On Tue, 2008-04-29 at 14:47 -0700, maehhheeyy wrote: > On Apr 17, 4:24 pm, Miki <[EMAIL PROTECTED]> wrote: > > On Apr 17, 1:10 pm,maehhheeyy<[EMAIL PROTECTED]> wrote: > > > > > I want to add a timeout so that when I pull out my gps from my serial > > > port, it would wait for a bit then loop and t

Re: Simple import question about mac osx

2008-04-29 Thread ivan
On Apr 29, 3:47 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > When you run your code in pythonwin, it's just like calling 'python -i > chap2.py'  It runs the code in chap2.py, then gives you an interpreter > window to interact with your code.  In this case, that means that > FooClass is visible wit

Re: So you think PythonCard is old? Here's new wine in an old bottle.

2008-04-29 Thread John Henry
On Apr 29, 1:16 pm, Panyasan <[EMAIL PROTECTED]> wrote: > On 29 Apr., 20:30, Panyasan <[EMAIL PROTECTED]> wrote: > > > On 29 Apr., 18:17, John Henry <[EMAIL PROTECTED]> wrote: > > > > There are a whole bunch of test programs that comes with Pythoncard. > > > Do they work? (Not all of them will wor

Re: Python(2.5) reads an input file FASTER than pure C(Mingw)

2008-04-29 Thread Lie
On Apr 28, 2:14 am, n00m <[EMAIL PROTECTED]> wrote: > Lie wrote: > > On Apr 27, 6:28�am, n00m <[EMAIL PROTECTED]> wrote: > > > No so simple, guys. > > > E.g., I can't solve (in Python) this:http://www.spoj.pl/problems/INTEST/ > > > Keep getting TLE (time limit exceeded). Any ideas? After all, it's

Re: Sending Cntrl-C ??

2008-04-29 Thread gamename
> import os > import signal > import subprocess > > popen = subprocess(...) > os.kill(popen.pid, signal.SIGINT) > > Or with Python 2.6+: > > popen.send_signal(signal.SIGINT) Thanks, Christian. Would that work on win32 as well? -T -- http://mail.python.org/mailman/listinfo/python-list

timeout

2008-04-29 Thread maehhheeyy
Hi, I was just wondering if there was such thing as a timeout module. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple unicode-safe version of str(exception)?

2008-04-29 Thread Torsten Bronger
Hallöchen! Martin v. Löwis writes: >> Should I report this as a bug? I suspect it's a misfeature. > > Please no. There isn't much that can be done about it, IMO. One could give Exception a __unicode__ method. On the other hand, this kind of conversion of an exception to something printable is a

Re: Simple unicode-safe version of str(exception)?

2008-04-29 Thread Martin v. Löwis
> Should I report this as a bug? I suspect it's a misfeature. Please no. There isn't much that can be done about it, IMO. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: i want to add a timeout to my code

2008-04-29 Thread maehhheeyy
On Apr 17, 4:24 pm, Miki <[EMAIL PROTECTED]> wrote: > On Apr 17, 1:10 pm,maehhheeyy<[EMAIL PROTECTED]> wrote: > > > I want to add a timeout so that when I pull out my gps from my serial > > port, it would wait for a bit then loop and then see if it's there. I > > also want to add a print statement

Re: string translate, replace, find and the forward slash

2008-04-29 Thread Arnaud Delobelle
destroy <[EMAIL PROTECTED]> writes: > On Apr 29, 4:50 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: >> >> marigold:junk arno$ python >> Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17) >> [GCC 4.0.1 (Apple Inc. build 5465)] on darwin >> Type "help", "copyright", "credits" or "license" for mo

Re: Sending Cntrl-C ??

2008-04-29 Thread Christian Heimes
gamename schrieb: > Hi, > > I really like this recipe for controlling subprocesses: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554 > > However, I can't figure out how I can send the equivalent of "Cntrl-C" > to the subprocess. How can that be done? import os import signal impo

Re: @classmethod question

2008-04-29 Thread Ivan Illarionov
On Tue, 29 Apr 2008 14:30:08 -0600, Scott SA wrote: > With that said, your reply is amazingly helpful in my quest to > understand python, Django, etc. Django is the ORM I referred to, so the > material you have written helps explain a few things. This was my intention. Django ORM uses Pyhton clas

Re: Need Python alternative to Request-Tracker help desk software

2008-04-29 Thread M.-A. Lemburg
On 2008-04-29 22:15, Sells, Fred wrote: I've been tasked with either implementing Request-Tracker to upgrade our help desk issue tracking system or finding a Python equivalent (both in terms of functionality and wide spread use). Request-Tracker uses Apache and MySQL, which would also be appr

Tix.HList - Move Cursor

2008-04-29 Thread ivan
Hello, How do I move the keyboard cursor position in a Tix.HList? I am using an HList with the right mouse button bound to pop up a menu. If the right click is done on an unselected item, I change the selection to that item. This works, however the keyboard cursor position remains at the last ite

MatplotLib errors

2008-04-29 Thread Thomas Philips
I have just started using MatPlotLib, and use it to generate graphs from Python simulations. It often happens that the graph is generated and a Visual C++ Runtime Library error then pops up: Runtime Error! Program C:\Pythin25\Pythonw.exe This application has requested the Runtime to terminate in

Re: string translate, replace, find and the forward slash

2008-04-29 Thread destroooooy
On Apr 29, 4:50 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > destroy <[EMAIL PROTECTED]> writes: > > Hi folks, > > I'm finding some (what I consider) curious behavior with the string > > methods and the forward slash character. I'm writing a program to > > rename mp3 files based on their

pyExcelerator number formats and borders (was Re: PyExcerlerator details)

2008-04-29 Thread John Machin
A_H wrote: Hi, I'm using PyExcelerator, and it's great, If you are using the latest released version, it's not, IMO. Reading the fixed-later bug reports on Sourceforge may prompt you to get the latest version from svn. Reading the unfixed bug reports on Sourceforge may prompt you to switch t

Re: accuracy issues with numpy arrays?

2008-04-29 Thread Robert Kern
You will want to ask numpy questions on the numpy mailing list: http://www.scipy.org/Mailing_Lists I need a little more time to mull on your problem to give you an actual answer, but I hope I can do that over there instead of here. -- Robert Kern "I have come to believe that the whole worl

accuracy issues with numpy arrays?

2008-04-29 Thread eli
Hi, I'm writing a quick script to import a fits (astronomy) image that has very low values for each pixel. Mostly on the order of 10^-9. I have written a python script that attempts to take low values and put them in integer format. I basically do this by taking the mean of the 1000 lowest pixel v

Re: py2exe Icon Resources

2008-04-29 Thread Mike Driscoll
On Apr 29, 3:24 pm, [EMAIL PROTECTED] wrote: > I have created an app using python and then converting it to an exe > using py2exe, and have the following code: > > "icon_resources": [(1, "appFavicon.ico"), (2, "dataFavicon.ico")] > > in my py2exe setup file, the appFavicon works fine and it sets th

Re: string translate, replace, find and the forward slash

2008-04-29 Thread destroooooy
On Apr 29, 4:50 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > destroy <[EMAIL PROTECTED]> writes: > > Hi folks, > > I'm finding some (what I consider) curious behavior with the string > > methods and the forward slash character. I'm writing a program to > > rename mp3 files based on their

Re: API's and hardware communication. Newbie

2008-04-29 Thread Grayham
It seems to me that python needs to be extended with C in some form to able to do what i need. I think instead of learning two languages i am going to put all my efforts in to learning C as it seems that's where i am going to end up. Thank you both for the feed back and links Regards Grayham --

Re: string translate, replace, find and the forward slash

2008-04-29 Thread Arnaud Delobelle
destroy <[EMAIL PROTECTED]> writes: > Hi folks, > I'm finding some (what I consider) curious behavior with the string > methods and the forward slash character. I'm writing a program to > rename mp3 files based on their id3 tags, and I want to protect > against goofy characters in the in tag

Re: Simple import question about mac osx

2008-04-29 Thread Jerry Hill
On Tue, Apr 29, 2008 at 3:17 PM, jmDesktop <[EMAIL PROTECTED]> wrote: > On Windows I took the text file I created on mac with vi and opened it > in PythonWin. I ran it. It compiled. I run the import and call from > the python interpreter. You're not doing what you think you're doing. I'm no

string translate, replace, find and the forward slash

2008-04-29 Thread destroooooy
Hi folks, I'm finding some (what I consider) curious behavior with the string methods and the forward slash character. I'm writing a program to rename mp3 files based on their id3 tags, and I want to protect against goofy characters in the in tags. So I do the following: unsafe_chars = "/#()[EMA

Re: Cookie Confusion - How to Set a Cookie

2008-04-29 Thread Aaron Watters
> Thanks for the code, Aaron. I will give it a try. > > I've been reading some more about cookielib and am not sure whether I > should use Cookie or cookielib. This is what I want to do: a user is > going to login. Upon a successful login, I want to write their name > and date/time of visit to

Re: Simple unicode-safe version of str(exception)?

2008-04-29 Thread Torsten Bronger
Hallöchen! Russell E. Owen writes: > Torsten Bronger <[EMAIL PROTECTED]> wrote: > >> Russell E. Owen writes: >> >>> [...] >>> >>> So...to repeat the original question, is there any simpler >>> unicode-safe replacement for str(exception)? >> >> Please show us the tracebacks you get becuae unicod

Re: @classmethod question

2008-04-29 Thread Scott SA
On 4/23/08, Ivan Illarionov ([EMAIL PROTECTED]) wrote: >On 24 ???, 07:27, Scott SA <[EMAIL PROTECTED]> wrote: >> I'm using the @classemethod decorator for some convenience methods and for > >It would make sense to separate instance-level and class-level >behaviour with additional 'objects' namesp

py2exe Icon Resources

2008-04-29 Thread flarefight
I have created an app using python and then converting it to an exe using py2exe, and have the following code: "icon_resources": [(1, "appFavicon.ico"), (2, "dataFavicon.ico")] in my py2exe setup file, the appFavicon works fine and it sets that as the app icon thats fine, but the program creates

Re: Colors for Rows

2008-04-29 Thread J. Cliff Dyer
On Tue, 2008-04-29 at 15:39 -0400, D'Arcy J.M. Cain wrote: > On Tue, 29 Apr 2008 15:03:23 -0400 > "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: > > Or, if you aren't sure how many colors you'll be using, try the more > > robust: > > > > bg[z % len(bg)] > > Good point although I would have calculated

Re: So you think PythonCard is old? Here's new wine in an old bottle.

2008-04-29 Thread Panyasan
On 29 Apr., 20:30, Panyasan <[EMAIL PROTECTED]> wrote: > On 29 Apr., 18:17, John Henry <[EMAIL PROTECTED]> wrote: > > > > > There are a whole bunch of test programs that comes with Pythoncard. > > Do they work? (Not all of them will work - some requires a database) > > Yes, the examples work. Just

Need Python alternative to Request-Tracker help desk software

2008-04-29 Thread Sells, Fred
I've been tasked with either implementing Request-Tracker to upgrade our help desk issue tracking system or finding a Python equivalent (both in terms of functionality and wide spread use). Request-Tracker uses Apache and MySQL, which would also be appropriate to Python. I would prefer to go t

Re: Simple import question about mac osx

2008-04-29 Thread s0suk3
On Apr 29, 2:17 pm, jmDesktop <[EMAIL PROTECTED]> wrote: > On Apr 29, 2:37 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > > > > > On Tue, Apr 29, 2008 at 2:14 PM, jmDesktop <[EMAIL PROTECTED]> wrote: > > > Thanks. That worked on mac. But it does work like I said in > > > Windows. Don't know why

Re: list.reverse()

2008-04-29 Thread Carl Banks
On Apr 29, 9:32 am, Roy Smith <[EMAIL PROTECTED]> wrote: > The reasoning goes along the lines of, "reverse in place is an expensive > operation, so we don't want to make it too easy for people to do". At > least that's the gist of what I got out of the argument the many times it > has come up. Ex

Re: Cookie Confusion - How to Set a Cookie

2008-04-29 Thread cbhoem
On Apr 28, 1:37 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: > On Apr 28, 9:42 am, [EMAIL PROTECTED] wrote: > > > I see the cookie in my HTTP header > > but do not get anything in the cookie text file. I'm working on > > linux. > > > print "Content-type: text/html" > > cookie = Cookie.SimpleCo

Re: cytpes **int

2008-04-29 Thread VernM
On Apr 28, 11:57 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Gabriel Genellina schrieb: > > > > > > > [snip repetition] > > > That's true for "a pointer to a pointer to int", and it's valid if the > > functions references **b or b[0][0] - but in this case int** probably > > means "[pointer

Re: Simple unicode-safe version of str(exception)?

2008-04-29 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, Torsten Bronger <[EMAIL PROTECTED]> wrote: > Hallöchen! > > Russell E. Owen writes: > > > [...] > > > > So...to repeat the original question, is there any simpler > > unicode-safe replacement for str(exception)? > > Please show us the tracebacks you get becuae u

__getattr__ and recursion ?

2008-04-29 Thread Stef Mientki
hello, I tried to find an easy way to add properties (attributes) to a number of different components. So I wrote a class, from which all these components are derived. By trial and error I created the code below, which now works, but there is one thing I don't understand: in the line indicated

Re: Colors for Rows

2008-04-29 Thread D'Arcy J.M. Cain
On Tue, 29 Apr 2008 15:03:23 -0400 "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: > Or, if you aren't sure how many colors you'll be using, try the more > robust: > > bg[z % len(bg)] Good point although I would have calculated the length once at the start rather than each time through the loop. --

Re: Colors for Rows

2008-04-29 Thread D'Arcy J.M. Cain
On Tue, 29 Apr 2008 13:14:34 -0500 "Victor Subervi" <[EMAIL PROTECTED]> wrote: > On Tue, Apr 29, 2008 at 11:11 AM, D'Arcy J.M. Cain <[EMAIL PROTECTED]> wrote: > > > for d in (1,2,3,4,5,6): > > > > I changed id to a sequence so that the example actually runs. Please > > run your examples first and

Re: Setting an attribute without calling __setattr__()

2008-04-29 Thread Joshua Kugler
animalMutha wrote: >> Consider reading the *second* paragraph about __setattr__ in section >> 3.4.2 of the Python Reference Manual. > > if you are simply going to answer rtfm - might as well kept it to > yourself. For what it's worth, I (the original poster) am glad he answered that way. It sho

Re: Simple import question about mac osx

2008-04-29 Thread jmDesktop
On Apr 29, 2:37 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > On Tue, Apr 29, 2008 at 2:14 PM, jmDesktop <[EMAIL PROTECTED]> wrote: > >  Thanks.  That worked on mac.  But it does work like I said in > >  Windows.  Don't know why.  Mr. Chun must also be using Windows because > >  that is the way he

Re: list.reverse()

2008-04-29 Thread Ivan Illarionov
On Tue, 29 Apr 2008 07:26:07 -0700, Paul McGuire wrote: > On Apr 28, 1:12 pm, Mark Bryan Yu <[EMAIL PROTECTED]> wrote: >> This set of codes works: >> >> >>> x = range(5) >> >>> x.reverse() >> >>> x >> >> [4, 3, 2, 1, 0] >> >> > You can also use list slicing to get a reversed list: > x = rang

Re: Colors for Rows

2008-04-29 Thread J. Cliff Dyer
On Tue, 2008-04-29 at 13:14 -0500, Victor Subervi wrote: > On Tue, Apr 29, 2008 at 11:11 AM, D'Arcy J.M. Cain <[EMAIL PROTECTED]> > wrote: > On Tue, 29 Apr 2008 09:33:32 -0500 > "Victor Subervi" <[EMAIL PROTECTED]> wrote: > > why doesn't this work? > > >

Sending Cntrl-C ??

2008-04-29 Thread gamename
Hi, I really like this recipe for controlling subprocesses: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554 However, I can't figure out how I can send the equivalent of "Cntrl-C" to the subprocess. How can that be done? TIA, -T -- http://mail.python.org/mailman/listinfo/python-li

Re: @classmethod question

2008-04-29 Thread Scott SA
On 4/24/08, Bruno Desthuilliers ([EMAIL PROTECTED]) wrote: >> It is a series of convenience methods, in this case I'm interacting >> with a database via an ORM (object-relational model). > >out of curiosity : which one ? I'm rapidly becoming a "django junkie"^TM >> I want the ability >> to call

Re: Simple import question about mac osx

2008-04-29 Thread Jerry Hill
On Tue, Apr 29, 2008 at 2:14 PM, jmDesktop <[EMAIL PROTECTED]> wrote: > Thanks. That worked on mac. But it does work like I said in > Windows. Don't know why. Mr. Chun must also be using Windows because > that is the way he does it in his book. It shouldn't work that way on windows either.

Re: So you think PythonCard is old? Here's new wine in an old bottle.

2008-04-29 Thread Panyasan
On 29 Apr., 18:17, John Henry <[EMAIL PROTECTED]> wrote: > > There are a whole bunch of test programs that comes with Pythoncard. > Do they work? (Not all of them will work - some requires a database) Yes, the examples work. Just the resourceEditor.py and the layoutEditor.py in the distributed v

Re: Zope/DTML Infuriating...

2008-04-29 Thread Arnaud Delobelle
Jens <[EMAIL PROTECTED]> writes: [...] > @Marco: Thanks for the links :-) Python may be one of those really > elegant languages, but the reference is really sub > standard. Checkout the layout of php.net for comparison. Think what > you will about php, but the reference is excellent. For that matte

Re: Python Success stories

2008-04-29 Thread Fuzzyman
On Apr 22, 11:25 am, azrael <[EMAIL PROTECTED]> wrote: > Hy guys, > A friend of mine i a proud PERL developer which always keeps making > jokes on python's cost. > > Please give me any arguments to cut him down about his commnets > like :"keep programing i python. maybe, one day, you will be able t

Re: Colors for Rows

2008-04-29 Thread Joe Riopel
On Tue, Apr 29, 2008 at 10:33 AM, Victor Subervi <[EMAIL PROTECTED]> wrote: > Hi; > > > why doesn't this work? > It never increments z! Yet, if I print z, it will increment and change the > bgcolor! Why?! Are you only trying to "print '\n' % bg" once, or for each iteration of the loop? It might

Re: Simple import question about mac osx

2008-04-29 Thread jmDesktop
On Apr 29, 1:54 pm, [EMAIL PROTECTED] wrote: > On Apr 29, 12:46 pm, jmDesktop <[EMAIL PROTECTED]> wrote: > > > > > > > On Apr 29, 1:16 pm, jmDesktop <[EMAIL PROTECTED]> wrote: > > > > Hi, I have this code (learning from Core Python, Chun's book), module > > > named chap2.py. > > > > class FooClass(

Re: Colors for Rows

2008-04-29 Thread Victor Subervi
On Tue, Apr 29, 2008 at 11:11 AM, D'Arcy J.M. Cain <[EMAIL PROTECTED]> wrote: > On Tue, 29 Apr 2008 09:33:32 -0500 > "Victor Subervi" <[EMAIL PROTECTED]> wrote: > > why doesn't this work? > > First, let me remove some blank lines to reduce scrolling. > > > z = 3 > > > > for d in (1,2,3,4,5,6): > >

Re: Simple import question about mac osx

2008-04-29 Thread s0suk3
On Apr 29, 12:46 pm, jmDesktop <[EMAIL PROTECTED]> wrote: > On Apr 29, 1:16 pm, jmDesktop <[EMAIL PROTECTED]> wrote: > > > > > Hi, I have this code (learning from Core Python, Chun's book), module > > named chap2.py. > > > class FooClass(object): > > version=0.1 > > > def __init__(s

Re: Simple import question about mac osx

2008-04-29 Thread jmDesktop
On Apr 29, 1:16 pm, jmDesktop <[EMAIL PROTECTED]> wrote: > Hi, I have this code (learning from Core Python, Chun's book), module > named chap2.py. > > class FooClass(object): >         version=0.1 > >         def __init__(self, nm='John Doe'): >                 self.name=nm >                 print

Re: Issue with regular expressions

2008-04-29 Thread George Sakkis
On Apr 29, 9:46 am, Julien <[EMAIL PROTECTED]> wrote: > Hi, > > I'm fairly new in Python and I haven't used the regular expressions > enough to be able to achieve what I want. > I'd like to select terms in a string, so I can then do a search in my > database. > > query = ' " some words" with a

Re: Given a string - execute a function by the same name

2008-04-29 Thread python
Erik, > Perhaps I missed something earlier in the thread, but I really don't see the > need for that registry dict or the register decorator. Python already maintains a dictionary for each scope: The advantage of the decorator technique is that you explicitly declare which functions are eligible

Re: Simple unicode-safe version of str(exception)?

2008-04-29 Thread Sion Arrowsmith
Russell E. Owen <[EMAIL PROTECTED]> wrote: >No. e.message is only set if the exeption object receives exactly one >argument. And not always then: >>> e1 = Exception(u"\u00fe") >>> e1.message Traceback (most recent call last): File "", line 1, in ? AttributeError: Exception instance has no attr

Simple import question about mac osx

2008-04-29 Thread jmDesktop
Hi, I have this code (learning from Core Python, Chun's book), module named chap2.py. class FooClass(object): version=0.1 def __init__(self, nm='John Doe'): self.name=nm print 'Created a class instance for ', nm def showname(self):

Re: Issue with regular expressions

2008-04-29 Thread Paul McGuire
On Apr 29, 9:20 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Apr 29, 8:46 am, Julien <[EMAIL PROTECTED]> wrote: > > > I'd like to select terms in a string, so I can then do a search in my > > database. > > > query = '   "  some words"  with and "without    quotes   "  ' > > p = re.compile(magic

Re: Issue with regular expressions

2008-04-29 Thread Matimus
On Apr 29, 6:46 am, Julien <[EMAIL PROTECTED]> wrote: > Hi, > > I'm fairly new in Python and I haven't used the regular expressions > enough to be able to achieve what I want. > I'd like to select terms in a string, so I can then do a search in my > database. > > query = ' " some words" with an

Import fails with python but succeeds with python -v

2008-04-29 Thread John Normoyle
Hi, I've noticed strange behaviour where cx_Oracle will fail to load when using "python" but it will succeed when using "python -v" while throwing "Unsatisfied code symbol" errors. This is for Python 2.5, Oracle 9.2 and cx_Oracle 4.3.1 on the platform HP-UX 11 Output for python: ImportError

  1   2   >