Re: Optimization: Picking random keys from a dictionary and mutating values

2008-05-29 Thread Carl Banks
On May 28, 7:41 pm, blaine <[EMAIL PROTECTED]> wrote: > Hey everyone, > Just a friendly question about an efficient way to do this. Friendly advance reminder: in many optimization problems, the objective function is far more expensive to calculate than the optimizing procedure. Your time is usu

Anyone using TestNG

2008-05-29 Thread kanarya
-- http://mail.python.org/mailman/listinfo/python-list

Re: How to get all the variables in a python shell

2008-05-29 Thread A.T.Hofkamp
On 2008-05-29, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi! > > I'm currently working on a scientific computation software built in > python. > What I want to implement is a Matlab style command window <-> > workspace interaction. ok, although I personally favor the style of writing and runn

How do I tell "imconplete input" from "valid input"?

2008-05-29 Thread たか
Hi everyone, I am developing the console which has the embedded Python interactive interpreter. So, I want to judge whether current command is complete or not. Below is good example to solve this problem. // // http://effbot.org/pyfaq/how-do-i-tell-incomplete-input-from-invalid-input.htm // int

Re: Struct usages in Python

2008-05-29 Thread Alex Gusarov
> > Yes. That is the somewhat unfortunate difference between new-style and > old-style classes. Use new-style if you can, and that means that "object" > must be part of the inheritance graph. > ... > You are wrong for Python 2.X, but right for Python 3 where old-style > classes are gone for good.

Re: Python and Flaming Thunder

2008-05-29 Thread Duncan Booth
Dave Parker <[EMAIL PROTECTED]> wrote: > Catch doesn't return just error types or numbers, it can return any > object returned by the statements that are being caught; catch doesn't > care what type they are. For example: > > Writeline catch(set x to "hello world".). > > will write "hello wor

Re: Struct usages in Python

2008-05-29 Thread Alex Gusarov
> > Yes. That is the somewhat unfortunate difference between new-style and > old-style classes. Use new-style if you can, and that means that "object" > must be part of the inheritance graph. > ... > You are wrong for Python 2.X, but right for Python 3 where old-style > classes are gone for good.

Re: Struct usages in Python

2008-05-29 Thread Alex Gusarov
> Yes. That is the somewhat unfortunate difference between new-style and > old-style classes. > Use new-style if you can, and that means that "object" must be part of the > inheritance graph. ... >You are wrong for Python 2.X, but right for Python 3 where old-style > >classes are gone f

Re: pydb remote debugging/cmd.Cmd over socket?

2008-05-29 Thread Diez B. Roggisch
As part of the 2006 Google Summer of Code project Matt Flemming started working on remote debugging in pydb. Alas it wasn't completed and I let the code fall through the cracks. Matt claimed it worked to some degree but I could never get it to work for me. Most definitely the code has atrophied

code of a function

2008-05-29 Thread Dark Wind
Hi, Is there any command in Python which gives the code for a function like just typing the name of a function (say svd) in R returns its code. Thank you -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get all the variables in a python shell

2008-05-29 Thread Tim Golden
[EMAIL PROTECTED] wrote: I'm currently working on a scientific computation software built in python. What I want to implement is a Matlab style command window <-> workspace interaction. For example, you type 'a=1' in the command window, and you see a list item named 'a' in the workspace. You dou

Re: unittest: Calling tests in liner number order

2008-05-29 Thread Antoon Pardon
On 2008-05-24, Fuzzyman <[EMAIL PROTECTED]> wrote: > > A worthwhile question for the OP - your patch seems fairly simple. Is > it easy for you to extend unittest for your own testing needs by > subclassing? I've been ill the last days, but I will look into this possibility. -- Antoon Pardon -- h

run a script in vista

2008-05-29 Thread Graham Feeley
Hi, I have a script which runs in xp, however now I have upgraded to vista this script now does'nt work Can someone help with this problem please ? this is the start of the script import cPAMIE import cModalPopUp import winGuiAuto as wga import time, datetime import os, sys, re import mx.ODBC.Wi

Finding file details...

2008-05-29 Thread Kalibr
I've been trying to figure out how to find the details of files (specifically music for now) for a little sorting script I'm making, My aim is to get details on the artist, album, and genre for mp3 and wma files (possibly more in the future). My closest match was when I stumbled accross PyMedia, bu

Re: run a script in vista

2008-05-29 Thread Tim Golden
Graham Feeley wrote: Hi, I have a script which runs in xp, however now I have upgraded to vista this script now does'nt work Can someone help with this problem please ? this is the start of the script import cPAMIE import cModalPopUp import winGuiAuto as wga import time, datetime import os, sys

Re: code of a function

2008-05-29 Thread Gary Herron
Dark Wind wrote: Hi, Is there any command in Python which gives the code for a function like just typing the name of a function (say svd) in R returns its code. Thank you Nope. -- http://mail.python.org/mailman/list

Compare 2 files and discard common lines

2008-05-29 Thread loial
I have a requirement to compare 2 text files and write to a 3rd file only those lines that appear in the 2nd file but not in the 1st file. Rather than re-invent the wheel I am wondering if anyone has written anything already? -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I tell "imconplete input" from "valid input"?

2008-05-29 Thread Inyeol . Lee
On May 29, 9:26 am, たか <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I am developing the console which has the embedded Python interactive > interpreter. So, I want to judge whether current command is complete > or not. Below is good example to solve this problem. > // > //http://effbot.org/pyfaq/

Re: code of a function

2008-05-29 Thread Anand Patil
On Thu, May 29, 2008 at 9:10 AM, Dark Wind <[EMAIL PROTECTED]> wrote: > Hi, > > Is there any command in Python which gives the code for a function like > just typing the name of a function (say svd) in R returns its code. > > Thank you > If you're using IPython, you can type svd?? . -- http://mai

Re: Compare 2 files and discard common lines

2008-05-29 Thread Chris
On May 29, 10:36 am, loial <[EMAIL PROTECTED]> wrote: > I have a requirement to compare 2 text files and write to a 3rd file > only those lines that appear in the 2nd file but not in the 1st file. > > Rather than re-invent the wheel I am wondering if anyone has written > anything already? How larg

Re: Compare 2 files and discard common lines

2008-05-29 Thread Stefan Behnel
loial wrote: > I have a requirement to compare 2 text files and write to a 3rd file > only those lines that appear in the 2nd file but not in the 1st file. lines_in_file2 = set(open("file2").readlines()) for line in open("file1"): if line not in lines_in_file2: print line

Re: Compare 2 files and discard common lines

2008-05-29 Thread Stefan Behnel
Kalibr wrote: > On May 29, 6:36 pm, loial <[EMAIL PROTECTED]> wrote: >> I have a requirement to compare 2 text files and write to a 3rd file >> only those lines that appear in the 2nd file but not in the 1st file. >> >> Rather than re-invent the wheel I am wondering if anyone has written >> anythin

Re: Compare 2 files and discard common lines

2008-05-29 Thread Kalibr
On May 29, 6:36 pm, loial <[EMAIL PROTECTED]> wrote: > I have a requirement to compare 2 text files and write to a 3rd file > only those lines that appear in the 2nd file but not in the 1st file. > > Rather than re-invent the wheel I am wondering if anyone has written > anything already? You can u

请教,关于Python对多处理器的支持,Pyth on在AIX下但CPU的效率比多CPU的效率高?

2008-05-29 Thread Cyril.Liu
最近在公司在优化平台(C + Python实现的一个业务处理框架:C实现的一个网络服务接受来自外界的请求,收到请求后创建一个进程调用Python解释器执行Python脚本进行业务逻辑处理)发现Python脚本在 AIX下多处理器环境下运行的效率还不如在单处理器环境下的运行效率。我觉得这个跟GIL有关系,但我们的Python脚本里用的基本上都是Python自带的lib做一些简单的业务逻辑处理和数据库操作(DB2, 数据库操作模块是我们用C实现的一套DB API) 且没有用多线程。这似乎不应该出现处理器增多而性能下降的抖动现象啊。请问大家是否有着方面的经验,分享一下。谢谢! 另外问一下,Pyth

Re: Finding file details...

2008-05-29 Thread Tim Golden
Kalibr wrote: I've been trying to figure out how to find the details of files (specifically music for now) for a little sorting script I'm making, My aim is to get details on the artist, album, and genre for mp3 and wma files (possibly more in the future). My closest match was when I stumbled acc

Re: code of a function

