Re: A new Internet-search website written in Python

2009-10-09 Thread John Nagle
hrg...@gmail.com wrote: The purpose of this email is to inform the Python-list mailing-list subscribers of an Internet-search website that is run by software written in Python. All the site seems to do is frame the results from other search engines. What does the Python code do?

Are there any modules for IRC, that work with Python 3.1?

2009-10-09 Thread TerryP
Does anyone know of any modules for dealing with the IRC protocol, that will work with Python 3.1? It doens't have to be super great, just less time consuming then playing with sockets directly (and obv. stable). The only module in my systems package manager is irclib for Python 2.6. I can live wit

Re: How to find number of line that is currently executing?

2009-10-09 Thread Chris Rebert
On Fri, Oct 9, 2009 at 8:46 PM, Dr. Phillip M. Feldman wrote: > > I would like to put a statement on line N of my program that prints the line > number that is currently executing. This may sound fairly trivial, but I > don't want to hard code the line number because N will change if lines are > i

How to find number of line that is currently executing?

2009-10-09 Thread Dr. Phillip M. Feldman
I would like to put a statement on line N of my program that prints the line number that is currently executing. This may sound fairly trivial, but I don't want to hard code the line number because N will change if lines are inserted or deleted above that point. Any advice will be appreciated. --

Re: Persistent Distributed Objects

2009-10-09 Thread bouncy...@gmail.com
Sorry about being interpreted as being vague. `et me try to narrow it down. program a creates objects b c d which each need to use 1 disk space 2 ram 3 processor time. I would like to create a heckpoint which would save the work of the object to be later used and then delete it from memory [whic

Re: Reading hex to int from a binary string

2009-10-09 Thread Jack Norton
Luc wrote: Hi all, I read data from a binary stream, so I get hex values as characters (in a string) with escaped x, like "\x05\x88", instead of 0x05. I am looking for a clean way to add these two values and turn them into an integer, knowing that calling int() with base 16 throws an invalid li

Poll on Eval in Python

2009-10-09 Thread Kazimir Majorinc
I am Lisp programmer and I write an article on issues as macros, fexprs and eval. I want to compare opinions of programmers of various programming languages on eval. If you want to contribute your opinion on eval in Python (or you want to look at result), the adress is: http://kazimirmajorinc.bl

Re: Need feedback on subprocess-using function

2009-10-09 Thread gb345
In Nobody writes: >You could always lift the code from Popen._communicate(), which uses >threads for Windows and select() for POSIX. Thanks. A lot of useful advice in your replies. G. -- http://mail.python.org/mailman/listinfo/python-list

Re: No threading.start_new_thread(), useful addition?

2009-10-09 Thread Ethan Furman
Christian Heimes wrote: Laszlo Nagy wrote: IMHO it is much cleaner to implement this as a decorator. Pro: transparent passing of positional and keyword arguments, keeps function documentation. You are entitled to your opinion but I STRONGLY recommend against your decorator. You MUST NOT sta

Re: "smtplib.SMTPServerDisconnected: please run connect() first"

2009-10-09 Thread kj
In Ethan Furman writes: >The line preceeding it, >s = smtplib.SMTP() >needs to have an e-mail server specified. E.g. >s = smtplib.SMTP('localhost') # from the 2.5 docs Perfect. Thanks! kynn -- http://mail.python.org/mailman/listinfo/python-list

Re: easy install

2009-10-09 Thread Ethan Furman
David Robinow wrote: On Fri, Oct 9, 2009 at 5:02 PM, Ethan Furman wrote: A puzzlement: I used easy_install the other day to get xlutils on my system. It automatically installed xlrd and xlwt as well. This is cool. What's not so cool are my tracebacks. E.g. Python 2.5.4 (r254:67916, Dec 2

Re: easy install

2009-10-09 Thread Gabriel Genellina
En Fri, 09 Oct 2009 21:49:46 -0300, Ethan Furman escribió: Besides missing the source lines, I was also wondering why the path in the traceback is showing incorrectly; I have the egg in c:\python25\Lib\site-packages, not where the trackback says I have it. In an effort to get it looking

Re: Reading hex to int from a binary string

2009-10-09 Thread Diez B. Roggisch
Luc schrieb: On Oct 9, 10:45 am, "Diez B. Roggisch" wrote: Luc schrieb: On Oct 8, 11:13 pm, "Diez B. Roggisch" wrote: Luc schrieb: Hi all, I read data from a binary stream, so I get hex values as characters (in a string) with escaped x, like "\x05\x88", instead of 0x05. I am looking for

Re: easy install

2009-10-09 Thread Ethan Furman
Robert Kern wrote: On 2009-10-09 19:08 PM, David Robinow wrote: On Fri, Oct 9, 2009 at 5:02 PM, Ethan Furman wrote: A puzzlement: I used easy_install the other day to get xlutils on my system. It automatically installed xlrd and xlwt as well. This is cool. What's not so cool are my tra

Re: organizing your scripts, with plenty of re-use

2009-10-09 Thread Carl Banks
On Oct 9, 4:37 pm, Buck wrote: > We don't have any such convention. The production code is at a well- > known path, but I need the code to be fully relocatable (cp -r /known/ > path ~/mydir) for testing purposes. > > Here's a scenario. A user does a cvs checkout into some arbitrary > directory and

Re: easy install

2009-10-09 Thread Robert Kern
On 2009-10-09 19:08 PM, David Robinow wrote: On Fri, Oct 9, 2009 at 5:02 PM, Ethan Furman wrote: A puzzlement: I used easy_install the other day to get xlutils on my system. It automatically installed xlrd and xlwt as well. This is cool. What's not so cool are my tracebacks. E.g. Python 2

Re: organizing your scripts, with plenty of re-use

2009-10-09 Thread Buck
On Oct 5, 8:12 pm, Steven D'Aprano wrote: > The Original Poster is confusing installation difficulties with code > organization -- his problem is that users have special requirements for > installation, and he's trying to work around those requirements by > organizing his code differently. I beli

Re: easy install

2009-10-09 Thread David Robinow
On Fri, Oct 9, 2009 at 5:02 PM, Ethan Furman wrote: > A puzzlement: > > I used easy_install the other day to get xlutils on my system.  It > automatically installed xlrd and xlwt as well.  This is cool.  What's not so > cool are my tracebacks.  E.g. > > Python 2.5.4 (r254:67916, Dec 23 2008, 15:10

python performance on Solaris

2009-10-09 Thread inaf
I have been following this group for quite some time and I figured (after searching enough on google --and on this group-- and not finding anything useful) I could pose this question here. Can anyone shed some light on python's performance on Solaris? My code seem to return lookups from a in memory

Re: organizing your scripts, with plenty of re-use

2009-10-09 Thread Buck
On Oct 5, 2:15 pm, "Rami Chowdhury" wrote: > On Mon, 05 Oct 2009 13:46:09 -0700, Buck wrote: > > Thanks. I think we're getting closer to the core of this. > > > To restate my problem more simply: > > > My core goal is to have my scripts in some sort of organization better > > than a single direct

Re: "smtplib.SMTPServerDisconnected: please run connect() first"

2009-10-09 Thread Ethan Furman
kj wrote: I'm getting the error: smtplib.SMTPServerDisconnected: please run connect() first when I run code that is essentially identical to the code given in http://docs.python.org/library/email-examples.html The error happens at the line (copied verbatim from the example linked to

easy install

2009-10-09 Thread Ethan Furman
A puzzlement: I used easy_install the other day to get xlutils on my system. It automatically installed xlrd and xlwt as well. This is cool. What's not so cool are my tracebacks. E.g. Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "cop

Re: No threading.start_new_thread(), useful addition?

2009-10-09 Thread Christian Heimes
Laszlo Nagy wrote: > IMHO it is much cleaner to implement this as a decorator. Pro: > transparent passing of positional and keyword arguments, keeps function > documentation. You are entitled to your opinion but I STRONGLY recommend against your decorator. You MUST NOT start threads a a side eff

"smtplib.SMTPServerDisconnected: please run connect() first"

2009-10-09 Thread kj
I'm getting the error: smtplib.SMTPServerDisconnected: please run connect() first when I run code that is essentially identical to the code given in http://docs.python.org/library/email-examples.html The error happens at the line (copied verbatim from the example linked to above): s.

Re: Python 2.5 execfile() works only once, why ?

2009-10-09 Thread Stef Mientki
thanks Carl, in the mean while I found a good working solution thorugh wx.Execute. cheers, Stef Carl Banks wrote: On Oct 9, 11:15 am, Stef Mientki wrote: hello, I'm working on a kind of IDE, to build and distribute Python programs. One of the parts is editing a build file for py2exe and

Re: package import dangers

2009-10-09 Thread Ethan Furman
Thanks to all for the answers! :) -- http://mail.python.org/mailman/listinfo/python-list

Re: No threading.start_new_thread(), useful addition?

2009-10-09 Thread Carl Banks
On Oct 8, 5:03 am, Ulrich Eckhardt wrote: > sturlamolden wrote: > > On 8 Okt, 09:17, Ulrich Eckhardt wrote: > > >> I'm looking at the 'threading' module and see that other than the > >> 'thread' module it doesn't have a simple function to start a new thread. > >> Instead, you first have to instan

Re: Python 2.5 execfile() works only once, why ?

2009-10-09 Thread Carl Banks
On Oct 9, 11:15 am, Stef Mientki wrote: > hello, > > I'm working on a kind of IDE, to build and distribute Python programs. > > One of the parts is editing a build file for py2exe and running the > modified script. > > In  the script editor I've an accelerator key, to launch these tasks: > - save

Re: Persistent Distributed Objects

2009-10-09 Thread Laszlo Nagy
I've seen evidence about this being done wrt what looks like insanely complex stuff on this list but I'm wondering if there is something to do this with any number of nodes and just farm out random classes/objects to them? Designing and opreating distributed systems is a complex thing. Esp

Re: No threading.start_new_thread(), useful addition?

2009-10-09 Thread Laszlo Nagy
I personally find it much cleaner this way. Also, why should any code care in which thread it is executed? Why should I have to derive a class from some other only because I want to run one of its functions in a separate thread? I think you are right! Especially that you can (and probably wi

Python 2.5 execfile() works only once, why ?

2009-10-09 Thread Stef Mientki
hello, I'm working on a kind of IDE, to build and distribute Python programs. One of the parts is editing a build file for py2exe and running the modified script. In the script editor I've an accelerator key, to launch these tasks: - save modified script file - run modified script file - cat

Re: Zip Question

2009-10-09 Thread Stephen Hansen
On Fri, Oct 9, 2009 at 11:04 AM, Victor Subervi wrote: > So, because the results in sstp were duplicates ( ['prescriptions', > 'prescriptions'] ) it only returned one result in the dict(zip()) statement. > Weird. Bug or feature? ;) > Thanks, > V Feature. zip() returned two results, but dictiona

Re: Zip Question

2009-10-09 Thread Victor Subervi
So, because the results in sstp were duplicates ( ['prescriptions', 'prescriptions'] ) it only returned one result in the dict(zip()) statement. Weird. Bug or feature? ;) Thanks, V On Fri, Oct 9, 2009 at 12:37 PM, Stephen Hansen wrote: > > > Changing the line: >> subtypes = dict(zip(sstp, sst))

Re: Is pythonic version of scanf() or sscanf() planned?

2009-10-09 Thread Joshua Kugler
ryniek90 wrote: > So maybe someone, someday decide to > put in Python an alternative, really great implementation of scanf() ? My idea of a "great scanf() function" would be a clever combination of re.match(), int(), and float(). j -- http://mail.python.org/mailman/listinfo/python-list

Re: Zip Question

2009-10-09 Thread Stephen Hansen
Changing the line: > subtypes = dict(zip(sstp, sst)) > to: > subtypes = dict(zip(sst, sstp)) > as I believe Stephen misread it to be causes the zip operation to return: > [('doctors', 'prescriptions'), ('patient', 'prescriptions')] > and thus the dict will contain: > {'patient': 'prescriptions', '

Re: Zip Question

2009-10-09 Thread Victor Subervi
You're right...how strange. Here's the whole code: tables = [] bst = [] bdt = [] spt = [] sst = [] sstp = [] cursor.execute('show tables;') all = cursor.fetchall() for a in all: tables.append(a[0]) for table in tables: if table[0] == 'b': # This is a basic table i

Re: Zip Question

2009-10-09 Thread Chris Kaynor
On Fri, Oct 9, 2009 at 10:10 AM, Stephen Hansen wrote: > > > On Fri, Oct 9, 2009 at 10:02 AM, Victor Subervi > wrote: > >> Hi; >> I have the following code: >> >> elif table[0] == 't': # This is a store subtype table >> bits = string.split(table, '0') >> sst.append(bits[2]) >>

Re: Zip Question

2009-10-09 Thread Stephen Hansen
On Fri, Oct 9, 2009 at 10:02 AM, Victor Subervi wrote: > Hi; > I have the following code: > > elif table[0] == 't': # This is a store subtype table > bits = string.split(table, '0') > sst.append(bits[2]) > sstp.append(bits[1]) > subtypes = dict(zip(sstp, sst)) > > When I pr

Zip Question

2009-10-09 Thread Victor Subervi
Hi; I have the following code: elif table[0] == 't': # This is a store subtype table bits = string.split(table, '0') sst.append(bits[2]) sstp.append(bits[1]) subtypes = dict(zip(sstp, sst)) When I print these out to screen, I get this: sst: ['doctors', 'patient'] sstp: ['

Re: Nested Menus

2009-10-09 Thread Victor Subervi
Well, as sometimes happens, the response to Dennis' response caught my attention (out of context) and I didn't notice Dennis' response! Thanks for bringing it to my attention. I will look at it tonight, and follow-up tomorrow after I've had a chance to digest it and work with it. (And thank you Den

Re: Reading hex to int from a binary string

2009-10-09 Thread Luc
On Oct 9, 10:45 am, "Diez B. Roggisch" wrote: > Luc schrieb: > > > > > On Oct 8, 11:13 pm, "Diez B. Roggisch" wrote: > >> Luc schrieb: > > >>> Hi all, > >>> I read data from a binary stream, so I get hex values as characters > >>> (in a string) with escaped x, like "\x05\x88", instead of 0x05. >

Re: Python CherryPy TurboGears 2 project support needed [in Belgium]

2009-10-09 Thread b...@creue-consulting
Diez, Thanks for pointing this out. It maybe that we are talking about TG 1.1 in that case. I will double check with the TA. Sorry for any confusion! - I'll let you know. Thanks again. Cheers, Ben On Oct 9, 3:36 pm, "Diez B. Roggisch" wrote: > b...@creue-consulting schrieb: > > > Dear comp.l

Re: Nested Menus

2009-10-09 Thread Stephen Hansen
On Fri, Oct 9, 2009 at 7:13 AM, Victor Subervi wrote: > Hmm. I didn't bother to look at the "comparison post". The indenting looks > right to me. I reread my post and I believe my question is straight-forward. > The crux of the issue is my sentence at the bottom. I believe that details > what my o

Re: "cx_Freeze.freezer.ConfigError: no initscript named Console"

2009-10-09 Thread ici
On Oct 1, 2:19 pm, John wrote: > cx_freeze v4.01 > Python 2.6 > Ubuntu Jaunty > > Following the example of 'cx-freeze hello.py', I'm getting the error > message below. I put all of the error keywords into google and found no > hits. > > Some people in various posts have said to use Python 2.5 but

Re: Python CherryPy TurboGears 2 project support needed [in Belgium]

2009-10-09 Thread Diez B. Roggisch
b...@creue-consulting schrieb: Dear comp.lang.python users, Firstly, this a is a Job post for a on-site Freelance Python Job in Belgium, I know this is frowned upon by some, so I am very sorry if it is not well received, but as it is such a great job, I have been encouraged to post this to the l

Re: Nested Menus

2009-10-09 Thread Victor Subervi
Hmm. I didn't bother to look at the "comparison post". The indenting looks right to me. I reread my post and I believe my question is straight-forward. The crux of the issue is my sentence at the bottom. I believe that details what my objective is. Not sure what I should do here. I hope you can cla

Re: save windows clipboard content temporarily and restore later

2009-10-09 Thread kakarukeys
On Oct 9, 11:30 am, Neil Hodgson wrote: > kakarukeys: > > > Restoring the data with that format could result in information loss, > > for example when HTML text is saved in ordinary text format. There is > > no format that could preserve 100% of any kind of clipboard content. > > > Does anyone has

Re: mxDateTime history (Re: mktime, how to handle dates before 01-01-1970 ?)

2009-10-09 Thread Tim Chase
Month arithmetic is a bit of a mess, since it's not clear how to map e.g. Jan 31 + one month. "Jan 31 + one month" usually means "add one to the month value and then keep backing off the day if you get an exception making the date", so you'd get Feb 31, exception, Feb 30, exception, Feb 29, p

Re: Tree Structure

2009-10-09 Thread r
On Oct 9, 5:02 am, Girish wrote: > Is there any python class to display the drive and folder structure as > a tree(As you see in the windows explorer window)?? You could use a recursive function to print it out of course or you will need to use a GUI kit. wxPython has a tree widget, i think TIX

Re: Plotting multiple datasets with gnuplot

2009-10-09 Thread Gabriel Genellina
En Fri, 09 Oct 2009 06:36:45 -0300, Rob Garrett escribió: I'm trying to get gnuplot to display multiple data series on a single plot using gnuplot in python. I've searched around and haven't found a solution to how to do this when I have a variable-length list of plots to add. For example,

mxDateTime history (Re: mktime, how to handle dates before 01-01-1970 ?)

2009-10-09 Thread M.-A. Lemburg
John Yeung wrote: > On Oct 6, 4:10 pm, Stef Mientki wrote: >> >> thanks guys, >> mx works a bit better > > Another popular Python date library is dateutil: > > http://labix.org/python-dateutil > > It gives a certain amount of credit to mxDateTime (praising it but not > being very clear

Tree Structure

2009-10-09 Thread Girish
Hello, Is there any python class to display the drive and folder structure as a tree(As you see in the windows explorer window)?? Thanks, Girish.. -- http://mail.python.org/mailman/listinfo/python-list

Plotting multiple datasets with gnuplot

2009-10-09 Thread Rob Garrett
Hi, I'm trying to get gnuplot to display multiple data series on a single plot using gnuplot in python. I've searched around and haven't found a solution to how to do this when I have a variable-length list of plots to add. For example, the following code will work: plotData1 = Gnuplot.PlotItems

Re: Reading hex to int from a binary string

2009-10-09 Thread Diez B. Roggisch
Luc schrieb: On Oct 8, 11:13 pm, "Diez B. Roggisch" wrote: Luc schrieb: Hi all, I read data from a binary stream, so I get hex values as characters (in a string) with escaped x, like "\x05\x88", instead of 0x05. I am looking for a clean way to add these two values and turn them into an intege

Re: Most "active" coroutine library project?

2009-10-09 Thread Denis
On Sep 23, 10:58 pm, Brian Hammond wrote: > On Aug 25, 12:51 am, Denis wrote: > > > You can also atgevent > > >http://pypi.python.org/pypi/gevent > > Please, please document this!  There are a lot of people who would > love to use this but give up when they don't find a guide or something > simil

Re: Tkinter -- the best way to make a realtime loop

2009-10-09 Thread eb303
On Oct 8, 7:15 pm, J Wolfe wrote: > Thank you both for your replies. I had something similar to this: > > def incr(): > var.set(1 + var.get()) > root.after(1000, incr) > > except I had an extra set of parenthesis... > def incr(): > var.set(1 + var.get()) > root.after(1000, incr()) > > on

Re: web sound recording with python

2009-10-09 Thread Michel Claveau - MVP
Hi! On windows, you can record sound who play on the local sound-card. It is not really Python scripting, but Python can launch it. @+ -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: save windows clipboard content temporarily and restore later

2009-10-09 Thread Neil Hodgson
kakarukeys: > Restoring the data with that format could result in information loss, > for example when HTML text is saved in ordinary text format. There is > no format that could preserve 100% of any kind of clipboard content. > > Does anyone has a brilliant solution? Enumerate all the clipbo

Re: mktime, how to handle dates before 01-01-1970 ?

2009-10-09 Thread Ben Finney
John Yeung writes: > I think the choice of epoch is not a big deal, once you pick one far > enough back. Ben Finney's suggestion to use 4004 BCE is not > appreciably different (computationally) from JDN. (Though I will say > that the Wikipedia link he provided doesn't mention 4004 BCE, and if > a

save windows clipboard content temporarily and restore later

2009-10-09 Thread kakarukeys
Is there a way to: 1. save windows clipboard content temporarily in a variable 2. (the clipboard content is then overwritten by some other applications) 3. restore the saved data back into the clipboard. ? I've tried win32clipboard's GetClipboardData, SetClipboardData. The GetClipboardData metho

Help configuring Lamson. Multiple domains on one box

2009-10-09 Thread wattka
Is there anybody here that can help me out with some configuration issues concerning using the Lamson mail server(http:// lamsonproject.org/)? 1. I would like to use it as my main MTA 2. I would like it to mange 3 domains on one box Thanks -- http://mail.python.org/mailman/listinfo/python-list

Reading hex to int from a binary string

2009-10-09 Thread Luc
Hi all, I read data from a binary stream, so I get hex values as characters (in a string) with escaped x, like "\x05\x88", instead of 0x05. I am looking for a clean way to add these two values and turn them into an integer, knowing that calling int() with base 16 throws an invalid literal excepti

Google, Bing search api wrappers for python

2009-10-09 Thread Vitaly Babiy
Does any one know of a good wrappers for both of these search engines? There seem to a few but, wondering what people experience with them. Vitaly Babiy -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading hex to int from a binary string

2009-10-09 Thread Luc
On Oct 9, 3:12 am, Dennis Lee Bieber wrote: > On Thu, 8 Oct 2009 14:52:33 -0700 (PDT), Luc > declaimed the following in gmane.comp.python.general: > > > > > On Oct 8, 11:13 pm, "Diez B. Roggisch" wrote: > > > Luc schrieb: > > > > > Hi all, > > > > > I read data from a binary stream, so I get hex