Re: how can i change the text delimiter

2006-09-04 Thread sonald
Hi, Thanks a lot for the snips you have included in your post... those were quite helpful... And about the 3rd party data we receive the data in csv format ... but we are not supposed to modify the files provided by the user directly... Instead we make another file with the same name & differ

Re: Exception EOFError.

2006-09-04 Thread Sybren Stuvel
Dennis Lee Bieber enlightened us with: > The above is windows, I believe Linux uses instead of > That's correct. And so do all unix systems including MacOS X. Sybren -- Sybren Stüvel Stüvel IT - http://www.stuvel.eu/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Twisted vs POS (Plain-old sockets)

2006-09-04 Thread Guido Goldstein
Hi! On Sun, 3 Sep 2006 00:19:17 -0700 "Darren Kirby" <[EMAIL PROTECTED]> wrote: [...] > I guess I am wondering if given the fact I need a custom protocol, and need > to > talk TCP/IP should I stick with twisted or just use plain old sockets and > build it myself? Is there a third option I shoul

upgrade 2.4 -> 2.5 HowTo

2006-09-04 Thread Helmut Jarausch
Hi, what has to be done for upgrading from Python 2.4 to 2.5? - How can I find out which packages (in addition to the core packages) have been installed up to now - Can I just copy /usr/local/lib/python2.4/site-packages to /usr/local/lib/python2.5 ? Many thanks for a h

Reading config.ini in PythonWin.

2006-09-04 Thread Vesa Leppanen
Hi, I am new in python-list and quite new in Python programming as well. I am working mainly with GIS and using Esri's geoprocessing tools. I want to use .ini file to set the parameters, especially paths, in my project. PythonWin 2.1. is my version. Why do I get the default back in the case belo

fcntl() and packing structs with unions.

2006-09-04 Thread tyler
I'm having some trouble building a proper argument for an ioctl call. The operation I'm working with is TUNSETIFF _IOW('T', 202, int) which takes a struct ifreq as the arg. Could someone familiar with the struct (usually defined in net/if.h) tell me how the heck to encode it using the struct/array

Re: upgrade 2.4 -> 2.5 HowTo

2006-09-04 Thread Steve Holden
Helmut Jarausch wrote: > Hi, > > what has to be done for upgrading from Python 2.4 to 2.5? > > - How can I find out which packages (in addition to the core packages) have > been >installed up to now > - Can I just copy /usr/local/lib/python2.4/site-packages to > /usr/

Re: CONSTRUCT -

2006-09-04 Thread Georg Brandl
lazaridis_com wrote: > Georg Brandl wrote: >> lazaridis_com wrote: >> > I would like to fulfill the following task: >> > >> > The construct: >> > >> > if __name__ == '__main__': >> > >> > should be changed to something like: >> > >> > if identifier.name == '__main__': >> > >> > The term "identifier

Re: raw audio in windows

2006-09-04 Thread Ben Sizer
Jay wrote: > So, are you saying this would be possible to do with the PlaySound > function? Fredrik is often terse. ;) I think what he's saying is that when I said you could pass a .wav file to an external application, he showed that you could pass it to a Python module instead. I think you still

Newbie XML Output question

2006-09-04 Thread kryten21
Hi, I was wondering if someone could help me with a problem I've been having with mod-python and a javascript application I'm running. When I run a GET on the actual XML file from the javascript, I can easily parse the file. However, when I use a mod-python handler and run this code: LOCAL_FILE

Re: Newbie XML Output question

2006-09-04 Thread kryten21
Sorry, there should be no "req.write(file)" there. > def get_request(req): > if req.method == 'GET': > req.content_type = "text/xml" > req.sendfile(LOCAL_FILE) > req.write(file) > return apache.OK > -- http://mail.python.org/mailma

Re: Syntax suggestion.

2006-09-04 Thread samir
Alex Martelli wrote: > What a mess it would be to disambiguate statements such as > > x = foo bar baz bat > > is it x = (foo, bar, baz, bat) > or x = foo(bar, baz, bat) > or x = foo(bar(baz), bat) > or x = foo(bar, baz(bat)) > or x = foo(bar(baz, bat)) It will be x=foo(bar,baz,bat). The parenthes