2008-05-29 Thread Christian Heimes
Dark Wind schrieb: > Hi, > > Is there any command in Python which gives the code for a function like just > typing the name of a function (say svd) in R returns its code. Yes, it's posible to retrieve the source code IFF the function is implemented in Python and the .py file is available, too. >

cmd.Cmd bug or at least docu-bug

2008-05-29 Thread Diez B. Roggisch
Hi, I'm fiddling around with module cmd. I tried to pass my own streams as replacements for stdin and stdout. However, stdin wasn't working. After a look into the sourcecode I discovered that there is an class-variable called use_rawinput that prevents using the passed stdin. I then read the do

Easy install / setuptools

2008-05-29 Thread Dominique.Holzwarth
Hi everyone I'm trying to figure out the "best" way to distribute my own python packages. Basicly, what I want is to have something like an "installer.exe" (on windows) which puts my package under Python/Lib/site-packages (so that it can be found via the PYTHONPATH). I've played around a bit w

Re: Custom log handler and logging.config.fileConfig()

2008-05-29 Thread Vinay Sajip
On May 28, 9:53 pm, "Lowell Alleman" <[EMAIL PROTECTED]> wrote: > Here is the situation: I wrote my own log handler class (derived > fromlogging.Handler) and I want to be able to use it from aloggingconfig > file, that is, a config file loaded with thelogging.config.fileConfig() > function. > >

Re: php vs python

2008-05-29 Thread Diez B. Roggisch
> A good OO programmer could easily write good functional code. You are aware that functional programming is *not* procedural or imperative programming? http://en.wikipedia.org/wiki/Functional_programming OO is *heavily* depending on state and state modification. I've seen OO programmers weep o

Re: How do I tell "imconplete input" from "valid input"?

2008-05-29 Thread たか
thanks for your reply. I tried below python codes with "Py_single_input" instead of "Py_file_input". sample 1 : result is INCOMPLETE for i in range(3):\n sample 2 : result is COMPLETE(I want to get INCOMPLETE or something) for i in range(3):\n\tprint i or for i in range(3):\n\tprint i\n "Py_

Re: Finding file details...

