Re: Python compiled on Windows

2007-02-06 Thread Franz Steinhaeusler
On Mon, 05 Feb 2007 12:17:48 +0100, hg <[EMAIL PROTECTED]> wrote: >Duncan Booth wrote: > >> Franz Steinhaeusler <[EMAIL PROTECTED]> wrote: >> >>> Hello, I'm only curious. >>> >>> Why is Python and most extension (also wxPython) not built using an >>> open source compiler like gcc or g++ on Windo

Re: Taint (like in Perl) as a Python module: taint.py

2007-02-06 Thread Paul Rubin
"Gabriel Genellina" <[EMAIL PROTECTED]> writes: > I'm not convinced at all of the usefulness of tainting. > How do you "untaint" a string? By checking some conditions? In perl? I don't think you can untaint a string, but you can make a new untainted string by extracting a regexp match from the ta

Re: Calling J from Python

2007-02-06 Thread Gosi
On Feb 6, 3:04 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Feb 5, 8:48 am, "Gosi" <[EMAIL PROTECTED]> wrote: > > > It is quite easy to call J from Python > > >http://groups.google.com/group/J-Programming/browse_thread/thread/5e8... > > There are a couple of issue that should be adressed

Re: Count nb call of a function, without global var or decorator

2007-02-06 Thread Duncan Booth
"Méta-MCI" <[EMAIL PROTECTED]> wrote: > Example, with meta-data (attributs of function) : > > def ff(this): > try: > this.count=this.count+1 > except: > this.count=1 > a=1 > b=2 > c=a+b > > ff(ff) > fa=ff > ff(ff) > fa(fa) > print ff.count > > > > How to im

Re: problems loading modules

2007-02-06 Thread Frank
Thanks guys! -- http://mail.python.org/mailman/listinfo/python-list

Re: Python compiled on Windows

2007-02-06 Thread Duncan Booth
Franz Steinhaeusler <[EMAIL PROTECTED]> wrote: > @Duncan: Yes, you are not wrong! :) > But this is not really open source in my opinion. > Ok there is the VC++ toolkit for download. Which I agree totally is a real pain finding the right versions to download. > > I'm just curious, if there ever

Re: HTMLParser's start_tag method never called ?

2007-02-06 Thread ychaouche
On 29 jan, 16:45, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > ychaouche wrote: > > Hi, python experts. > > > > > [EMAIL PROTECTED]:~/TEST$ python nettoyageHTML.py > > [EMAIL PROTECTED]:~/TEST$ > > > > > This is the nettoyageHTML.py python script > > > > > fromHTMLParserimportHTMLParser > > >

Re: Python compiled on Windows

2007-02-06 Thread Franz Steinhaeusler
On 6 Feb 2007 08:35:08 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote: >Franz Steinhaeusler <[EMAIL PROTECTED]> wrote: > >> @Duncan: Yes, you are not wrong! :) >> But this is not really open source in my opinion. >> Ok there is the VC++ toolkit for download. > >Which I agree totally is a real pain fi

Re: Finding cpu time spent on my program

2007-02-06 Thread Nick Craig-Wood
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Feb 5, 2:37 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > I am trying to measure the time the processor spends on some > > operation, and I want this measure to not depend on the current load > > of the machine. > > One of the best wa

Re: Taint (like in Perl) as a Python module: taint.py

2007-02-06 Thread Johann C. Rocholl
On Feb 6, 3:01 am, Ben Finney <[EMAIL PROTECTED]> wrote: > "Gabriel Genellina" <[EMAIL PROTECTED]> writes: > > And tainted() returns False by default? > > Sorry but in general, this won't work :( > > I'm inclined to agree that the default should be to flag an object as > tainted unless known ot

How to prevent from race conditions to share data between many process and thread in python

2007-02-06 Thread mars
I use TurboGears to do some web service. TurboGears use cherrypy. When web browser access this site, the cherrypy will call my python program. So my program looks like a lib. When web browser access the site, the http server will fock a process or gerenate a thread. I need share some data or operat

Re: Calling J from Python

2007-02-06 Thread Gerard Flanagan
On Feb 5, 3:48 pm, "Gosi" <[EMAIL PROTECTED]> wrote: > It is quite easy to call J from Python > > http://groups.google.com/group/J-Programming/browse_thread/thread/5e8... As I understand it, the k language, which is similar to J, is used to interact with streamed realtime financial data, where I i

Re: How to suppress "DeprecationWarning: Old style callback, use cb_func(ok, store) instead"