What are super()'s semantics?

2006-09-04 Thread Mike Krell
I'm reading Alex Martelli's "Nutshell" second edition. In the section called "Cooperative superclass method calling", he presents a diamond inheritance hierachy: class A(object): def met(self): print "A.met" class B(A): def met(self): print "B.met" A.met(self) clas

Better way to replace/remove characters in a list of strings.

2006-09-04 Thread Chris Brat
Hi, Is there a better way to replace/remove characters (specifically ' and " characters in my case, but it could be anything) in strings in a list, than this example to replace 'a' with 'b': x = ["a","123a","as"] for i, v in enumerate(x) : x[i] = v.replace("a","b") This works, bu

Re: a new object definition

2006-09-04 Thread Sylvain Ferriol
> Michele Simionato already pointed you to `PEP 359`_. One of the reasons > that I withdrew it was that people seemed to feel that you could get > most of what you want now by defining appropriate metaclasses. In your > case, for example, the appropriate metaclass and its usage might look > l

Re: re.compile() doesn't work under Windows?

2006-09-04 Thread Sibylle Koczian
ddtl schrieb: > Thanks everybody for pointing out the problem. > And indeed, the script was named differently on Linux. > > ddtl. And because I just spent a day searching all the wrong corners: you remembered to delete or rename the "re.pyc" that the first import probably left in the same directo

Re: python loops

2006-09-04 Thread Nicko
Steve Holden wrote: > Nicko wrote: > > Fredrik Lundh wrote: > >>if you cannot refrain from pulling arguments out of your ass, you not > >>really the right person to talk about hygiene. > > > > I'm impressed but your mature argument. Clearly, in the face of such > > compelling reasoning, I shall hav

Re: Classes referencing each other

2006-09-04 Thread Manuel Bleichner
> Does the "EMCenter" really need to /subclass/ from all of those? Or > would it be better to make some of those attributes of an EMCenter > INSTANCE (passing in instances of the others to the __init__() ). > > class EMCenter(object): > def __init__(self, b, r, c, ol): >

Re: Broadcast server

2006-09-04 Thread swell
Thx Alex, This is exactly what i want to look at . Async will definitely be something i will look at . Does it make sense to mix async and threaded server ( let say a threaded server accepting max 10 connections and dealing with client request asynchronously ). Does it sounds you a good design.

Re: Better way to replace/remove characters in a list of strings.

2006-09-04 Thread Philipp Pagel
Chris Brat <[EMAIL PROTECTED]> wrote: > Is there a better way to replace/remove characters (specifically ' and > " characters in my case, but it could be anything) in strings in a > list, than this example to replace 'a' with 'b': x = map(lambda foo: foo.replace('a', 'b'), x) cu Philipp

Re: working with ldap files

2006-09-04 Thread Michael Ströder
flit wrote: > > I am struggling with some ldap files. More general you are struggling with multiple attribute values of DN syntax stored in a single field of a CSV file. > I am using the csv module to work with this files (I exported the ldap > to a csv file). I guess you have MS AD and used MS

Re: Better way to replace/remove characters in a list of strings.

2006-09-04 Thread George Sakkis
Philipp Pagel wrote: > Chris Brat <[EMAIL PROTECTED]> wrote: > > Is there a better way to replace/remove characters (specifically ' and > > " characters in my case, but it could be anything) in strings in a > > list, than this example to replace 'a' with 'b': > > x = map(lambda foo: foo.replace('a

Re: What are super()'s semantics?

2006-09-04 Thread Michele Simionato
Mike Krell wrote: > BTW, the official docs are even worse in this regard. AFAICT, they > essentially say that super() returns a superclass with no discussion of > diamond inheritance or any hint of how the semantics of super(B, > self).met() would be any different than those of A.met(self). > > Th

Re: What are super()'s semantics?

2006-09-04 Thread Carl Banks
Mike Krell wrote: > class A(object): > def met(self): > print "A.met" > > class B(A): > def met(self): > print "B.met" > super(B, self).met() > > class C(A): > def met(self): > print "C.met" > super(C, self).met() > > class D(B,C): > def met(s

Re: What are super()'s semantics?

2006-09-04 Thread Maric Michaud
Le lundi 04 septembre 2006 12:25, Mike Krell a écrit : > 1. The super() call in D somehow invokes both parent class methods >    instead of stopping when the method is resolved in B. This has >    nothing to do with truncated lookup per se.  Why isn't the output "D >    B A"? > Yes but, super(B, B

Re: What are super()'s semantics?

2006-09-04 Thread Maric Michaud
Le lundi 04 septembre 2006 13:48, Carl Banks a écrit : > Essentially, it's objects that have MROs, not classes. Wrong, __mro__ is an attribute of types (subtypes of type) but like __class__ it is not available in the instances. mro() is standard a method of type. In [150]: A.mro() Out[150]: [, ]

Re: upgrade 2.4 -> 2.5 HowTo

2006-09-04 Thread Sibylle Koczian
Helmut Jarausch schrieb: > Hi, > > what has to be done for upgrading from Python 2.4 to 2.5? > > - How can I find out which packages (in addition to the core packages) > have been > installed up to now > - Can I just copy /usr/local/lib/python2.4/site-packages to > /usr/l

modbus

2006-09-04 Thread kilnhead
Is anyone using python for modbus? I would like to communicate with some modbus devices - I can use pyserial and follw the protocol, just wondering if anybody has already done this? -- http://mail.python.org/mailman/listinfo/python-list

Re: python-database

2006-09-04 Thread skip
Cliff> On Sun, 2006-09-03 at 21:30 -0700, sridhar wrote: >> is there any way to call stored procedures from python as in java? Cliff> I mostly use PostgreSQL, so perhaps it's different for some other Cliff> databases, but calling stored procedures doesn't require any Cliff> sp

are there any lib for receive hotmail ?

2006-09-04 Thread 叮叮当当
thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Better way to replace/remove characters in a list of strings.

2006-09-04 Thread Chris Brat
Thanks, thats exactly what I was looking for - very neat. George Sakkis wrote: > Philipp Pagel wrote: > > > Chris Brat <[EMAIL PROTECTED]> wrote: > > > Is there a better way to replace/remove characters (specifically ' and > > > " characters in my case, but it could be anything) in strings in a >

This seems to crash my program and gives me errors on the #include statements

2006-09-04 Thread [EMAIL PROTECTED]
I was trying to add this to my project but I must be missing some includes or there is a serius error somewhere Anthra Norell wrote: > Dexter, > Here's a function that screens out all instrument blocks and puts them into a > dictionary keyed on the instrument number: > ---

methods and functions, instances and classes

2006-09-04 Thread David Isaac
When I create an instance of a class, are the class's functions *copied* to create the methods? Or are method calls actually calls of the class's functions? I am sure this is both obvious and FAQ, but I did not find a clear answer (e.g. here http://docs.python.org/tut/node11.html#SECTION001134

Unicode characters

2006-09-04 Thread Paul Johnston
Hi I have a string which I convert into a list then read through it printing its glyph and numeric representation #-*- coding: utf-8 -*- thestring = "abcd" thelist = list(thestring) for c in thelist: print c, print ord(c) Works fine for latin characters but when I put in a unicode cha

Re: methods and functions, instances and classes

2006-09-04 Thread Diez B. Roggisch
David Isaac wrote: > When I create an instance of a class, > are the class's functions *copied* to create the methods? > Or are method calls actually calls of the class's functions? On the class functions. You can make every instance have it's own methods, though - but only explicitly. Diez --

Re: upgrade 2.4 -> 2.5 HowTo

2006-09-04 Thread Helmut Jarausch
Sibylle Koczian wrote: > Helmut Jarausch schrieb: >> Hi, >> >> what has to be done for upgrading from Python 2.4 to 2.5? >> >> - How can I find out which packages (in addition to the core packages) >> have been >> installed up to now >> - Can I just copy /usr/local/lib/python2.4/site-packages

replace deepest level of nested list

2006-09-04 Thread David Isaac
I have a list of lists, N+1 deep. Like this (for N=2): [[['r00','g00','b00'],['r01','g01','b01']],[['r10','g10','b10'],['r11','g11' ,'b11']]] I want to efficiently produce the same structure except that the utlimate lists are replaced by a chosen (by index) item. E.g., [['r00','r01'],['r10','r11']

Re: methods and functions, instances and classes

2006-09-04 Thread Tim Chase
> When I create an instance of a class, > are the class's functions *copied* to create the methods? > Or are method calls actually calls of the class's functions? > > I am sure this is both obvious and FAQ, > but I did not find a clear answer The best way to find out is to try it: ##

Re: This seems to crash my program and gives me errors on the #include statements

2006-09-04 Thread Steve Holden
[EMAIL PROTECTED] wrote: > I was trying to add this to my project but I must be missing some > includes or there is a serius error somewhere > [...] > > I cut and pasted this.. It seems to be crashing my program.. I am not > sure that I have all the right imports.. seems to be fine when I go to

Re: Unicode characters

2006-09-04 Thread limodou
On 9/4/06, Paul Johnston <[EMAIL PROTECTED]> wrote: > Hi > I have a string which I convert into a list then read through it > printing its glyph and numeric representation > > #-*- coding: utf-8 -*- > > thestring = "abcd" > thelist = list(thestring) > > for c in thelist: > print c, > prin

Re: Unicode characters

2006-09-04 Thread Diez B. Roggisch
Paul Johnston wrote: > Hi > I have a string which I convert into a list then read through it > printing its glyph and numeric representation > > #-*- coding: utf-8 -*- > > thestring = "abcd" > thelist = list(thestring) > > for c in thelist: > print c, > print ord(c) > > Works fine fo

Re: Setting custom folder icon in OS X?

2006-09-04 Thread Kevin Walzer
Jet Jaguar wrote: > I'm trying to find a way to set a custom folder icon in OS X. I > thought that Applescript would be able to do it, but apparently it > can't. Is there anything in the Macintosh libraries of Python that > will allow me to take an image file (e.g., jpeg, png, tiff, etc.) and > s

threading support in python

2006-09-04 Thread km
Hi all, Is there any PEP to introduce true threading features into python's next version as in java? i mean without having GIL. when compared to other languages, python is fun to code but i feel its is lacking behind in threading regards, KM -- http://mail.python.org/mailman/listinfo/python-list

Re: Twisted vs POS (Plain-old sockets)

2006-09-04 Thread Istvan Albert
Guido Goldstein wrote: > You might have a look at asyncore/asychat in the standard library. > It does the async stuff for you and it's easy to understand and to > use. or Allegra might work http://laurentszyster.be/blog/allegra/ its anti-twisted melodrama comes at no extra charge. i. -- htt

Re: methods and functions, instances and classes

2006-09-04 Thread David Isaac
> Alan Isaac wrote: > > When I create an instance of a class, > > are the class's functions *copied* to create the methods? > > Or are method calls actually calls of the class's functions? "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On the class functions. You

Re: threading support in python

2006-09-04 Thread bayerj
Hi, GIL won't go. You might want to read http://blog.ianbicking.org/gil-of-doom.html . Regards, -Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: This seems to crash my program and gives me errors on the #include statements

2006-09-04 Thread [EMAIL PROTECTED]
It is giving errors on the import statements.. I will get an error on the line where I import this routine import csoundroutines and then the when I import the the program that tried to import csoundroutines I get an error and on down the chain.. when I go back to where I started in csoundroutine

Re: replace deepest level of nested list

2006-09-04 Thread George Sakkis
David Isaac wrote: > I have a list of lists, N+1 deep. > Like this (for N=2): > [[['r00','g00','b00'],['r01','g01','b01']],[['r10','g10','b10'],['r11','g11' > ,'b11']]] > > I want to efficiently produce the same structure > except that the utlimate lists are replaced by a chosen (by index) item. >

Re: replace deepest level of nested list

2006-09-04 Thread Roberto Bonvallet
David Isaac wrote: > I have a list of lists, N+1 deep. > Like this (for N=2): > [[['r00','g00','b00'],['r01','g01','b01']],[['r10','g10','b10'],['r11','g11' > ,'b11']]] > > I want to efficiently produce the same structure > except that the utlimate lists are replaced by a chosen (by index) item. >

Re: This seems to crash my program and gives me errors on the #include statements

2006-09-04 Thread Roberto Bonvallet
[EMAIL PROTECTED] wrote: > It is giving errors on the import statements.. I will get an error on > the line where I import this routine import csoundroutines and then the > when I import the the program that tried to import csoundroutines I get > an error and on down the chain.. Please paste here

Re: Python newbie with a problem writing files

2006-09-04 Thread Jason
limodou wrote: > > Code: > > > > import feedparser > > from xml.sax import saxutils > > > > feed_number=200 > > > > feed_list = open("feed_listing.conf","r") > > for each_feed in feed_list: > > data=feedparser.parse(each_feed) > > feed_title=data.entries[0].title > > xml_output=open("xm

Re: replace deepest level of nested list

2006-09-04 Thread David Isaac
Thanks to both Roberto and George. I had considered the recursive solution but was worried about its efficiency. I had not seen how to implement the numpy solution, which looks pretty nice. Thanks! Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: threading support in python

2006-09-04 Thread km
Hi all, Are there any alternate ways of attaining true threading in python ? if GIL doesnt go then does it mean that python is useless for computation intensive scientific applications which are in need of parallelization in threading context ? regards, KM

Re: This seems to crash my program and gives me errors on the #include statements

2006-09-04 Thread [EMAIL PROTECTED]
#import se # se available at http://cheeseshop.python.org/pypi/SE/2.2%20beta looks like it is the se beta.. I didn't get any kind of error or traceback that would tell me that though.. Roberto Bonvallet wrote: > [EMAIL PROTECTED] wrote: > > It is giving errors on the import statements.. I w

Re: are there any lib for receive hotmail ?

2006-09-04 Thread Paul McGuire
"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > thanks. > poplib -- http://mail.python.org/mailman/listinfo/python-list

Re: threading support in python

2006-09-04 Thread bayerj
Hi, You might want to split your calculation onto different worker-processes. Then you can use POSH [1] to share data and objects. You might even want to go a step further and share the data via Sockets/XML-RPC or something like that. That makes it easy to throw aditional boxes at a specific calc

Re: threading support in python

2006-09-04 Thread Richard Brodie
"km" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > if GIL doesnt go then does it mean that python is useless for > computation intensive scientific applications which are in need of > parallelization in threading context ? No. -- http://mail.python.org/mailman/listinfo/pyth

Re: threading support in python

2006-09-04 Thread Sybren Stuvel
km enlightened us with: > Is there any PEP to introduce true threading features into python's > next version as in java? i mean without having GIL. What is GIL? Except for the Dutch word for SCREAM that is... > when compared to other languages, python is fun to code but i feel > its is lacking be

Re: threading support in python

2006-09-04 Thread Jean-Paul Calderone
On Mon, 4 Sep 2006 17:48:14 +0200, Sybren Stuvel <[EMAIL PROTECTED]> wrote: >km enlightened us with: >> Is there any PEP to introduce true threading features into python's >> next version as in java? i mean without having GIL. > >What is GIL? Except for the Dutch word for SCREAM that is... > >> whe

Manipulating GIF image frames w/ PIL - where'd my palette go?

2006-09-04 Thread skip
I'm unclear how PIL handles multi-frame GIF images. I have such a GIF image in a file, bogus.gif. I can view the individual frames like so (ImageSequence is from the PIL tutorial): >>> img = Image.open("bogus.gif") >>> for frame in ImageSequence(img): ... frame.show() All but the

Re: SQLObject or SQLAlchemy?

2006-09-04 Thread Bruno Desthuilliers
lazaridis_com wrote: > Ο/Η Bruno Desthuilliers έγραψε: >> lazaridis_com wrote: >>> John Salerno wrote: Are there any major differences between these two? It seems they can both be used with TurboGears, and SQLAlchemy with Django. I'm just wondering what everyone's preference is, and

Re: threading support in python

2006-09-04 Thread Diez B. Roggisch
Sybren Stuvel wrote: > km enlightened us with: >> Is there any PEP to introduce true threading features into python's >> next version as in java? i mean without having GIL. > > What is GIL? Except for the Dutch word for SCREAM that is... the global interpreter lock, that prevents python from con

py2exe and libxml

2006-09-04 Thread Laszlo Nagy
I wrote a little win32 console application that uses libxml2. It is working fine. If I create an .exe version, I get this error when I try to start the program: Traceback (most recent call last): File "MyProgram.py", line 3, in ? File "mylib\item.pyc", line 5, in ? ImportError: dynamic modu

Re: threading support in python

2006-09-04 Thread Sandra-24
The trouble is there are some environments where you are forced to use threads. Apache and mod_python are an example. You can't make use of mutliple CPUs unless you're on *nux and run with multiple processes AND you're application doesn't store large amounts of data in memory (which mine does) so y

Prevent self being passed to a function stored as a member variable?

2006-09-04 Thread Sandra-24
How can you prevent self from being passed to a function stored as a member variable? class Foo(object): def __init__(self, callback): self.func = callback f =Foo(lambda x: x) f.func(1) # TypeError, func expects 1 argument, recieved 2 I thought maybe you could do this: class Foo(object

Re: Prevent self being passed to a function stored as a member variable?

2006-09-04 Thread Qiangning Hong
On 4 Sep 2006 09:39:32 -0700, Sandra-24 <[EMAIL PROTECTED]> wrote: > How can you prevent self from being passed to a function stored as a > member variable? > > class Foo(object): >def __init__(self, callback): > self.func = callback > > f =Foo(lambda x: x) > f.func(1) # TypeError, func e

Re: Prevent self being passed to a function stored as a member variable?

2006-09-04 Thread Jean-Paul Calderone
On 4 Sep 2006 09:39:32 -0700, Sandra-24 <[EMAIL PROTECTED]> wrote: >How can you prevent self from being passed to a function stored as a >member variable? This doesn't happen: >>> class x: ... def __init__(self): ... self.x = lambda: None ... >>> x().x() >>> class y(object): ...

Re: threading support in python

2006-09-04 Thread Daniel Dittmar
km wrote: > Is there any PEP to introduce true threading features into python's > next version as in java? i mean without having GIL. > when compared to other languages, python is fun to code but i feel its > is lacking behind in threading Some of the technical problems: - probably breaks compati

Using "Content-Disposition" in HTTP download

2006-09-04 Thread dclist
What is the correct way to download a file through HTTP and save it to the file name suggested by "Content-Disposition"? I would use urlretrieve but I'm not sure how to obtain the file name through the HTTP headers without downloading the body (e.g. urlopen(url).info()). -- http://mail.python.or

Re: methods and functions, instances and classes

2006-09-04 Thread Bruno Desthuilliers
David Isaac wrote: > When I create an instance of a class, > are the class's functions *copied* to create the methods? No, unless you explicitely do it. > Or are method calls actually calls of the class's functions? Depends on how the method was associated to the instance (you can set methods on

Re: Prevent self being passed to a function stored as a member variable?

2006-09-04 Thread Sandra-24
Qiangning Hong wrote: > Do you really get that error? Sorry, my bad. You're correct of course. I had accidentally passed an object, by naming it the same as the function, instead of my function, and the object had __call__ defined, and took exactly two parameters, just like my function, but one of

Where to find fpconst?

2006-09-04 Thread Roy Smith
I'm trying to install SOAPpy per the instructions on Dive Into Python (http://diveintopython.org/soap_web_services/install.html). I've got PyXML installed, but I'm stuck trying to find fpconst. The URL given on the DIP page doesn't work; www.analytics.washington.edu doesn't resolve in DNS. Li

Test for number?

2006-09-04 Thread Dr. Pastor
In the following code I would like to ascertain that x has/is a number. What the simplest TEST should be? (Could not find good example yet.) --- x=raw_input('\nType a number from 1 to 20') if TEST : Do_A else: Do_B --- Thanks for any guidance. == Posted via News

Re: Where to find fpconst?

2006-09-04 Thread Rob De Almeida
> Anybody know where I can find fpconst? I uploaded the lastest copy I could find to the Cheese Shop (http://www.python.org/pypi/fpconst/). I'm not affiliated in any way with fpconst, btw. Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Where to find fpconst?

2006-09-04 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Rob De Almeida" <[EMAIL PROTECTED]> wrote: > http://www.python.org/pypi/fpconst/ Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Web queries in Python

2006-09-04 Thread Joseph
Hi, Excel uses web queries to read data (like financial/weather data) from web. How to do the same in python? Even pointers to such would be of help. Thank you, Joseph -- http://mail.python.org/mailman/listinfo/python-list

Re: Test for number?

2006-09-04 Thread Tim Williams
On 04/09/06, Dr. Pastor <[EMAIL PROTECTED]> wrote: > In the following code I would like to ascertain > that x has/is a number. What the simplest TEST should be? > (Could not find good example yet.) > --- > x=raw_input('\nType a number from 1 to 20') > if TEST : > Do_A > else: >

Re: Twisted vs POS (Plain-old sockets)

2006-09-04 Thread Darren Kirby
On 9/3/06, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Sun, 3 Sep 2006 00:19:17 -0700, Darren Kirby <[EMAIL PROTECTED]> wrote: > >Hey all, > > > >I have a (FOSS) project here that I am about to start that requires TCP > >networking support, and in fact, will require me to design and impleme

Re: threading support in python

2006-09-04 Thread Rob Williscroft
Daniel Dittmar wrote in news:[EMAIL PROTECTED] in comp.lang.python: > - removing reference counting and relying on garbage collection alone > will break many Python applications (because they rely on files being > closed at end of scope etc.) > They are already broken on at least 2 python imp

Re: Test for number?

2006-09-04 Thread Helmut Jarausch
Tim Williams wrote: > On 04/09/06, Dr. Pastor <[EMAIL PROTECTED]> wrote: >> In the following code I would like to ascertain >> that x has/is a number. What the simplest TEST should be? >> (Could not find good example yet.) >> --- >> x=raw_input('\nType a number from 1 to 20') >> if TEST : >>

Re: This seems to crash my program and gives me errors on the#include statements

2006-09-04 Thread Anthra Norell
Dexter, Whenever I can I post solutions. And when I do, I run them in an IDLE window and copy my commands plus the output over into the message. So my posting should be replicable, if you would copy the commands into your IDLE window one by one and hitting return. Please do this and c

Re: Test for number?

2006-09-04 Thread Erik Max Francis
Helmut Jarausch wrote: > One step further > > try: >eval(x+'0') > That is an exceedingly bad idea. Type: __import__('sys').exit(), in the prompt and see what happens. You _never_ want to run `eval` on an untrusted string. Never. -- Erik Max Francis && [EMAIL PROTECTED] &&

Re: Test for number?

2006-09-04 Thread Hardcoded Software
Dr. Pastor wrote: > In the following code I would like to ascertain > that x has/is a number. What the simplest TEST should be? > (Could not find good example yet.) > --- > x=raw_input('\nType a number from 1 to 20') > if TEST : > Do_A > else: > Do_B > --- > Thanks for

Re: Twisted vs POS (Plain-old sockets)

2006-09-04 Thread Jean-Paul Calderone
On Mon, 4 Sep 2006 11:40:33 -0700, Darren Kirby <[EMAIL PROTECTED]> wrote: >> As for documentation, many people say it is lacking, but perhaps one person >> in a thousand points out _how_ or _where_ it is lacking. Unfortunately it >> is difficult to improve things (or even determine if they really

Re: newbe question about removing items from one file to another file

2006-09-04 Thread Anthra Norell
- Original Message - From: <[EMAIL PROTECTED]> Newsgroups: comp.lang.python To: Sent: Monday, September 04, 2006 4:58 AM Subject: Re: newbe question about removing items from one file to another file > > Anthra Norell wrote: > > Dexter, > > > > Here's a function that screens out all ins

Re: Broadcast server

2006-09-04 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > Thx Alex, > This is exactly what i want to look at . Async will definitely be > something i will look at . Does it make sense to mix async and threaded > server ( let say a threaded server accepting max 10 connections and > dealing with client request asynchronously

Re: Syntax suggestion.

2006-09-04 Thread Alex Martelli
samir <[EMAIL PROTECTED]> wrote: ... > That depends of your need to such tools. For example if you need to > copy a file, then, resolve a linear system then chroot and set the > password as de hexadecimal representation of the hash function of pi > multiplied by the averge of the solution coordi

Re: threading support in python

2006-09-04 Thread [EMAIL PROTECTED]
Sandra-24 wrote: > The trouble is there are some environments where you are forced to use > threads. Apache and mod_python are an example. You can't make use of > mutliple CPUs unless you're on *nux and run with multiple processes AND > you're application doesn't store large amounts of data in memo

Re: Test for number?

2006-09-04 Thread George Sakkis
Dr. Pastor wrote: > In the following code I would like to ascertain > that x has/is a number. What the simplest TEST should be? > (Could not find good example yet.) > --- > x=raw_input('\nType a number from 1 to 20') > if TEST : > Do_A > else: > Do_B > --- > Thanks for

building helper executables with distutils

2006-09-04 Thread Eric S. Johansson
I have a module which needs to invoke a suid helper program in order to do what it needs to do. This suid helper program needs to be built and installed at the same time as the module. Is there any way to do this with distutils? I've been looking through the documentation but haven't really f

Re: methods and functions, instances and classes

2006-09-04 Thread David Isaac
> Alan Isaac wrote: > > are method calls actually calls of the class's functions? "Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Depends on how the method was associated to the instance (you can set > methods on a per-instance property), but in the general case

Re: Test for number?

2006-09-04 Thread Peter Maas
Tim Williams wrote: > On 04/09/06, Dr. Pastor <[EMAIL PROTECTED]> wrote: >> In the following code I would like to ascertain >> that x has/is a number. What the simplest TEST should be? def isnumber(value): try: value/1 return true except TypeError: return false I t

Re: threading support in python

2006-09-04 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > If it's read/write data or you're not on a Unix platform, you can use > shared memory to shared it between many processes. > > Threads are way overused in modern multiexecution programming. The > decision on whether to use processes or threads sho

Re: Web queries in Python

2006-09-04 Thread Steve Holden
Joseph wrote: > Hi, > Excel uses web queries to read data (like financial/weather data) from > web. How to do the same in python? Even pointers to such would be of > help. > [EMAIL PROTECTED] ~/hwb $ python Python 2.5b2 (trunk:50713, Jul 19 2006, 16:04:09) [GCC 3.4.4 (cygming special) (gdc 0.12, u

Re: What are super()'s semantics?

2006-09-04 Thread Carl Banks
Maric Michaud wrote: > Le lundi 04 septembre 2006 13:48, Carl Banks a écrit : > > Essentially, it's objects that have MROs, not classes. > Wrong, __mro__ is an attribute of types (subtypes of type) but like __class__ > it is not available in the instances. > mro() is standard a method of type. I

Re: Linear regression in 3 dimensions

2006-09-04 Thread [EMAIL PROTECTED]
Hi Robert, I'm using the scipy package for such problems. In the submodule scipy.optimize there is an implmentation of a least-square fitting algorithm (Levenberg-Marquardt) called leastsq. You have to define a function that computes the residuals between your model and the data points: import s

Re: py2exe and libxml

2006-09-04 Thread Amaury Forgeot d'Arc
Laszlo Nagy a écrit : > > I wrote a little win32 console application that uses libxml2. It is > working fine. If I create an .exe version, I get this error when I try > to start the program: > > Traceback (most recent call last): > File "MyProgram.py", line 3, in ? > File "mylib\item.pyc", li

inaccuracy in the time module

2006-09-04 Thread alf
Hi, can someone explane this: >>> from time import * >>> timezone 18000 >>> t=time() >>> mktime(gmtime(t))-t 17999.680048942566 why there is a difference? -- alf -- http://mail.python.org/mailman/listinfo/python-list

Tkinter window focusing or selecting

2006-09-04 Thread Bob Greschke
I have a program with many "forms" (Toplevel windows with entry fields). Sometimes when I .deiconify() and .lift() a form that is a child of another form, but that just got buried under other forms it comes up 'not active' (dimmed). I have to click on the title bar (or anywhere in the window)

Access elements from nested tuples

2006-09-04 Thread Georg Sauthoff
Hi, t = (1, (2, 3)) I am bit suprised, that I cannot access '3' via: t[1].[1] # syntax error But t[1].__getitem__(1) works like expected. Why is that? Regards Georg Sauthoff -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >