Re: naming objects from string

2006-09-20 Thread Tim Roberts
"manstey" <[EMAIL PROTECTED]> wrote: > >If I have a string, how can I give that string name to a python object, >such as a tuple. > >e.g. > >a = 'hello' >b=(1234) That's not a tuple. That's an integer. (1234,) is a tuple. >and then a function >name(b) = a > >which would mean: >hello=(1234) > >i

Re: Is it possible to change a picture resolution with Python?

2006-09-20 Thread Tim Roberts
"Lad" <[EMAIL PROTECTED]> wrote: >from >> image: >> http://www.pythonware.com/library/pil/handbook/image.htm >> >> This is some example code: >> >> from PIL import Image >> im = Image.open("1.jpg") >> nx, ny = im.size >> im2 = im.resize((int(nx*1.5), int(ny*1.5)), Image.BICUBIC) >> im2.save("2.png

Re: naming objects from string

2006-09-20 Thread Ben Finney
"manstey" <[EMAIL PROTECTED]> writes: > If I have a string, how can I give that string name to a python > object, such as a tuple. The thing I'd like to know before answering this is: how will you be using that name to refer to the object later? -- \ "If you ever catch on fire, try to avoi

Re: pexpect baudrate and mode settings

2006-09-20 Thread Bryce Bolton
Hi, I've written a short script in pexpect to open the serial port and get 100 bytes.  The script does receive a string of garbage, but not the good text seen when I open a minicom terminal and look at ttyS0.  I know that the baud rate is wrong, and the other settings (such as 8N1) are unknown t

Re: wxPython - very small frame

2006-09-20 Thread Wildemar Wildenburger
Francach wrote: > Hi, > > I'd like to create a very small Frame without the usual minimise and > maximise icons on the top. Does anyone know how to do this with > wxPython? I've tried creating a Frame with the style wx.DOUBLE_BORDER, > which gives me a nice small window. But I can't move it aroun

pexpect baudrate and mode settings

2006-09-20 Thread Bryce Bolton
Hi, I've written a short script in pexpect to open the serial port and get 100 bytes.  The script does receive a string of garbage, but not the good text seen when I open a minicom terminal and look at ttyS0.  I know that the baud rate is wrong, and the other settings (such as 8N1) are unknown t

wxPython - very small frame

2006-09-20 Thread Francach
Hi, I'd like to create a very small Frame without the usual minimise and maximise icons on the top. Does anyone know how to do this with wxPython? I've tried creating a Frame with the style wx.DOUBLE_BORDER, which gives me a nice small window. But I can't move it around the screen. Thanks, Marti

Re: naming objects from string

2006-09-20 Thread Wildemar Wildenburger
manstey wrote: > Hi, > > thanks for the suggestions. this is my problem: > > I have a metadata file that another user defines, and I don't know > their structure in advance. They might have 300+ structures. the > metadata defines the name and the tuple-like structure when read by > python. > > m

Re: view page source or save after load