2007-02-06 Thread Thomas Bellman
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sat, 03 Feb 2007 07:35:22 -0300, Peter Otten <[EMAIL PROTECTED]> > escribió: >> #!/usr/bin/env python2.5 >> >> python2.5 will be that single argument and no options are possible at >> all. >> What might be the reasons for such a seemingly ar

Re: How to prevent from race conditions to share data between many process and thread in python

2007-02-06 Thread Diez B. Roggisch
mars wrote: > I use TurboGears to do some web service. TurboGears use cherrypy. When > web browser access this site, the cherrypy will call my python > program. So my program looks like a lib. When web browser access the > site, the http server will fock a process or gerenate a thread. I need > sh

XMLRPC Server

2007-02-06 Thread viscanti
Hi, I'm trying to create an XMLRPC server using apache + python (cgi). It's not too difficult to configure everything, but I would like to tune it in order to receive up to 2000 calls per minute without any problems. Do Pthon CGIs use threading? I need to make it very efficient, but I haven't found

Re: HTMLParser's start_tag method never called ?

2007-02-06 Thread Leif K-Brooks
ychaouche wrote: > class ParseurHTML(HTMLParser): > def __init__(self): > HTMLParser.__init__(self) > > def start_body(self,attrs): > print "this is my body" def start_tag(self, name, attrs): if name == 'body': print "this is my body" -- http://mail.python.o

Two mappings inverse to each other: f, g = biject()

2007-02-06 Thread Jonathan Fine
Hello As part of the MathTran project I found myself wanting to maintain a bijection between long names and short names. http://www.open.ac.uk/mathtran In other words, I wanted to have two dictionaries f and g such that f[a] == b g[b] == a are equivalent statements. A google search for

Re: XMLRPC Server

2007-02-06 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi, I'm trying to create an XMLRPC server using apache + python (cgi). > It's not too difficult to configure everything, but I would like to > tune it in order to receive up to 2000 calls per minute without any > problems. Do Pthon CGIs use threading? > I need to make it

Re: Python cheatsheets

2007-02-06 Thread Steve Holden
robert wrote: > gonzlobo wrote: >> Curious if anyone has a python cheatsheet* published? I'm looking for >> something that summarizes all commands/functions/attributes. Having >> these printed on a 8" x 11" double-sided laminated paper is pretty >> cool. >> >> * cheatsheet probably isn't the right

Repr or Str ?

2007-02-06 Thread Johny
Where and when is good/nescessary to use `repr` instead of `str` ? Can you please explain the differences Thanks LL -- http://mail.python.org/mailman/listinfo/python-list

Re: Repr or Str ?

2007-02-06 Thread Bart Ogryczak
On Feb 6, 11:47 am, "Johny" <[EMAIL PROTECTED]> wrote: > Where and when is good/nescessary to use `repr` instead of `str` ? > Can you please explain the differences > Thanks RTFM. http://docs.python.org/ref/customization.html __repr__( self) Called by the repr() built-in function and by stri

Re: Repr or Str ?

2007-02-06 Thread Olivier Feys
str is a text representation of the object, you can see it as a nice print repr is the text representation of the object that you can evaluate to get the same object Johny wrote: > Where and when is good/nescessary to use `repr` instead of `str` ? > Can you please explain the differences > Than

Re: Repr or Str ?

2007-02-06 Thread Fredrik Lundh
"Johny" <[EMAIL PROTECTED]> wrote: > Where and when is good/nescessary to use `repr` instead of `str` ? > Can you please explain the differences roughly, repr() is for programmers, str() is for end-users. -- http://mail.python.org/mailman/listinfo/python-list

Re: lambda functions ?

2007-02-06 Thread Eduardo \"EdCrypt\" O. Padoan
> This means that "f" is not a pointer to make_incrementor but rather to > the internal (copied?) function. "returned" function isthe right here. As any returned object from a function. > > > This style is very common in Scheme programming so you might read a > > Scheme book if you want to underst

Re: Python cheatsheets

2007-02-06 Thread Bart Ogryczak
On Jan 7, 10:11 pm, Jussi Salmela <[EMAIL PROTECTED]> wrote: > gonzlobo kirjoitti: > > > Curious if anyone has a python cheatsheet* published? I'm looking for > > something that summarizes all commands/functions/attributes. Having > > these printed on a 8" x 11" double-sided laminated paper is pre

Re: Inheriting str object

2007-02-06 Thread Alejandro Barroso
On 5 feb, 11:48, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I want to have a str with custom methods, but I have this problem: > > class myStr(str): > def hello(self): > return 'hello '+self > > s=myStr('world') > print s.hello() # prints 'hello world' > s=s.upper() > print s.hell

Re: XMLRPC Server

2007-02-06 Thread Lorenzo
Unfortunately I have to use Apache. The server implementation will we very easy, so I'm also considering more efficient solutions than python lv On Feb 6, 11:36 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi, I'm trying to create an XMLRPC server using apache

Re: XMLRPC Server

2007-02-06 Thread Lorenzo
Unfortunately I have to use Apache. The server implementation will be very easy, so I'm also considering more efficient solutions than python lv On Feb 6, 11:36 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi, I'm trying to create an XMLRPC server using apache

Re: XMLRPC Server

2007-02-06 Thread Brian Quinlan
[EMAIL PROTECTED] wrote: > Hi, I'm trying to create an XMLRPC server using apache + python (cgi). > It's not too difficult to configure everything, but I would like to > tune it in order to receive up to 2000 calls per minute without any > problems. That doesn't seem like excessive volume. Why no

Re: XMLRPC Server

2007-02-06 Thread Paul Boddie
On 6 Feb, 12:30, "Lorenzo" <[EMAIL PROTECTED]> wrote: > Unfortunately I have to use Apache. The server implementation will we > very easy, so I'm also considering more efficient solutions than > python You could try mod_python if there isn't an absolute requirement for CGI: http://www.modpython.o

Re: How to prevent from race conditions to share data between many process and thread in python

2007-02-06 Thread mars
On 2月6日, 下午6时14分, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > mars wrote: > > I use TurboGears to do some web service. TurboGears use cherrypy. When > > web browser access this site, the cherrypy will call my python > > program. So my program looks like a lib. When web browser access the > > si

Re: Python cheatsheets

2007-02-06 Thread Bart Ogryczak
On Jan 7, 10:03 pm, gonzlobo <[EMAIL PROTECTED]> wrote: > Curious if anyone has a python cheatsheet* published? I'm looking for > something that summarizes all commands/functions/attributes. Having > these printed on a 8" x 11" double-sided laminated paper is pretty > cool. > > * cheatsheet probab

Re: How to prevent from race conditions to share data between many process and thread in python

2007-02-06 Thread Diez B. Roggisch
mars wrote: > On 2月6日, 下午6时14分, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> mars wrote: >> > I use TurboGears to do some web service. TurboGears use cherrypy. When >> > web browser access this site, the cherrypy will call my python >> > program. So my program looks like a lib. When web browse

Re: Two mappings inverse to each other: f, g = biject()

2007-02-06 Thread Nick Vatamaniuc
On Feb 6, 5:22 am, Jonathan Fine <[EMAIL PROTECTED]> wrote: > Hello > > As part of the MathTran project I found myself > wanting to maintain a bijection between long > names and short names. >http://www.open.ac.uk/mathtran > > In other words, I wanted to have two dictionaries > f and g such tha

Re: Repr or Str ?

2007-02-06 Thread Nick Vatamaniuc
On Feb 6, 5:47 am, "Johny" <[EMAIL PROTECTED]> wrote: > Where and when is good/nescessary to use `repr` instead of `str` ? > Can you please explain the differences > Thanks > LL When you want to provide a representation of an object from which you can create another object if you had to. Use 'str

Re: C parsing fun

2007-02-06 Thread Károly Kiripolszky
Helo again! When I came up with this idea on how to parse C files with ease, I was at home and I only have access to the sources in subject in the office. So I've tried the previously posted algorithm on the actual source today and I realized my originally example data I've ran the test with was s

Re: when will python 2.5 take in mainstream?

2007-02-06 Thread Ben Sizer
On Feb 5, 4:15 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > It's very easy to maintain compatibility in the C API. I'm much more > interested in compatibility at the Python layer, which is changed > incompatibly much, much more frequently than is the C layer. Really? In all cases I've fou

Format a float and put in a list