2008-05-29 Thread Kalibr
On May 29, 7:55 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > > You don't say, but I assume you're on Windows since you mention > GetFileVersionInfo (which doesn't have anything to do with media > files, by the way) and WMA. There may be packages out there > to do all this already but if not you'll n

Error: Cannot convert Decimal("0.0000") to Decimal

2008-05-29 Thread Vitaliy
Hi I got this wired exception periodically (Python 2.5, Django based application) what does it mean ? -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get all the variables in a python shell

2008-05-29 Thread Tim Golden
[EMAIL PROTECTED] wrote: I'm currently working on a scientific computation software built in python. What I want to implement is a Matlab style command window <-> workspace interaction. For example, you type 'a=1' in the command window, and you see a list item named 'a' in the workspace. You dou

Re: Any way to loop through object variables?

2008-05-29 Thread Dave Challis
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ah thanks, vars(...) was exactly what I was after. I'd come across dir() before, but this returns more than I need. Thanks again, Dave Saju Pillai wrote: > > On 28-May-08, at 9:49 PM, Gary Herron wrote: > >> Dave Challis wrote: >>> Hi, >>> Just wo

Re: Error: Cannot convert Decimal("0.0000") to Decimal

2008-05-29 Thread Peter Otten
Vitaliy wrote: > I got this wired exception periodically (Python 2.5, Django based > application) > what does it mean ? A reload() maybe? >>> import decimal >>> d = decimal.Decimal() >>> reload(decimal) >>> decimal.Decimal(d) Traceback (most recent call last): File "", line 1, in File "/us

RE: [python-win32] How to get all the variables in a python shell

2008-05-29 Thread Dahlstrom, Roger
-Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Golden > Sent: Thursday, May 29, 2008 4:11 AM > To: Python-Win32 List; python-list@python.org > Cc: Python-Win32 List > Subject: Re: [python-win32] How to get all the variables in a python shell > > [EM

Re: cmd.Cmd bug or at least docu-bug

2008-05-29 Thread Michele Simionato
On May 29, 11:26 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Hi, > > I'm fiddling around with module cmd. I tried to pass my own streams as > replacements for stdin and stdout. However, stdin wasn't working. After a > look into the sourcecode I discovered that there is an class-variable > c

Re: [python-win32] How to get all the variables in a python shell

2008-05-29 Thread Paul Moore
On 29/05/2008, Dahlstrom, Roger <[EMAIL PROTECTED]> wrote: > I'd try looking at memcached (http://www.danga.com/memcached/apis.html). > No hacking or reimplementation of the interpreter would be necessary, and > there's a Python api available. I haven't used it for anything production > related,

RE: [python-win32] How to get all the variables in a python shell

2008-05-29 Thread Dahlstrom, Roger
-Original Message- From: Paul Moore [mailto:[EMAIL PROTECTED] Sent: Thursday, May 29, 2008 7:23 AM To: Dahlstrom, Roger Cc: Python-Win32 List; python-list@python.org Subject: Re: [python-win32] How to get all the variables in a python shell On 29/05/2008, Dahlstrom, Roger <[EMAIL PROTECTE

Re: Compare 2 files and discard common lines

2008-05-29 Thread afrobeard
Another way of doing this might be to use the module difflib to calculate the differences. It has a sequence matcher under it which has the function get_matching_blocks difflib is included with python. On May 29, 2:02 pm, Chris <[EMAIL PROTECTED]> wrote: > On May 29, 10:36 am, loial <[EMAIL PROT

Unit tests?

2008-05-29 Thread Alex Gusarov
Hello, it seems that I have a problem - I almost finished my program and it's necessary to test it. But I've never do it before. I even don't know how I can do it. Please, give me some links to testing techniques, either common or specific to Python. I searched in Google for information, but 'cause

Re: Unit tests?

2008-05-29 Thread Arnaud Delobelle
"Alex Gusarov" <[EMAIL PROTECTED]> writes: > Hello, it seems that I have a problem - I almost finished my program > and it's necessary to test it. But I've never do it before. I even > don't know how I can do it. > Please, give me some links to testing techniques, either common or > specific to Py

Re: Compare 2 files and discard common lines

2008-05-29 Thread alex23
On May 29, 6:36 pm, loial <[EMAIL PROTECTED]> wrote: > I have a requirement to compare 2 text files and write to a 3rd file > only those lines that appear in the 2nd file but not in the 1st file. > > Rather than re-invent the wheel I am wondering if anyone has written > anything already? >>> file1

Re: [python-win32] How to get all the variables in a python shell

2008-05-29 Thread Tim Golden
Tim Golden wrote: [EMAIL PROTECTED] wrote: I'm currently working on a scientific computation software built in python. What I want to implement is a Matlab style command window <-> workspace interaction. For example, you type 'a=1' in the command window, and you see a list item named 'a' in the

Re: Unit tests?

2008-05-29 Thread Alex Gusarov
Thx, it's quite enough for a start. Yes, googling is almost ultimate answer for such questions, sorry for uneasiness. > Try googling "python unit test". I did it, and amongst the first hits > were: > >* docs.python.org/lib/module-unittest.html > >* http://www.diveintopython.org/unit_testi

Tuple of coordinates

2008-05-29 Thread [EMAIL PROTECTED]
Hi, i am using a software which uses python as its scripting language. I want to generate a list of coordinates more or less this way: for i in (beg, end, step): for j in (beg, end, step): for k in (beg, end, step): . Coords = ((i1,j1,k1), (i2,j2,k2), ...,(in,jn.kn)) Ca

Re: Tuple of coordinates

2008-05-29 Thread cokofreedom
a = 1, 2 b = 3, 4, 5 c = 6, 7, 8, 9 coord = list() for i, j, k in zip(a, b, c): coord.append((i, j, k)) print coord -- http://mail.python.org/mailman/listinfo/python-list

Reporting the line number of an exception

2008-05-29 Thread sophie_newbie
I'm sure this is exceedingly simple but I can't find it anywhere. When I catch an exception I would like to report the line number of the exception as well as the error info. try: someError() except Exception, e: "print_error_and_line_number" How do I find the line number? Thanks for any

Re: Strange thing with types

2008-05-29 Thread Diez B. Roggisch
TYR wrote: > I'm doing some data normalisation, which involves data from a Web site > being extracted with BeautifulSoup, cleaned up with a regex, then > having the current year as returned by time()'s tm_year attribute > inserted, before the data is concatenated with string.join() and fed > to ti

Re: Strange thing with types

2008-05-29 Thread alex23
On May 29, 11:09 pm, TYR <[EMAIL PROTECTED]> wrote: > I'm doing some data normalisation, which involves data from a Web site > being extracted with BeautifulSoup, cleaned up with a regex, then > having the current year as returned by time()'s tm_year attribute > inserted, before the data is concate

seg. fault with Py_BuildValue?

2008-05-29 Thread Christian Meesters
Hi I'm having trouble with Py_BuildValue. I was able to pinpoint the following statement as the one causing a seg. fault with my script: static PyObject * funcname(PyObject *self, PyObject *args) { ... return Py_BuildValue("(OO)", x, y); } where x & y are both of type PyObject. Any suggestions

Re: Tuple of coordinates

2008-05-29 Thread alex23
On May 29, 10:16 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > i am using a software which uses python as its scripting language. I > want to generate a list of coordinates more or less this way: > > for i in (beg, end, step): > for j in (beg, end, step): > for k in (b

Re: Reporting the line number of an exception

2008-05-29 Thread Peter Otten
sophie_newbie wrote: > I'm sure this is exceedingly simple but I can't find it anywhere. When > I catch an exception I would like to report the line number of the > exception as well as the error info. > > try: > someError() > except Exception, e: > "print_error_and_line_number" > > How

Re: [python-win32] How to get all the variables in a python shell

2008-05-29 Thread Tim Golden
[Bizarrely, my mail system seems to be randomly misfiring. If you've already seen this, please ignore!] Tim Golden wrote: Sorry, having seen Roger D's memcached suggestion, I realise I may have misinterpreted your requirement. I thought that you wanted a Python interpreter session to share its ob

Strange thing with types

2008-05-29 Thread TYR
I'm doing some data normalisation, which involves data from a Web site being extracted with BeautifulSoup, cleaned up with a regex, then having the current year as returned by time()'s tm_year attribute inserted, before the data is concatenated with string.join() and fed to time.strptime(). Here's

Re: seg. fault with Py_BuildValue?

2008-05-29 Thread Diez B. Roggisch
Christian Meesters wrote: > Hi > > I'm having trouble with Py_BuildValue. I was able to pinpoint the > following statement as the one causing a seg. fault with my script: > > static PyObject * funcname(PyObject *self, PyObject *args) { > ... > return Py_BuildValue("(OO)", x, y); > } > where x

Re: Any way to loop through object variables?

2008-05-29 Thread paul
Dave Challis schrieb: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ah thanks, vars(...) was exactly what I was after. I'd come across dir() before, but this returns more than I need. It seems vars() misses class attributes tho... cheers Paul -- http://mail.python.org/mailman/listinfo/pytho

Re: Tuple of coordinates

2008-05-29 Thread Benjamin Kaplan
On Thu, May 29, 2008 at 8:16 AM, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > Hi, > > i am using a software which uses python as its scripting language. I > want to generate a list of coordinates more or less this way: > > for i in (beg, end, step): > for j in (beg, end, step): > f

feedparser html sanitizion how-to disable it

2008-05-29 Thread sebey
ok so I know about why its good but I am building a website that imports rss feeds form external place in this case Talkshoe.com and feedparser seens to think that podcast.feed.description has html in it and same with podcast.entries[0].description so how can I disable it p.s. new to python so bab

Re: Finding file details...

2008-05-29 Thread Tim Golden
Kalibr wrote: On May 29, 7:55 pm, Tim Golden <[EMAIL PROTECTED]> wrote: You don't say, but I assume you're on Windows since you mention GetFileVersionInfo (which doesn't have anything to do with media files, by the way) and WMA. There may be packages out there to do all this already but if not y

boost

2008-05-29 Thread deepest1
Hi everybody. I'm trying to use boost, but just don't know how to set it up. My os is winXP (installed on disk D). Python is installed in D:\Python25 MigGW compiler is installed in D:\MinGW (i downloaded it because djgpp is making much more errors with bjam) I have downloaded boost_1_35_0.zip a

Re: seg. fault with Py_BuildValue?

2008-05-29 Thread Christian Meesters
> What happens if you get rid of the ()? Can't see any difference. -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange thing with types

2008-05-29 Thread TYR
On May 29, 2:23 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > TYR wrote: > > I'm doing some data normalisation, which involves data from a Web site > > being extracted with BeautifulSoup, cleaned up with a regex, then > > having the current year as returned by time()'s tm_year attribute > > i

Re: Strange thing with types

2008-05-29 Thread TYR
On May 29, 2:24 pm, alex23 <[EMAIL PROTECTED]> wrote: > On May 29, 11:09 pm, TYR <[EMAIL PROTECTED]> wrote: > > > > > I'm doing some data normalisation, which involves data from a Web site > > being extracted with BeautifulSoup, cleaned up with a regex, then > > having the current year as returned

adobe flex; return xml via turbogears/django

2008-05-29 Thread Sells, Fred
please excuse slightly off-topic; cannot access turbogears mailing list at the moment. There was an excellent video by James Ward that showed using turbogears to return json data to adoble's flex UI. It simply used @expose("JSON") def (): ... return dict(x=1, ...) Is there

Re: feedparser html sanitizion how-to disable it

2008-05-29 Thread sebey
oh sorry here is the rss feed I am using http://recordings.talkshoe.com/rss39293.xml -- http://mail.python.org/mailman/listinfo/python-list

Re: seg. fault with Py_BuildValue?

2008-05-29 Thread Christian Heimes
Christian Meesters schrieb: > Hi > > I'm having trouble with Py_BuildValue. I was able to pinpoint the following > statement as the one causing a seg. fault with my script: > > static PyObject * funcname(PyObject *self, PyObject *args) { > > return Py_BuildValue("(OO)", x, y); > } > where

Re: adobe flex; return xml via turbogears/django

2008-05-29 Thread Diez B. Roggisch
Sells, Fred wrote: > please excuse slightly off-topic; cannot access turbogears mailing list at > the moment. > > There was an excellent video by James Ward that showed using turbogears to > return json data to adoble's flex UI. It simply used > > @expose("JSON") > def (): > ... > return di

Re: BadStatusLine error

2008-05-29 Thread Jim
On May 28, 11:24 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Jim wrote: > > Hi > > > I get a BadStatusLine error (indicated below). Can anyone help with > > how to > > catch error in code before abort? > > http://docs.python.org/tut/node10.html > > Diez Thanks Diez docs help. Jim -- http:

Re: Finding file details...

2008-05-29 Thread Mike Driscoll
On May 29, 5:26 am, Kalibr <[EMAIL PROTECTED]> wrote: > On May 29, 7:55 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > > > > > > > You don't say, but I assume you're on Windows since you mention > > GetFileVersionInfo (which doesn't have anything to do with media > > files, by the way) and WMA. There

bit parsing from file

2008-05-29 Thread [EMAIL PROTECTED]
Hello, I'm tring to make a cutting script. The problem is the following, i have a sample pattern, for example :'11101110' (0xEE) That is the sign of the data begining. How can i cut a file if the byte stepping is not the same, for example: file=open('test.bin','rb') data=file.read() print binasci

Re: Python and Flaming Thunder

2008-05-29 Thread Dan Upton
On Thu, May 29, 2008 at 3:36 AM, Duncan Booth <[EMAIL PROTECTED]> wrote: > Dave Parker <[EMAIL PROTECTED]> wrote: > >> Catch doesn't return just error types or numbers, it can return any >> object returned by the statements that are being caught; catch doesn't >> care what type they are. For examp

Re: Custom log handler and logging.config.fileConfig()

2008-05-29 Thread Lowell Alleman
Is there any reason not to do this assignment in the "myhandler.py" directly? This would save a step for each application that needs to use it. Starting from your example, it would now look like this: # -- myhandler.py --- import logging.handlers class MySpecialHandler(logging.handlers.Rotating

mysqldb install problem

2008-05-29 Thread Tommy Grav
I am trying to install mysqldb-1.2.2 on my PPC running 10.5.2 and Activepython 2.5.1.1 when I get this error: running build running build_py copying MySQLdb/release.py -> build/lib.macosx-10.3-fat-2.5/MySQLdb running build_ext building '_mysql' extension gcc -isysroot /Developer/SDKs/MacOSX10.4

Re: code of a function

2008-05-29 Thread Anand Patil
On May 29, 2008, at 9:38 AM, Gary Herron wrote: Dark Wind wrote: Hi, Is there any command in Python which gives the code for a function like just typing the name of a function (say svd) in R returns its code. Thank you Nope. If you're using IPython, you can do svd?? . -- http://mail

Re: Python and Flaming Thunder

2008-05-29 Thread Duncan Booth
"Dan Upton" <[EMAIL PROTECTED]> wrote: > On Thu, May 29, 2008 at 3:36 AM, Duncan Booth ><[EMAIL PROTECTED]> wrote: >> Dave Parker <[EMAIL PROTECTED]> wrote: >> >>> Catch doesn't return just error types or numbers, it can return any >>> object returned by the statements that are being caught; catch

Re: Finding file details...

2008-05-29 Thread Roger Upole
Kalibr wrote: > I've been trying to figure out how to find the details of files > (specifically music for now) for a little sorting script I'm making, > My aim is to get details on the artist, album, and genre for mp3 and > wma files (possibly more in the future). My closest match was when I > stu

Re: Tuple of coordinates

2008-05-29 Thread Gary Herron
[EMAIL PROTECTED] wrote: Hi, i am using a software which uses python as its scripting language. I want to generate a list of coordinates more or less this way: for i in (beg, end, step): for j in (beg, end, step): for k in (beg, end, step): . Coords = ((i1,j1,k1), (i2,j

Re: boost

2008-05-29 Thread Ulrich Eckhardt
deepest1 wrote: > bjam --build-dir="D:\Program Files\boost_1_35_0" --toolset=gcc stage > > I got 12 failures and 8 warnings from this (other few hundrds were ok) Hmm, I remember trying to use Boost 1.35 with Python 2.5 on my Debian system and also having problems, are you sure that at least the P

[OT] Re: FW: php vs python

2008-05-29 Thread J. Cliff Dyer
On Thu, 2008-05-29 at 08:47 +1200, Phil Runciman wrote: > The Inuit have 13 terms for snow. Microsoft advocate DSLs. Why have > DSLs > if language does not matter? > For that matter, the English have several terms for snow as well. snow flurry blizzard powder pack flakes crystals sleet slush An

should I put old or new style classes in my book?

2008-05-29 Thread allendowney
Hi All, I am working on a revised edition of How To Think Like a Computer Scientist, which is going to be called Think Python. It will be published by Cambridge University Press, but there will still be a free version under the GNU FDL. You can see the latest version at thinkpython.com; I am rev

Re: ctypes, function pointers and a lot of trouble

2008-05-29 Thread Matt
Okay, thanks a lot for your reply Nick, I think you pushed me back on the right way. Now I started with trying to implement the callback functions and am stuck at the following point: I define my classes/structures/unions: --CODE---

Re: should I put old or new style classes in my book?

2008-05-29 Thread Matthieu Brucher
Hi, New style classes should be put as the default. This is what I did, based on the principle that new classes were introduces in Python 2.2 and that we are now at 2.5 and soon 2.6. Tutorials that use old style classes may be old and perhaps won't be updated ever. That's not a problem. Just tell

Re: bit parsing from file

2008-05-29 Thread Mensanator
On May 29, 9:42�am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hello, > > I'm tring to make a cutting script. > The problem is the following, i have a sample pattern, for > example :'11101110' (0xEE) > That is the sign of the data begining. > How can i cut a file if the byte stepping is not t

Re: bit parsing from file

2008-05-29 Thread [EMAIL PROTECTED]
On máj. 29, 18:26, Mensanator <[EMAIL PROTECTED]> wrote: > On May 29, 9:42�am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > > > > Hello, > > > I'm tring to make a cutting script. > > The problem is the following, i have a sample pattern, for > > example :'11101110' (0xEE) > > That is the

yum installs Tkinter in a way visible to only one python installation

2008-05-29 Thread Rahul
My RHEL yum package-manager comes with Python-2.4.3. We also have a seperate Python-2.4.4 Installation on our box. When I added Tkinter using 'yum install tkinter' it seems to have added it in a manner that it is exclusively visible to Python-2.4.3. I cannot import Tkinter from Python-2.4.4.

Re: Threads and import

2008-05-29 Thread Rhamphoryncus
On May 28, 1:14 pm, [EMAIL PROTECTED] wrote: > Hi, > > I'm trying to work out some strange (to me) behaviour that I see when > running a python script in two different ways (I've inherited some > code that needs to be maintained and integrated with another lump of > code). The sample script is: > >

Re: Custom log handler and logging.config.fileConfig()

2008-05-29 Thread Vinay Sajip
On 29 May, 15:53, "Lowell Alleman" <[EMAIL PROTECTED]> wrote: > Is there any reason not to do this assignment in the "myhandler.py" > directly? This would save a step for each application that needs to > use it. > > Starting from your example, it would now look like this: > > # -- myhandler.py ---

undocumented functions in pkgutil

2008-05-29 Thread Michele Simionato
I see that the pkgutil module has many useful functions which are however undocumented. Does anybody know why it is so? In particolar, can I safely use pkg.walk_packages without risking a change of interface in the future? I looks unlikely, since pkgutil is used in setuptools, but I want to be sure

Re: should I put old or new style classes in my book?

2008-05-29 Thread Benjamin Kaplan
On Thu, May 29, 2008 at 12:07 PM, <[EMAIL PROTECTED]> wrote: > Hi All, > > I am working on a revised edition of How To Think Like a Computer > Scientist, > which is going to be called Think Python. It will be published by > Cambridge > University Press, but there will still be a free version unde

RE: adobe flex; return xml via turbogears/django

2008-05-29 Thread Sells, Fred
Diez wrote: > Why don't you create KID-template like this: > > ${root} > > and in the controller say > > @expose("thexmltemplate") > def ... >return dict(root=myElementTreeRoot) > sounds good. Does that "py:strip" remove the and anything outside it. I'll be doing a flex style ajax call

Re: should I put old or new style classes in my book?

2008-05-29 Thread Jason
On May 29, 10:07 am, [EMAIL PROTECTED] wrote: > Hi All, > > I am working on a revised edition of How To Think Like a Computer > Scientist, > which is going to be called Think Python. It will be published by > Cambridge > University Press, but there will still be a free version under the GNU > FDL.

Saving tif file from tricky webserver

2008-05-29 Thread schweet1
Greetings, I am attempting to automate accessing and saving a file (a TIF) from the following URL: http://patimg1.uspto.gov/.DImg?Docid=US007376435&PageNum=1&IDKey=E21184B8FAD5 I have tried some methods using urllib, httplib, and web32com.client(InternetExplorer), but haven't been successful. Cu

MACOSX_DEPLOYMENT_TARGET mismatch bug on Leopard using system Python

2008-05-29 Thread Anand Patil
Hi all, I'm getting error messages like distutils.errors.DistutilsPlatformError: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.3" but "10.5" during configure on Leopard using system Python when trying to build a third-party module. Can this be fixed without installing a different distributio

NYC Python User Group Meeting Announcement....

2008-05-29 Thread John Clark
Greetings! The next New York City Python Users Group meeting is planned for June 17th, 6:30pm at Daylife Inc. at 444 Broadway (between Howard St. and Grand St.) on the 5th Floor. We welcome all those in the NYC area who are interested in Python to attend. More information can be found on the us

so funny...

2008-05-29 Thread John
http://sitscape.com/topic/funny Just keep hit the "Surprise->" button there for amazing fun. Click on "channel" will show you other topics, lots of fun! -- http://mail.python.org/mailman/listinfo/python-list

Python threads and memory usage

2008-05-29 Thread Mike
Hi, I'm writing client-server application in Python. It's monitoring system, where server listen and waits for TCP connections, and every connection takes own thread. Every thread puts data from clients to Queue and exits. Then there is one DB loader thread, which loads all data from Queue to MySQ

Re: accessing class attributes

2008-05-29 Thread eliben
On May 29, 3:08 am, Matimus <[EMAIL PROTECTED]> wrote: > > I have a game class, and the game has a state. Seeing that Python has > > no enumeration type, at first I used strings to represent states: > > "paused", "running", etc. But such a representation has many > > negatives, so I decided to look

Remote Debugging for python.

2008-05-29 Thread nkarkhan
Newbie to python here..so bear with me. I used to be able to gdb to a target machine running c/c++ code and see where my program was hanging, crashing, executing.. How do I do that with python? I have multi-threaded python programs running on a remote machine. I want to se where they are at any i

  1   2   >