2006-09-20 Thread alex23
zephron2000 wrote: > I need to either: > 1. View the page source of a webpage after it loads > or > 2. Save the webpage to my computer after it loads (same as File > Save > Page As) > urllib is not sufficient (using urlopen or something else in urllib > isn't going to do the trick) You don't reall

Re: naming objects from string

2006-09-20 Thread manstey
Hi, thanks for the suggestions. this is my problem: I have a metadata file that another user defines, and I don't know their structure in advance. They might have 300+ structures. the metadata defines the name and the tuple-like structure when read by python. my program reads in the metadata fil

Re: view page source or save after load

2006-09-20 Thread James Stroud
zephron2000 wrote: > Hey, > > I need to either: > > 1. View the page source of a webpage after it loads > > or > > 2. Save the webpage to my computer after it loads (same as File > Save > Page As) > > urllib is not sufficient (using urlopen or something else in urllib > isn't going to do the t

Re: naming objects from string

2006-09-20 Thread manstey
Hi, thanks for the suggestions. this is my problem: I have a metadata file that another user defines, and I don't know their structure in advance. They might have 300+ structures. the metadata defines the name and the tuple-like structure when read by python. my program reads in the metadata fil

Re: naming objects from string

2006-09-20 Thread Wildemar Wildenburger
Damjan wrote: > try > sys.modules[__name__].__dict__[x] = a @manstay: You see! Ugly, unreadable trickery! Hands off this stuff, bad mojo! You've been told three very different approaches now, which is a pretty good indicator that there is no obvious way to do it. Which means another angle to yo

Re: naming objects from string

2006-09-20 Thread Wildemar Wildenburger
manstey wrote: > Hi, > > But this doesn't work if I do: > > a=object() > x='bob' > locals()[x] = a > > How can I do this? You can. I just copy/pasted your code and it works fine here. (You are aware that there is whitespace before locals() that you have to remove before you feed it to the sn

Re: naming objects from string

2006-09-20 Thread Damjan
manstey wrote: > Hi, > > But this doesn't work if I do: > > a=object() > x='bob' > locals()[x] = a > > How can I do this? try sys.modules[__name__].__dict__[x] = a But what's the point? -- damjan -- http://mail.python.org/mailman/listinfo/python-list

view page source or save after load

2006-09-20 Thread zephron2000
Hey, I need to either: 1. View the page source of a webpage after it loads or 2. Save the webpage to my computer after it loads (same as File > Save Page As) urllib is not sufficient (using urlopen or something else in urllib isn't going to do the trick) Any ideas? Thanks, Lara -- http:/

Re: naming objects from string

2006-09-20 Thread Wildemar Wildenburger
manstey wrote: > If I have a string, how can I give that string name to a python object, > such as a tuple. > > e.g. > > a = 'hello' > b=(1234) > > and then a function > name(b) = a > > which would mean: > hello=(1234) > > is this possible? > Direct answer: Look up the setattr() functions (D

Re: Trying to run an external program

2006-09-20 Thread Stephan Kuhagen
Brant Sears wrote: > Any ideas on what I might do to troubleshoot this? As other stated out, you are using the wrong module. Try: >>> import os >>> p=os.popen('dir') >>> for l in p: ... print l ... --- OUTPUT OF DIR HERE --- >>> p.close() The return value of close is the return value of the c

Re: naming objects from string

2006-09-20 Thread manstey
Hi, But this doesn't work if I do: a=object() x='bob' locals()[x] = a How can I do this? James Stroud wrote: > manstey wrote: > > Hi, > > > > If I have a string, how can I give that string name to a python object, > > such as a tuple. > > > > e.g. > > > > a = 'hello' > > b=(1234) > > > > and t

i just made a website(ztooo.com) using zope & jsonserver

2006-09-20 Thread astarocean
ztooo.com come up on 2006-09-19, made with zope & jsonserver, have a look? you may need zh_CN.utf8 charsets installed for view normaly thanks reebalazs for his brilliant idea thanks zope -- http://mail.python.org/mailman/listinfo/python-list

Re: naming objects from string

2006-09-20 Thread James Stroud
manstey wrote: > Hi, > > If I have a string, how can I give that string name to a python object, > such as a tuple. > > e.g. > > a = 'hello' > b=(1234) > > and then a function > name(b) = a > > which would mean: > hello=(1234) > > is this possible? > Depends on your namespace, but for the l

naming objects from string

2006-09-20 Thread manstey
Hi, If I have a string, how can I give that string name to a python object, such as a tuple. e.g. a = 'hello' b=(1234) and then a function name(b) = a which would mean: hello=(1234) is this possible? -- http://mail.python.org/mailman/listinfo/python-list

Re: Need some help here

2006-09-20 Thread John B
Kareem840 wrote: > Hello. Unfortunately, I am in need of money to pay my credit card > bills. If you could spare just $1, I would be grateful. I have a Paypal > account. [EMAIL PROTECTED] I swear this will go to my card > balances. Thank you. > I accidentally sent $2, could you please refund the e

Re: Need some help here

2006-09-20 Thread gre
di wrote: > "Kareem840" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Hello. Unfortunately, I am in need of money to pay my credit card >> bills. If you could spare just $1, I would be grateful. I have a Paypal >> account. [EMAIL PROTECTED] I swear this will go to my card >> bal

Re: How to measure memory footprint of Python objects?

2006-09-20 Thread Heikki Toivonen
Neagu, Adrian wrote: > I try to solve the following problem: I have a python program that takes a > lot of memory (>hundred Mb). I made an improvement (I hope) and I want to > measure the gain (if possible on several platforms). I would like to be able > to print the max memory taken during the run

Re: Interact with system command prompt

2006-09-20 Thread Fernando Perez
billie wrote: > Uhm... It seems that IPython got some problems: > http://ipython.scipy.org/doc/manual/node12.html > > In details: > >>Note that this does not make IPython a full-fledged system shell. In >>particular, it has >no job control, so if you type Ctrl-Z (under Unix), >>you'll suspend py

sgid and python programs

2006-09-20 Thread Eric S. Johansson
Assuming one can't avoid the need to set the group ID of a Python program, is a wrapper program still considered the best way to do that? the reason I ask is that a few years ago, I picked up a program that was (and maybe still is) shipped with Python as a wrapper for sgid programs. I sea

Re: Upgrading question

2006-09-20 Thread Wildemar Wildenburger
Carl J. Van Arsdall wrote: > [EMAIL PROTECTED] wrote: >> i am working in unix and my Python version is 2.4.1 >> I would like to upgrade my version to 2.5 stable. but i have many >> scripts already running using 2.4.1. ... > > other than that change the link in /usr/bin/python to point to 2.5 > in

Re: Need some help here

2006-09-20 Thread Wildemar Wildenburger
Kareem840 wrote: > Hello. Unfortunately, I am in need of money to pay my credit card > bills. If you could spare just $1, I would be grateful. I have a Paypal > account. [EMAIL PROTECTED] I swear this will go to my card > balances. Thank you. > And I need to get a bus. I mean literally. It's the b

Re: Need some help here

2006-09-20 Thread di
"Kareem840" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello. Unfortunately, I am in need of money to pay my credit card > bills. If you could spare just $1, I would be grateful. I have a Paypal > account. [EMAIL PROTECTED] I swear this will go to my card > balances. Thank you.

Re: Trying to run an external program

2006-09-20 Thread Matimus
Brant Sears wrote: > Hi. I'm new to Python and I am trying to use the latest release (2.5) > on Windows XP. > > What I want to do is execute a program and have the results of the > execution assigned to a variable. According to the documentation the > way to do this is as follows: > > import comman

RE: access to xml_rpc server problem

2006-09-20 Thread Ted Zeng
Good question. I will check this out. When I run the server on a machine with static IP, I need to run the server with SimpleXMLRPCServer.SimpleXMLRPCServer(("machine_domain.mycompany.com", 8000)) server.serve_forever() then client can access the server with server = xmlrpclib.Server('http:// ma

byte count unicode string

2006-09-20 Thread willie
>willie wrote: >> >> Thanks for the thorough explanation. One last question >> about terminology then I'll go away :) >> What is the proper way to describe "ustr" below? >> >>> ustr = buf.decode('UTF-8') >> >>> type(ustr) >> >> Is it a "unicode object that contains a UTF-8 encoded >>

Re: Upgrading question

2006-09-20 Thread Carl J. Van Arsdall
[EMAIL PROTECTED] wrote: > hi > just want to get some opinions > i am working in unix and my Python version is 2.4.1 > I would like to upgrade my version to 2.5 stable. but i have many > scripts already running using 2.4.1. Can i just install 2.5 onto > another directory, and then just change every

Re: access to xml_rpc server problem

2006-09-20 Thread Gabriel Genellina
At Wednesday 20/9/2006 21:30, Ted Zeng wrote: But if I use server's ip address instead of localhost in the client, then it could not access the server. Maybe you have a firewall blocking access? Gabriel Genellina Softlab SRL ___

Re: Trying to run an external program

2006-09-20 Thread Gabriel Genellina
At Wednesday 20/9/2006 19:49, Brant Sears wrote: Hi. I'm new to Python and I am trying to use the latest release (2.5) on Windows XP. What I want to do is execute a program and have the results of the execution assigned to a variable. According to the documentation the way to do this is as foll

access to xml_rpc server problem

2006-09-20 Thread Ted Zeng
HI, I run a xml_rpc server like the following:(sample code from internet) server = SimpleXMLRPCServer.SimpleXMLRPCServer(("localhost", 8000)) server.serve_forever() If my client is on the same machine, I use :(also from internet sample code) server = xmlrpclib.Server('http://localhost:8000') pr

Re: "list index out of range" error

2006-09-20 Thread Tuomas
sam wrote: I gues: no_lines=len(list_initial) > for j in range(0, no_lines): range returns 0, 1, 2, ..., no_lines-1 > > k = 0 > while k < no_lines: > sorted_check = 0 > if list_initial[k] < list_initial[k+1]: When j gets its last value (no_lines-1) k has the same va

Upgrading question

2006-09-20 Thread s99999999s2003
hi just want to get some opinions i am working in unix and my Python version is 2.4.1 I would like to upgrade my version to 2.5 stable. but i have many scripts already running using 2.4.1. Can i just install 2.5 onto another directory, and then just change every shebang (#! in first line) in my scr

Re: Need some help here

2006-09-20 Thread John McWilliams
Frank Drackman wrote: > "Kareem840" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Hello. Unfortunately, I am in need of money to pay my credit card >> bills. If you could spare just $1, I would be grateful. I have a Paypal >> account. [EMAIL PROTECTED] I swear this will go to my

Weekly Python Patch/Bug Summary

2006-09-20 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 419 open ( +3) / 3410 closed ( +2) / 3829 total ( +5) Bugs: 910 open (+12) / 6185 closed ( +5) / 7095 total (+17) RFE : 235 open ( +1) / 238 closed ( +0) / 473 total ( +1) New / Reopened Patches __ Practical

Re: byte count unicode string

2006-09-20 Thread John Machin
willie wrote: > > Thanks for the thorough explanation. One last question > about terminology then I'll go away :) > What is the proper way to describe "ustr" below? > > >>> ustr = buf.decode('UTF-8') > >>> type(ustr) > > > > Is it a "unicode object that contains a UTF-8 encoded > string object?

Re: newbe's re question

2006-09-20 Thread [EMAIL PROTECTED]
Frederic Rentsch wrote: > [EMAIL PROTECTED] wrote: > > Frederic Rentsch wrote: > > > >> [EMAIL PROTECTED] wrote: > >> > >>> All I am after realy is to change this > >>> > >>> reline = re.line.split('instr', '/d$') > >>> > >>> into something that grabs any line with instr in it take all the > >>>

Re: byte count unicode string

2006-09-20 Thread Gabriel Genellina
At Wednesday 20/9/2006 19:53, willie wrote: What is the proper way to describe "ustr" below? >>> ustr = buf.decode('UTF-8') >>> type(ustr) Is it a "unicode object that contains a UTF-8 encoded string object?" ustr is an unicode object. Period. An unicode object contains characters (not

Re: new string method in 2.5 (partition)

2006-09-20 Thread Irmen de Jong
Gabriel Genellina wrote: > Nope, a python string has both a length *and* a null terminator (for > ease of interfacing C routines, I guess) so you can't just share a > substring. Ofcourse, that makes perfect sense. Should have thought a little bit further myself :) --Irmen -- http://mail.

Re: byte count unicode string

2006-09-20 Thread Virgil Dupras
MonkeeSage wrote: > OK, so the devil always loses. ;P > > Regards, > Jordan Huh? The devil always loses? *turns TV on, watches the news, turns TV off* Nope, buddy. Quite the contrary. -- http://mail.python.org/mailman/listinfo/python-list

Re: "list index out of range" error

2006-09-20 Thread sam
gabriel, > Now that your main problem is gone, just a few comments: > - python lists know their length, so you don't need explicit no_lines > and no_lines_2 > - list_initial.remove(temp_str) is fairly slow - it has to *scan* the > list to locate temp_str. Just keep its index instead, and use del >

Re: Need some help here

2006-09-20 Thread Frank Drackman
"Kareem840" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello. Unfortunately, I am in need of money to pay my credit card > bills. If you could spare just $1, I would be grateful. I have a Paypal > account. [EMAIL PROTECTED] I swear this will go to my card > balances. Thank you.

Re: Need some help here

2006-09-20 Thread Dave
The money's on the way! "Kareem840" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello. Unfortunately, I am in need of money to pay my credit card > bills. If you could spare just $1, I would be grateful. I have a Paypal > account. [EMAIL PROTECTED] I swear this will go to my ca

Re: How to evaluate the memory usage of a python program?

2006-09-20 Thread MrJean1
Iff you are using Python on Linux, here is one option which may work for you /Jean Daniel Mark wrote: > Hello all: > > I have a python program and would like to find out the maximum memory > used > by this program. > > Does Pyth

Re: "list index out of range" error

2006-09-20 Thread Gabriel Genellina
At Wednesday 20/9/2006 19:39, sam wrote: thanks again for your help. that sorted out something that had really been bugging me. Now that your main problem is gone, just a few comments: - python lists know their length, so you don't need explicit no_lines and no_lines_2 - list_initial.remove(t

Re: "list index out of range" error

2006-09-20 Thread Ben Finney
"sam" <[EMAIL PROTECTED]> writes: > hey everybody, this is my first time posting here. i'm pretty new to > python and programming in general (as you'll soon work out for > yourselves...) On behalf of the entire Python community, *thank you* for putting this disclaimer only in the body of your mes

Trying to run an external program

2006-09-20 Thread Brant Sears
Hi. I'm new to Python and I am trying to use the latest release (2.5) on Windows XP. What I want to do is execute a program and have the results of the execution assigned to a variable. According to the documentation the way to do this is as follows: import commands x = commands.getstatusou

byte count unicode string

2006-09-20 Thread willie
Martin v. Löwis: >willie schrieb: > >> Thank you for your patience and for educating me. >> (Though I still have a long way to go before enlightenment) >> I thought Python might have a small weakness in >> lacking an efficient way to get the number of bytes >> in a "UTF-8 encoded Python str

Re: Is it possible to change a picture resolution with Python?

2006-09-20 Thread Max Erickson
"Lad" <[EMAIL PROTECTED]> wrote: > from >> image: >> http://www.pythonware.com/library/pil/handbook/image.htm >> >> This is some example code: >> >> from PIL import Image >> im = Image.open("1.jpg") >> nx, ny = im.size >> im2 = im.resize((int(nx*1.5), int(ny*1.5)), Image.BICUBIC) >> im2.save("2.pn

Re: "list index out of range" error

2006-09-20 Thread sam
for what it's worth. and it is approx. five times quicker than the bubblesort i wrote to begin with on a 286-word highly unordered list, so i wasn't wasting my time after all... __ import time file_input = open('wordlist.txt', 'r

Re: Need some help here

2006-09-20 Thread Todd H.
"Kareem840" <[EMAIL PROTECTED]> writes: > Hello. Unfortunately, I am in need of money to pay my credit card > bills. If you could spare just $1, I would be grateful. I have a Paypal > account. [EMAIL PROTECTED] I swear this will go to my card > balances. Thank you. If you have a story of unusual

Re: How do I define a global constant...

2006-09-20 Thread John Machin
SpreadTooThin wrote: > How do I define a constant that I can use in my script... > For example lets say I have a file called constants.py and in there I > have PI = 3.14 > > in my test script I do: > > from constants import * > > How do I access PI later on? Like this: inaccurate_estimate_of_are

Re: Need some help here

2006-09-20 Thread Colin B.
In comp.unix.solaris Kareem840 <[EMAIL PROTECTED]> wrote: > Hello. Unfortunately, I am in need of money to pay my credit card > bills. If you could spare just $1, I would be grateful. I have a Paypal > account. [EMAIL PROTECTED] I swear this will go to my card > balances. Thank you. Better idea. S

Re: new string method in 2.5 (partition)

2006-09-20 Thread Gabriel Genellina
At Wednesday 20/9/2006 15:11, Irmen de Jong wrote: Because the result of partition is a non mutable tuple type containing three substrings of the original string, is it perhaps also the case that partition works without allocating extra memory for 3 new string objects and copying the substrings

Need some help here

2006-09-20 Thread Kareem840
Hello. Unfortunately, I am in need of money to pay my credit card bills. If you could spare just $1, I would be grateful. I have a Paypal account. [EMAIL PROTECTED] I swear this will go to my card balances. Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: new string method in 2.5 (partition)

2006-09-20 Thread Bruno Desthuilliers
John Salerno a écrit : > Bruno Desthuilliers wrote: > >> Err... is it me being dumb, or is it a perfect use case for str.split ? > > > Hmm, I suppose you could get nearly the same functionality as using > split(':', 1), but with partition you also get the separator returned as > well. Well, y

How do I define a global constant...

2006-09-20 Thread SpreadTooThin
How do I define a constant that I can use in my script... For example lets say I have a file called constants.py and in there I have PI = 3.14 in my test script I do: from constants import * How do I access PI later on? Pardon my newbie questions... -- http://mail.python.org/mailman/listinfo

Re: Pyglade, gtk, howto write more efficiently, and waste less code?

2006-09-20 Thread Gabriel Genellina
At Wednesday 20/9/2006 10:06, Pipiten wrote: I have: self.paths = ["","path1","path2","path3","path4","path5"] self.paths[1] = self.wTree.get_widget("path1") self.paths[2] = self.wTree.get_widget("path2") self.paths[3] = self.wTree.get_widget("path3") self

Re: unicode mystery/problem

2006-09-20 Thread John Machin
Petr Jakes wrote: > Hi, > I am using Python 2.4.3 on Fedora Core4 and "Eric3" Python IDE > . > Below mentioned code works fine in the Eric3 environment. While trying > to start it from the command line, it returns: > > Traceback (most recent call last): > File "pokus_1.py", line 5, in ? > pr

Re: py.test and HTML output

2006-09-20 Thread Carl Friedrich Bolz
Hi Victor! Victor Ng wrote: > Is there documentation anywhere on how to get py.test to emit nice > HTML output like the kind that they have for the PyPy project here: > http://codespeak.net/~hpk/pypy-testresult/ ? The code that produces that page is rather ad-hoc and PyPy specific, though maybe y

Re: "list index out of range" error

2006-09-20 Thread sam
yes, yes, of course, thank you. not sure what i thought i was doing there. i'll see if i can get it running now... -- http://mail.python.org/mailman/listinfo/python-list

Re: "list index out of range" error

2006-09-20 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, sam wrote: > i'm trying to code a version of a selection sort and the heart of the > code is as follows (no_lines is simply the number of items to be > sorted, read out of an input file): > > for j in range(0, no_lines): > > k = 0 > while k < no_lines: > s

Re: Python-2.5 available at WebFaction

2006-09-20 Thread remi
Paul McGuire wrote: > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Hello everyone, > > > > I'm happy to announce that WebFaction have now installed Python-2.5 > > on all their servers. > > > > WebFaction (formerly Python-Hosting.com) support all the > > major Python web framew

Re: "list index out of range" error

2006-09-20 Thread sam
actually, that little bit of code i wrote is obscenely wrong anyway, so please don't bother analyzing the flow. any insight into the "list index out of range" error would still be welcome, though. -- http://mail.python.org/mailman/listinfo/python-list

"list index out of range" error

2006-09-20 Thread sam
hey everybody, this is my first time posting here. i'm pretty new to python and programming in general (as you'll soon work out for yourselves...) i'm trying to code a version of a selection sort and the heart of the code is as follows (no_lines is simply the number of items to be sorted, read out

strange unittest issue

2006-09-20 Thread Chris Fonnesbeck
I have a Python module that I have set up with some unit testing code, which is simply a class that subclasses unittest.TestCase. Strangely, however, I am having some issues trying to call the code. Specifically, if I do the following: >>> from PyMC import MCMC>>> MCMC.unittest.main()--

Re: Python/MySQL problem on Windows

2006-09-20 Thread Eric Smith
Carsten Haese <[EMAIL PROTECTED]> writes: > What happens if you use connect(...) instead of connection(...)? Then it works! :-) I could have sworn that I got the use of connection() from published sample code, but I must be mistaken. Thanks! Eric -- http://mail.python.org/mailman/listinfo/

Re: Python/MySQL problem on Windows

2006-09-20 Thread Carsten Haese
On Wed, 2006-09-20 at 16:37, Eric Smith wrote: > I'm trying to use Python 2.4.3 and pywin32-209 to access a MySQL > database on Windows Server 2003 Standard Edition, and not having much > luck. It seems like parts of the MySQLdb module are not getting loaded > correctly, but no error message is giv

Re: Python regular expression question!

2006-09-20 Thread unexpected
Sweet! Thanks so much! -- http://mail.python.org/mailman/listinfo/python-list

Python/MySQL problem on Windows

2006-09-20 Thread Eric Smith
I'm trying to use Python 2.4.3 and pywin32-209 to access a MySQL database on Windows Server 2003 Standard Edition, and not having much luck. It seems like parts of the MySQLdb module are not getting loaded correctly, but no error message is given during the import, even if I give a "-vv" on the com

Re: Leaks in subprocess.Popen

2006-09-20 Thread Ziga Seilnacht
zloster wrote: > I'm using Python 2.4.3 for Win32. > I was trying to run a few child processes simultaneously in separate > threads and get their STDOUT, but the program was leaking memory and I > found that it was because of subprocess operating in another thread. > The following code works fine,

Re: How to get a Fix to an Abandoned Project?

2006-09-20 Thread Gregory Piñero
On 20 Sep 2006 08:08:01 -0700, Adam Jones <[EMAIL PROTECTED]> wrote: > > Gregory Piñero wrote: > > Say hello to pydelicious's new home ;-) > > http://code.google.com/p/pydelicious/ > > > > -Greg > > Unless you are the original project's maintainer or have their consent > on this it is usually bad f

Re: SciPy Optimization syntax

2006-09-20 Thread Robert Kern
[EMAIL PROTECTED] wrote: > I'm trying to optimize a function using SciPy's optimize.fmin, but am > clearly getting the syntax wrong, and would be grateful for some > guiidance. You will want to ask such questions on the scipy mailing lists. http://www.scipy.org/Mailing_Lists > First, here's t

Re: Looking for a reports module/project

2006-09-20 Thread Steve Holden
John Purser wrote: > Hello, > > I'm working on a script to gather data from our servers and then present > the data as part of daily maintenance. Pretty straight forward stuff. > However one of the limitations of an earlier design was presentation of > the data so I'm working to make this version

Re: Python-2.5 available at WebFaction

2006-09-20 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello everyone, > > I'm happy to announce that WebFaction have now installed Python-2.5 > on all their servers. > > WebFaction (formerly Python-Hosting.com) support all the > major Python web frameworks (Django, TurboGears, CherryPy, >

Re: Do we need to delete "ImageDraw.Draw" after using it?

2006-09-20 Thread Steve Holden
Daniel Mark wrote: > Hello all: > > I am looking the sample code posted on PIL website > http://www.pythonware.com/library/pil/handbook/imagedraw.htm > > > <> > > import Image, ImageDraw > > im = Image.open("lena.pgm") > > draw = ImageDraw.Draw(

Re: Python regular expression question!

2006-09-20 Thread Ant
unexpected wrote: > > \b matches the beginning/end of a word (characters a-zA-Z_0-9). > > So that regex will match e.g. MULTX-FOO but not MULTX-. > > > > So is there a way to get \b to include - ? No, but you can get the behaviour you want using negative lookaheads. The following regex is effecti

Re: include statement

2006-09-20 Thread Gabriel Genellina
At Wednesday 20/9/2006 03:50, [EMAIL PROTECTED] wrote: My application has a configuration file where lots of variables are set. (The configuration file is python source, so there is no home-brewed parsing involved.) The configuration file is starting to get quite large and unwieldy, so for this

Re: Trouble Passing Array of Strings (using Numeric) to C Extension Module

2006-09-20 Thread Travis E. Oliphant
goetzie wrote: > I am using Python 2.4.1 and Numeric 23.8 and running on Windows XP. I > am passing a Numeric array of strings (objects) to a C Extension module > using the following python code: Numeric 23.8 is *very* old and unsupported. Unless you absolutely have to use Numeric (then use 24

Re: new string method in 2.5 (partition)

2006-09-20 Thread Steve Holden
Irmen de Jong wrote: > Terry Reedy wrote: > >>"Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote in >>message news:[EMAIL PROTECTED] >> >>>Err... is it me being dumb, or is it a perfect use case for str.split ? >> >>s.partition() was invented and its design settled on as a result of looking >>at so

SciPy Optimization syntax

2006-09-20 Thread tkpmep
I'm trying to optimize a function using SciPy's optimize.fmin, but am clearly getting the syntax wrong, and would be grateful for some guiidance. First, here's the function def func(Y,x): """Y holds samples of a function sampled at t=-3,-2,-1,0,1,2,3. Y[3]=0 always. func return

How to evaluate the memory usage of a python program?

2006-09-20 Thread Daniel Mark
Hello all: I have a python program and would like to find out the maximum memory used by this program. Does Python provide such module so I could check it easily? Thank you -Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Mechanoid Web Browser - Recording Capability

2006-09-20 Thread alex_f_il
You can try SWExplorerAutomation (SWEA) (http:\\webunittesting.com). It works very well with the password protected sites. SWEA is .Net API, but you can use IronPython to access it. Seymour wrote: > I am trying to find a way to sign onto my Wall Street Journal account > (http://online.wsj.com/pub

Re: Looking for a reports module/project

2006-09-20 Thread hg
John Purser wrote: > Hello, > > I'm working on a script to gather data from our servers and then present > the data as part of daily maintenance. Pretty straight forward stuff. > However one of the limitations of an earlier design was presentation of > the data so I'm working to make this version

Re: Python regular expression question!

2006-09-20 Thread unexpected
> \b matches the beginning/end of a word (characters a-zA-Z_0-9). > So that regex will match e.g. MULTX-FOO but not MULTX-. > So is there a way to get \b to include - ? -- http://mail.python.org/mailman/listinfo/python-list

Re: new string method in 2.5 (partition)

2006-09-20 Thread Irmen de Jong
Terry Reedy wrote: > "Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote in > message news:[EMAIL PROTECTED] >> Err... is it me being dumb, or is it a perfect use case for str.split ? > > s.partition() was invented and its design settled on as a result of looking > at some awkward constructions in t

Re: Do we need to delete "ImageDraw.Draw" after using it?

2006-09-20 Thread John Bokma
"Daniel Mark" <[EMAIL PROTECTED]> wrote: > Is there any general rule that we must delete the object after using > it? In general: if the object is not destroyed when it goes out of scope (but later) and uses precious resources [1], or if a special clean up is required, you should delete it expl

Looking for a reports module/project

2006-09-20 Thread John Purser
Hello, I'm working on a script to gather data from our servers and then present the data as part of daily maintenance. Pretty straight forward stuff. However one of the limitations of an earlier design was presentation of the data so I'm working to make this version's report much clearer. I hate

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-20 Thread Ilias Lazaridis
George Sakkis wrote: > Ilias Lazaridis wrote: > > > I like to add a method "writeDebug(self, msg)" to all (or the most > > possible) classes in the system. > > > > How do I do this? > > > > * with new style classes > > * with old style classes > > Short answer: you can't do it for builtin or extens

Re: newbe's re question

2006-09-20 Thread Frederic Rentsch
[EMAIL PROTECTED] wrote: > Frederic Rentsch wrote: > >> [EMAIL PROTECTED] wrote: >> >>> All I am after realy is to change this >>> >>> reline = re.line.split('instr', '/d$') >>> >>> into something that grabs any line with instr in it take all the >>> numbers and then grab any comment that

unicode mystery/problem

2006-09-20 Thread Petr Jakes
Hi, I am using Python 2.4.3 on Fedora Core4 and "Eric3" Python IDE . Below mentioned code works fine in the Eric3 environment. While trying to start it from the command line, it returns: Traceback (most recent call last): File "pokus_1.py", line 5, in ? print str(a) UnicodeEncodeError: 'asc

Do we need to delete "ImageDraw.Draw" after using it?

2006-09-20 Thread Daniel Mark
Hello all: I am looking the sample code posted on PIL website http://www.pythonware.com/library/pil/handbook/imagedraw.htm <> import Image, ImageDraw im = Image.open("lena.pgm") draw = ImageDraw.Draw(im) draw.line((0, 0) + im.size, fill=128) dra

Re: byte count unicode string

2006-09-20 Thread Martin v. Löwis
willie schrieb: > Thank you for your patience and for educating me. > (Though I still have a long way to go before enlightenment) > I thought Python might have a small weakness in > lacking an efficient way to get the number of bytes > in a "UTF-8 encoded Python string object" (proper?), > but I've

Re: Nested Looping SQL Querys

2006-09-20 Thread Steve Holden
Dennis Lee Bieber wrote: [...] > # not conn.execute() ? That's what all the DB-API compliant adapters > use > > result = conn.execute(sql, params) > .execute() is a cursor method, not a connection method. Some DB API modules do implement it as a connection method, but that makes it impo

  1   2   >