2007-02-06 Thread David Sulkin
Hello, I have a float that I am trying to format to 2 decimal places, put the formatted float in a list and then output this to a file. My problem is, once I format my float, my float has quotations around the float due to my formatting. I am doing the following: ( "%.2f" % float( list[x

Graphs, bar charts, etc

2007-02-06 Thread Jan Danielsson
Hello all, I have some data in a postgresql table which I view through a web interface (the web interface is written in python -- using mod_python under apache 2.2). Now I would like to represent this data as graphs, bar charts, etc. I know about matplotlib, and it seemed like exactly what

Re: List Behavior when inserting new items

2007-02-06 Thread Gigs_
[EMAIL PROTECTED] wrote: > On Jan 29, 7:57 pm, "Drew" <[EMAIL PROTECTED]> wrote: >> I'm looking to add an element to list of items, however I'd like to >> add it at a specific index greater than the current size: >> >> list = [1,2,3] >> list.insert(10,4) >> >> What I'd like to see is something like

Running long script in the background

2007-02-06 Thread [EMAIL PROTECTED]
Hello, I am trying to write a python cgi that calls a script over ssh, the problem is the script takes a very long time to execute so Apache makes the CGI time out and I never see any output. The script is set to print a progress report to stdout every 3 seconds but I never see any output until t

Re: Two mappings inverse to each other: f, g = biject()

2007-02-06 Thread Jonathan Fine
Nick Vatamaniuc wrote: > If you need to get a short name, given a long name or vice-verse _and_ > the set of short names and long names is distinct (it would be > confusing if it wasn't!) then you can just have one dictionary, no > need to complicate things too much: > f[a]=b > f[b]=a > You won't

Re: Running long script in the background

2007-02-06 Thread jasonmc
> Does anybody know a way to make output show in real time? You can put: #!/usr/bin/python -u at the top of the script to have unbuffered binary stdout and stderr. -- http://mail.python.org/mailman/listinfo/python-list

Re: when will python 2.5 take in mainstream?

2007-02-06 Thread Paul Boddie
On 6 Feb, 13:45, "Ben Sizer" <[EMAIL PROTECTED]> wrote: > > Perhaps the C API remains the same but the real > issue is the binary API between extensions and Python changes every > couple of years or so. That's why I run 2.4 anywhere that needs > extensions. > > It would be great if someone could in

Re: when will python 2.5 take in mainstream?

2007-02-06 Thread Jean-Paul Calderone
On 6 Feb 2007 04:45:35 -0800, Ben Sizer <[EMAIL PROTECTED]> wrote: >On Feb 5, 4:15 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >> It's very easy to maintain compatibility in the C API. I'm much more >> interested in compatibility at the Python layer, which is changed >> incompatibly much, m

Re: Decimating Excel files

2007-02-06 Thread Stephen Eilert
On Feb 5, 11:42 pm, "John Machin" <[EMAIL PROTECTED]> wrote: > On Feb 6, 1:19 pm, gonzlobo <[EMAIL PROTECTED]> wrote: > > > I tried to open the file with Kate, trust me, it's an Excel file. > > Who or what is Kate? In what sense is trying to open it any evidence > that it's an Excel file? Did you *

Re: Graphs, bar charts, etc

2007-02-06 Thread Jussi Salmela
Jan Danielsson kirjoitti: > Hello all, > >I have some data in a postgresql table which I view through a web > interface (the web interface is written in python -- using mod_python > under apache 2.2). Now I would like to represent this data as graphs, > bar charts, etc. > >I know about ma

Re: "flushing"/demanding generator contents - implications for injection of control

2007-02-06 Thread metaperl
On Feb 5, 3:08 pm, Jussi Salmela <[EMAIL PROTECTED]> wrote: > metaperl kirjoitti: > > > For this program: > > > def reverse(data): > > for index in range(len(data)-1, -1, -1): > > yield data[index] > > > r = reverse("golf") > > > for char in r: > > print char > > > I'm wondering if

RE: Format a float and put in a list

2007-02-06 Thread David Sulkin
Hello all, I found a workaround solution. I use the items in the list to be placed in a string, so I just formatted the entire string to remove any single quotes. Duh! Thanks From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Su

How can I use __setitem__ method of dict object?

2007-02-06 Thread jeremito
Please excuse me if this is obvious to others, but I can't figure it out. I am subclassing dict, but want to prevent direct changing of some key/value pairs. For this I thought I should override the __setitem__ method as such: class xs(dict): """ XS is a container object to hold informa

Re: division by 7 efficiently ???

2007-02-06 Thread garrickp
On Feb 1, 8:25 pm, "Krypto" <[EMAIL PROTECTED]> wrote: > The correct answer as told to me by a person is > (N>>3) + ((N-7*(N>>3))>>3) > The above term always gives division by 7 Does anybody else notice that this breaks the spirit of the problem (regardless of it's accuracy)? 'N-7' uses the subtra

Re: when will python 2.5 take in mainstream?

2007-02-06 Thread Aahz
In article <[EMAIL PROTECTED]>, Ben Sizer <[EMAIL PROTECTED]> wrote: > >It would be great if someone could invest some time in trying to fix >this problem. I don't think I know of any other languages that require >recompilation of libraries for every minor version increase. How do you define "mino

Re: Running long script in the background

2007-02-06 Thread Thomas Guettler
[EMAIL PROTECTED] wrote: > Hello, > > I am trying to write a python cgi that calls a script over ssh, the > problem is the script takes a very long time to execute so Apache > makes the CGI time out and I never see any output. The script is set > to print a progress report to stdout every 3 secon

Re: Running long script in the background

2007-02-06 Thread [EMAIL PROTECTED]
On Feb 6, 8:36 am, "jasonmc" <[EMAIL PROTECTED]> wrote: > > Does anybody know a way to make output show in real time? > > You can put: #!/usr/bin/python -u > at the top of the script to have unbuffered binary stdout and stderr. Thanks. I tried that but it still times out waiting for output. Eve

Re: glutInit and wxPython on Mac OSX

2007-02-06 Thread Steve Holden
Artie wrote: > I seem to have uncovered a problem when using glutInit alongside > wxPython on Mac OSX. If glutInit is called prior to creating a > wx.App, many window and mouse events are either lost, not generated, > or misgenerated for the glcanvas. However, if glutInit is called > after the wx

huge amounts of pure Python code broken by Python 2.5?

2007-02-06 Thread Steven Bethard
Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > Huge amounts of my pure Python code was broken by Python 2.5. Interesting. Could you give a few illustrations of this? (I didn't run into the same problem at all, so I'm curious.) Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I use __setitem__ method of dict object?

2007-02-06 Thread Steve Holden
jeremito wrote: > Please excuse me if this is obvious to others, but I can't figure it > out. I am subclassing dict, but want to prevent direct changing of > some key/value pairs. For this I thought I should override the > __setitem__ method as such: > > > class xs(dict): > """ > XS is

Re: Running long script in the background

2007-02-06 Thread [EMAIL PROTECTED]
On Feb 6, 10:37 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Feb 6, 8:36 am, "jasonmc" <[EMAIL PROTECTED]> wrote: > > > > Does anybody know a way to make output show in real time? > > > You can put: #!/usr/bin/python -u > > at the top of the script to have unbuffered binary stdout and st

Re: How can I use __setitem__ method of dict object?

2007-02-06 Thread [EMAIL PROTECTED]
On 6 fév, 16:23, "jeremito" <[EMAIL PROTECTED]> wrote: > Please excuse me if this is obvious to others, but I can't figure it > out. I am subclassing dict, but want to prevent direct changing of > some key/value pairs. For this I thought I should override the > __setitem__ method as such: > > cla

Re: huge amounts of pure Python code broken by Python 2.5?

2007-02-06 Thread Larry Bates
Steven Bethard wrote: > Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >> Huge amounts of my pure Python code was broken by Python 2.5. > > Interesting. Could you give a few illustrations of this? (I didn't run > into the same problem at all, so I'm curious.) > > Steve I can't think of any of m

Why does list.__getitem__ return a list instance for subclasses of the list type?

2007-02-06 Thread dackz
>>> class ListyThing(list): pass ... >>> assert isinstance(ListyThing()[:], ListyThing) # I expect True! Traceback (most recent call last): File "", line 1, in AssertionError >>> type(ListyThing()[:]) # I expect ListyThing! I don't find this intuitive. Is this intentional? I believe this could

Re: How can I use __setitem__ method of dict object?

2007-02-06 Thread jeremito
On Feb 6, 10:59 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On 6 fév, 16:23, "jeremito" <[EMAIL PROTECTED]> wrote: > > > > > Please excuse me if this is obvious to others, but I can't figure it > > out. I am subclassing dict, but want to prevent direct changing of > > some key/value pairs

Re: when will python 2.5 take in mainstream?

2007-02-06 Thread Ben Sizer
On Feb 6, 3:35 pm, [EMAIL PROTECTED] (Aahz) wrote: > Ben Sizer <[EMAIL PROTECTED]> wrote: > > >It would be great if someone could invest some time in trying to fix > >this problem. I don't think I know of any other languages that require > >recompilation of libraries for every minor version increas

Re: huge amounts of pure Python code broken by Python 2.5?

2007-02-06 Thread John Roth
On Feb 6, 8:40 am, Steven Bethard <[EMAIL PROTECTED]> wrote: > Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > > > Huge amounts of my pure Python code was broken by Python 2.5. > > Interesting. Could you give a few illustrations of this? (I didn't run > into the same problem at all, so I'm curiou

Re: How can I use __setitem__ method of dict object?

2007-02-06 Thread Gabriel Genellina
"jeremito" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > Please excuse me if this is obvious to others, but I can't figure it > out. I am subclassing dict, but want to prevent direct changing of > some key/value pairs. For this I thought I should override the > __setitem__

Re: huge amounts of pure Python code broken by Python 2.5?

2007-02-06 Thread Gabriel Genellina
"John Roth" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > On Feb 6, 8:40 am, Steven Bethard <[EMAIL PROTECTED]> wrote: >> Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >> >> > Huge amounts of my pure Python code was broken by Python 2.5. >> >> Interesting. Could you give a

Module problem

2007-02-06 Thread Boris Ozegovic
Hi I am writing some simple script, and when I start my script from command line (python Imenik.py), everything works perfectly. If I double clik the same script in my desktop I get the following error: "No module name import win32clipboard" -- "A mi smo stranci u vlastitoj zemlji zbog ljudsko

Re: Python cheatsheets

2007-02-06 Thread Laurent Pointal
Bart Ogryczak wrote: > On Jan 7, 10:03 pm, gonzlobo <[EMAIL PROTECTED]> wrote: >> Curious if anyone has a python cheatsheet* published? I'm looking for >> something that summarizes all commands/functions/attributes. Having >> these printed on a 8" x 11" double-sided laminated paper is pretty >> c

Re: when will python 2.5 take in mainstream?

2007-02-06 Thread Chris Mellon
On 6 Feb 2007 08:46:29 -0800, Ben Sizer <[EMAIL PROTECTED]> wrote: > On Feb 6, 3:35 pm, [EMAIL PROTECTED] (Aahz) wrote: > > Ben Sizer <[EMAIL PROTECTED]> wrote: > > > > >It would be great if someone could invest some time in trying to fix > > >this problem. I don't think I know of any other languag

Re: Module problem

2007-02-06 Thread Matimus
On Feb 6, 9:29 am, Boris Ozegovic <[EMAIL PROTECTED]> wrote: > Hi > > I am writing some simple script, and when I start my script from command > line (python Imenik.py), everything works perfectly. If I double clik the > same script in my desktop I get the following error: > > "No module name impo

Re: huge amounts of pure Python code broken by Python 2.5?

2007-02-06 Thread John Nagle
Steven Bethard wrote: > Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > > Huge amounts of my pure Python code was broken by Python 2.5. > > Interesting. Could you give a few illustrations of this? (I didn't run > into the same problem at all, so I'm curious.) > > Steve I'd like to know, to

Testing a website with HTTPS login and cookies

2007-02-06 Thread Dwyer, Mike # ATLANTA
Did you ever get a response to your posting on "Testing a website with HTTPS login and cookies"? The reason I ask is that I need to do a similar thing, and am not being very successful getting pointers or sample code. Any response appreciated. /mike -- http://mail.python.org/mailman/listinfo/pyt

Re: Calling J from Python

2007-02-06 Thread Bruno Desthuilliers
Gosi a écrit : > On Feb 6, 3:04 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > >>On Feb 5, 8:48 am, "Gosi" <[EMAIL PROTECTED]> wrote: >> >> >>>It is quite easy to call J from Python >> >>>http://groups.google.com/group/J-Programming/browse_thread/thread/5e8... >> >>There are a couple of issu

Re: Module problem

2007-02-06 Thread Boris Ozegovic
Matimus wrote: > Do you have more than one version of Python installed? Is > win32clipboard installed for both versions? It could be that the Yup, that was the problem. Thanx! -- "A mi smo stranci u vlastitoj zemlji zbog ljudskog sljama, lipa nasa silovana" -- http://mail.python.org/mailman/l

Re: huge amounts of pure Python code broken by Python 2.5?

2007-02-06 Thread skip
John> MySQLdb isn't fully supported for Python 2.5 yet, and there's no John> tested Windows executable available, although there's an untested John> version from a World of Warcraft guild available. As Andy Dustman has pointed out a number of times, he doesn't do Windows. Someone in t

Help with multiple key sort

2007-02-06 Thread ian . brady1
gurus: I want to implement a sql-like sort-by on multiple keys. I've seen many examples of just two keys. I have a list like this 1 one 2 1 one 1 1 two 1 1 one 0 1 xx 0 result should be like this 1 four 2 1 one 0 1 one 1 1 one 2 1 xx 0 It moves right while keeping sorted order to the lef

electronics and python

2007-02-06 Thread lee
Hi guys.Is there any software written using python for electronics.i mean any simulation software or something?? -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with multiple key sort

2007-02-06 Thread Paul Rubin
[EMAIL PROTECTED] writes: > It moves right while keeping sorted order to the left. This is the > new stable sort in 2.5. >>> b ['1 one 2', '1 one 1', '1 two 1', '1 one 0', '1 xx 0'] >>> sorted(b,key=lambda x: x.split()) ['1 one 0', '1 one 1', '1 one 2', '1 two 1', '1 xx 0'] -- http://mail.py

Re: How to prevent from race conditions to share data between many process and thread in python

2007-02-06 Thread Gabriel Genellina
En Tue, 06 Feb 2007 08:49:51 -0300, Diez B. Roggisch <[EMAIL PROTECTED]> escribió: > mars wrote: > >> On 2月6日, 下午6时14分, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >>> mars wrote: >>> > I use TurboGears to do some web service. TurboGears use cherrypy. >>> When >>> > web browser access this s

Re: How can I access data from MS Access?

2007-02-06 Thread Andy Dingley
On 5 Feb, 19:40, "Sells, Fred" <[EMAIL PROTECTED]> wrote: > Years ago we used to get our FORTRAN card decks back from the DP center > with a piece of scrap paper saysing "She No Work". top that. I used to use a cross-compiler (targetting some obscure single-chip hardware) that had just a single

Re: Help with multiple key sort

2007-02-06 Thread Jussi Salmela
[EMAIL PROTECTED] kirjoitti: > gurus: > > I want to implement a sql-like sort-by on multiple keys. I've seen > many examples of just two keys. > > I have a list like this > > 1 one 2 > 1 one 1 > 1 two 1 > 1 one 0 > 1 xx 0 > > result should be like this > > 1 four 2 > 1 one 0 > 1 one 1 > 1 o

Re: Help with multiple key sort

2007-02-06 Thread ian . brady1
Paul already answered it. Tnx Paul. My data is in a file and now I have to take care to strip \t and \n from it. Thanks > I'm not a guru. Maybe that's why I don't understand which "sql-like > sort-by on multiple keys" would produce output that lacks some of the > input but has additional items.

Re: Repr or Str ?

2007-02-06 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "Johny" <[EMAIL PROTECTED]> wrote: > Where and when is good/nescessary to use `repr` instead of `str` ? > Can you please explain the differences You expect repr to include information that you might call `meta-data' or `type' -- object class and so forth. To the

Re: How can I access data from MS Access?

2007-02-06 Thread BartlebyScrivener
On Feb 5, 4:52 am, "Andy Dingley" <[EMAIL PROTECTED]> wrote: > On 3 Feb, 15:43, [EMAIL PROTECTED] wrote: > > > How to access data from MS Access? > > First of all check that the DSN is working and connects to the > back end MDB. This might not be Python's problem. > > Secondly check whatever errors

Re: XMLRPC Server

2007-02-06 Thread Fredrik Lundh
Brian Quinlan wrote: > Actually, you might not have to. 2000 calls/minute isn't that big, > assuming you have a decent server. well, if you're talking pure CGI, you need to start the interpreter, import the required modules, connect to the database, unmarshal the xml-rpc request, talk to the d

Re: huge amounts of pure Python code broken by Python 2.5?

2007-02-06 Thread Jean-Paul Calderone
On Tue, 06 Feb 2007 08:40:40 -0700, Steven Bethard <[EMAIL PROTECTED]> wrote: >Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > > Huge amounts of my pure Python code was broken by Python 2.5. > >Interesting. Could you give a few illustrations of this? (I didn't run >into the same problem at all, so

Re: How can I use __setitem__ method of dict object?

2007-02-06 Thread Bruno Desthuilliers
jeremito a écrit : > On Feb 6, 10:59 am, "[EMAIL PROTECTED]" > <[EMAIL PROTECTED]> wrote: > >>On 6 fév, 16:23, "jeremito" <[EMAIL PROTECTED]> wrote: >> (snip) >>>But I can't even get __setitem__ to run. >> >>of course, since your __new__ method returns a dict instance, not a xs >>instance... >>The

Re: Running long script in the background

2007-02-06 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: > I tried flushing stdout and the same thing happens. As soon as the > os.popen(command) line runs it stops there, the next print statement > never even runs. > > I've also tried using os.spawnv to make the process run in the > background but then the ssh command never r

Re: Running long script in the background

2007-02-06 Thread [EMAIL PROTECTED]
On Feb 6, 2:02 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 6 Feb 2007 07:37:33 -0800, "[EMAIL PROTECTED]" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > > Everything works fine until I call the popen function, then it > > freezes. What I want is to print the o

Re: Running long script in the background

2007-02-06 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: > Web pages can show output as it's sent. For testing I created a > script on the server that untars a 600 meg volume, I can see each file > name show up in my browser instantly, just like it should. The other > script I'm trying to run won't show anything until the enti

Trouble fixing a broken ASCII string - "replace" mode in codec not working.

2007-02-06 Thread John Nagle
I'm trying to clean up a bad ASCII string, one read from a web page that is supposedly in the ASCII character set but has some characters above 127. And I get this: File "D:\projects\sitetruth\InfoSitePage.py", line 285, in httpfetch sitetext = sitetext.encode('ascii','replace') # for

Re: electronics and python

2007-02-06 Thread Bill Scherer
lee wrote: >Hi guys.Is there any software written using python for >electronics.i mean any simulation software or something?? > > Here's 'something': http://home.tiscali.be/be052320/Unum.html I find it useful for basic electronics math (Ohm's law, filters, etc). It keeps track of the u

Re: XMLRPC Server

2007-02-06 Thread Brian Quinlan
Fredrik Lundh wrote: > well, if you're talking pure CGI, you need to start the interpreter, > import the required modules, connect to the database, unmarshal the > xml-rpc request, talk to the database, marshal the response, and shut > down, in less than 30 milliseconds. > > just importing the

Re: Trouble fixing a broken ASCII string - "replace" mode in codec not working.

2007-02-06 Thread Robert Kern
John Nagle wrote: > I'm trying to clean up a bad ASCII string, one read from a > web page that is supposedly in the ASCII character set but has some > characters above 127. And I get this: > > File "D:\projects\sitetruth\InfoSitePage.py", line 285, in httpfetch > sitetext = sitetext.en

Re: Python cheatsheets

2007-02-06 Thread cyberco
> If you have a good color printer, try > PQRChttp://www.limsi.fr/Individu/pointal/python/pqrc/ That is a very usefull document to use besides Richard Gruets quick ref. The only disadvantage is that it's a PDF document, pity there's no HTML version. 2B -- http://mail.python.org/mailman/listinf

Re: Recursive zipping of Directories in Windows

2007-02-06 Thread MRAB
On Feb 6, 1:48 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Feb 4, 12:42 pm, "Jandre" <[EMAIL PROTECTED]> wrote: > > > > > On Feb 1, 9:39 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > > > > Jandre wrote: > > > > Hi > > > > > I am a python novice and I am trying to write a python script (m

Python editor

2007-02-06 Thread BBands
No, no, no, this is not an invitation to the editor wars. I have been using José Cláudio Faria's superb Tinn-R, http://www.sciviews.org/Tinn-R/, with the R language, http://www.r-project.org/. This editor allows you to send code to the R shell for execution. You can easily send a line, the select

Re: electronics and python

2007-02-06 Thread Richard Charts
On Feb 6, 1:38 pm, "lee" <[EMAIL PROTECTED]> wrote: > Hi guys.Is there any software written using python for > electronics.i mean any simulation software or something?? There's MyHDL. http://myhdl.jandecaluwe.com/doku.php I found it originally in a Linux Journal article some years ago. ht

Re: electronics and python

2007-02-06 Thread Stef Mientki
lee wrote: > Hi guys.Is there any software written using python for > electronics.i mean any simulation software or something?? > There are a few starts, (I can't find my notes right now, so from my head) - there's a 68c11 simulator - there's a spice implementation or at least a good coupl

Re: Two mappings inverse to each other: f, g = biject()

2007-02-06 Thread bearophileHUGS
Jonathan Fine: > A google search for biject.py and bijection.py > produced no hits, so I suspect that this may not > have been done before. There are few (good too) implementations around, but they are called bidict or bidirectional dicts. Sometimes I use this implementation, with few changes: htt

  1   2   >