Re: Is it just me, or is Sqlite3 goofy?

2006-09-04 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Probably just me. I've only been using Access and SQL Server > for 12 years, so I'm sure my opinions don't count for anything. [...] > > Ok, next issue, what the fuck are [varchar] and [decimal]? [..] > > It's still fuckin' goofy. > Language ... regards Steve -- St

Re: threading support in python

2006-09-04 Thread Steve Holden
Sandra-24 wrote: [Sandra understands shared memory] > > I would find an easier time, I think, porting mod_python to .net and > leaving that GIL behind forever. Thankfully, I'm not considering such > drastic measures - yet. > Quite right too. You haven't even sacrificed a chicken yet ... > Why on

Re: What are super()'s semantics?

2006-09-04 Thread Steve Holden
Maric Michaud wrote: > Le lundi 04 septembre 2006 22:29, Carl Banks a écrit : > >>BTW, __class__ is available to instances. (Were you thinking of >>__bases__?) > > > hmmm, I guess they're not the same, are they ? > > but you're right, __bases__ and some others are class attributes not > avail

Re: What are super()'s semantics?

2006-09-04 Thread Mike Krell
"Michele Simionato" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Anyway, the MRO concept is documented here: > > http://www.python.org/download/releases/2.3/mro/ A very edifying document. Indeed, in "Nutshell" Alex M. mentions your paper at the end of his high-level explanation of t

pyPgSQL / trac issues

2006-09-04 Thread Eric
Hey guys, Has anyone seen this error when installing trac? The problem seems related to pyPgSQL, which is installed. (Although I had to go in and add some headers to make it work) Templates directory [/usr/local/share/trac/templates]> Creating and Initializing Project Failed to create environm

Re: Is it just me, or is Sqlite3 goofy?

2006-09-04 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > But watch this: being clueless (but not stupid) is a gift I have > for troubleshooting. I tried (incorrectly) to insert another record: > > cur.execute("insert into book(title, author, published) values ('Dirk > Gently''s Holistic Detective Agenc

Re: What are super()'s semantics?

2006-09-04 Thread Mike Krell
Maric Michaud <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > [examples snipped] > > Hope this is clear. Yes, I get it now. In a prior section in "Nutshell", Alex M. goes over the MRO as well as the __mro__ attribute. I remembered the fact that the __mro__ attribute can be reference

Re: why have to "from compiler import *"

2006-09-04 Thread John Purser
On Mon, 2006-09-04 at 21:40 -0700, [EMAIL PROTECTED] wrote: > Hi, why does > > >>> import compiler > >>> compileFile("foo.py") > > complain name 'compileFile' not defined. But Because 'compileFile' is not defined. But I think you'll find that compiler.compileFile IS defined. John Purser >

why have to "from compiler import *"

2006-09-04 Thread mark_galeck_spam_magnet
Hi, why does >>> import compiler >>> compileFile("foo.py") complain name 'compileFile' not defined. But >>>from compiler import * works. Why? (I did read the tutorial, it seems to say "import module" should work. Thank you, Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: OS X and Python - wxPython has forced a rehash of my approach

2006-09-04 Thread Robert Kern
hiaips wrote: > Kevin Walzer wrote: >> The universal build from Python.org is outdated (IIRC). A better, more >> optimized one is available from >> http://pythonmac.org/packages/py24-fat/dmg/Universal-MacPython-2.4.3-2006-04-07.dmg > > Outdated??? It's Python 2.4.3 (and they already have a build

Re: testing for valid reference: obj vs. None!=obs vs. obj is not None

2006-09-04 Thread Paul Rubin
alf <[EMAIL PROTECTED]> writes: > I have a reference to certain objects. What is the most pythonic way > to test for valid reference: If you're intending to use None as a sentinel for an invalid reference, then use > if obj is not None: You could also make a unique sentinel: Sentine

Re: OS X and Python - wxPython has forced a rehash of my approach

2006-09-04 Thread hiaips
Kevin Walzer wrote: > hiaips wrote: > > [EMAIL PROTECTED] wrote: > >> Earlier I asked about how people installed Python on OS X, given that > >> one can choose from Xcode, Fink, Darwin, ActiveState and source builds: > >> > >> http://groups.google.com/group/comp.lang.python/browse_thread/thread/5c

Re: testing for valid reference: obj vs. None!=obs vs. obj is not None

2006-09-04 Thread Carl Banks
Bruno Desthuilliers wrote: > In python, assignement is a statement, not an expression, so there's no > way you could write 'if obj = None' by mistake (-> syntax error). So > this style is unpythonic. Also, None is a singleton, and identity test > is way faster than equality test. Playing Devil's a

Re: OS X and Python - wxPython has forced a rehash of my approach

2006-09-04 Thread Kevin Walzer
hiaips wrote: > [EMAIL PROTECTED] wrote: >> Earlier I asked about how people installed Python on OS X, given that >> one can choose from Xcode, Fink, Darwin, ActiveState and source builds: >> >> http://groups.google.com/group/comp.lang.python/browse_thread/thread/5c4cde4206d1fbb7/37de06a6bb6b2361?l

Re: testing for valid reference: obj vs. None!=obs vs. obj is not None

2006-09-04 Thread Sandra-24
alf wrote: > Hi, > > I have a reference to certain objects. What is the most pythonic way to > test for valid reference: > > if obj: > > if None!=obs: > > if obj is not None: I like this way the most. I used timeit to benchmark this against the first one, expecting it to be fast

Re: threading support in python

2006-09-04 Thread Sandra-24
> You seem to be confused about the nature of multiple-process > programming. > > If you're on a modern Unix/Linux platform and you have static read-only > data, you can just read it in before forking and it'll be shared > between the processes.. Not familiar with *nix programming, but I'll take y

Re: asyncore.dispatcher stops listening

2006-09-04 Thread Jean-Paul Calderone
On Mon, 4 Sep 2006 19:03:09 -0700, Daniel Walton <[EMAIL PROTECTED]> wrote: >I have been working on a problem for a full week now. If someone >could please help me it would be great. Even a clue would be great at >this point. What I am seeing is quite a mystery. > >I have server written in pytho

asyncore.dispatcher stops listening

2006-09-04 Thread Daniel Walton
I have been working on a problem for a full week now. If someone could please help me it would be great. Even a clue would be great at this point. What I am seeing is quite a mystery. I have server written in python using asyncore.dispatcher. It listens on port 9940 and does something like thi

Re: Client-side TCP socket receiving "Address already in use" upon connect

2006-09-04 Thread Rhamphoryncus
Felipe Almeida Lessa wrote: > 2006/9/3, Alex Martelli <[EMAIL PROTECTED]>: > > Reflecting on the OP's use case, since all connections are forever being > > made to the same 16 servers, why not tweak thinks a bit to hold those > > connections open for longer periods of time, using a connection for m

newbie pipe question

2006-09-04 Thread linuxnooby
Hi I want to write a python script that accepts input ( a single line of text) from another program (squid proxy) and sends back output ( a single line of text). I am not sure how to go about this cheers David -- http://mail.python.org/mailman/listinfo/python-list

Dice gen and analyser script for RPGs: comments sought

2006-09-04 Thread Richard Buckle
Hi fellow Pythonistas, I've been using Python in anger for some time, and I must say, as I wrote in : "It's refreshing beyond words to use a language that so freely combines such a small, clean syntax with such a powerful synthesis of procedural, object-oriented

Is it just me, or is Sqlite3 goofy?

2006-09-04 Thread [EMAIL PROTECTED]
Probably just me. I've only been using Access and SQL Server for 12 years, so I'm sure my opinions don't count for anything. I was, nevertheless, looking forward to Sqlite3. And now that gmpy has been upgraded, I can go ahead and install Python 2.5. So I open the manual to Section 13.13 where I f

Re: testing for valid reference: obj vs. None!=obs vs. obj is not None

2006-09-04 Thread BJörn Lindqvist
> I have a reference to certain objects. What is the most pythonic way to > test for valid reference: > > if obj: > > if None!=obs: > > if obj is not None: The third way is the most precise way. It is often used in combination with default arguments. def __init__(self, amo

Re: Python newbie with a problem writing files

2006-09-04 Thread limodou
On 4 Sep 2006 08:16:24 -0700, Jason <[EMAIL PROTECTED]> wrote: > 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.

Re: python web framework for straight sql (no ORM)?

2006-09-04 Thread clothingoptional
It's hard to imagine a framework that would provide you with admin functions like Django without using ORM... seems dicey at best. Anyway, it sounds like you are just looking for more flexibility, a framework that doesn't dictate - is that so? In that case, you might check out Pylons (pylonshq.co

Re: upgrade 2.4 -> 2.5 HowTo

2006-09-04 Thread Tim Roberts
Helmut Jarausch <[EMAIL PROTECTED]> wrote: > >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 >

Re: inheritance needed in program configuration - config module or python oo?

2006-09-04 Thread Vinay Sajip
metaperl wrote: > Inheritance needed in app configuration > = [snip] > When it comes to HTML generation, every form of mini-language that I've > seen does not appeal to me. I use DOM to rewrite HTML. I hate the > limitations of mini-languages and prefer full-strength pr

Re: OS X and Python - wxPython has forced a rehash of my approach

2006-09-04 Thread hiaips
[EMAIL PROTECTED] wrote: > Earlier I asked about how people installed Python on OS X, given that > one can choose from Xcode, Fink, Darwin, ActiveState and source builds: > > http://groups.google.com/group/comp.lang.python/browse_thread/thread/5c4cde4206d1fbb7/37de06a6bb6b2361?lnk=gst&q=OS+X+and+P

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

2006-09-04 Thread Bruno Desthuilliers
Chris Brat a écrit : > Thanks, thats exactly what I was looking for - very neat. > Just note that both solutions rebind the name to a newly constructed list instead of modifying the original list in place. This is usually the RightThing(tm), but sometimes one wants an in-place modification. --

Re: python web framework for straight sql (no ORM)?

2006-09-04 Thread Luis M. González
falcon wrote: > Can someone please recommend a python web app framework which doesn't > abstract away sql in favor of python objects? > > As far as I can tell, frameworks such as django, turbo gears, etc. > allow one to drop down the the sql layer, however that is not the most > effecient use of t

Re: testing for valid reference: obj vs. None!=obs vs. obj is not None

2006-09-04 Thread Bruno Desthuilliers
alf a écrit : > Hi, > > I have a reference to certain objects. What is the most pythonic way to > test for valid reference: > > if obj: Don't do this: for o in [0, '', [], {}, ()]: print obj, bool(obj), obj is None > if None!=obs: In python, assignement is a statement, not an exp

python web framework for straight sql (no ORM)?

2006-09-04 Thread falcon
Can someone please recommend a python web app framework which doesn't abstract away sql in favor of python objects? As far as I can tell, frameworks such as django, turbo gears, etc. allow one to drop down the the sql layer, however that is not the most effecient use of the framework. I would lik

Re: Python newbie with a problem writing files

2006-09-04 Thread Damjan
> Code: > xml_output.write = (feed_title) How did you come up with that "=" there??! The correct line is: xml_output.write(feed_title) > Traceback (most recent call last): > File "C:/My_Blogroll/JJ_Blogroll2", line 11, in ? > xml_output.write = (feed_title) > AttributeError: '

Re: OS X and Python - wxPython has forced a rehash of my approach

2006-09-04 Thread Robert Kern
[EMAIL PROTECTED] wrote: > One other thing: the mac os x built at python.org > (http://www.python.org/download/) > > does not state whether it is a Framework build or not. I'm guessing it > isn't. It is. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigm

Re: OS X and Python - wxPython has forced a rehash of my approach

2006-09-04 Thread metaperl . etc
One other thing: the mac os x built at python.org (http://www.python.org/download/) does not state whether it is a Framework build or not. I'm guessing it isn't. -- http://mail.python.org/mailman/listinfo/python-list

Re: What are super()'s semantics?

2006-09-04 Thread Maric Michaud
Le lundi 04 septembre 2006 22:29, Carl Banks a écrit : > BTW, __class__ is available to instances.  (Were you thinking of > __bases__?) hmmm, I guess they're not the same, are they ? but you're right, __bases__ and some others are class attributes not available in instances, I wonder where is t

OS X and Python - wxPython has forced a rehash of my approach

2006-09-04 Thread metaperl . etc
Earlier I asked about how people installed Python on OS X, given that one can choose from Xcode, Fink, Darwin, ActiveState and source builds: http://groups.google.com/group/comp.lang.python/browse_thread/thread/5c4cde4206d1fbb7/37de06a6bb6b2361?lnk=gst&q=OS+X+and+Python+-+what+is+your+install+stra

Re: threading support in python

2006-09-04 Thread Daniel Dittmar
Rob Williscroft wrote: > 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

[ANN] markup.py 1.5 - a lightweight HTML/XML generator

2006-09-04 Thread Daniel Nogradi
A new release of markup.py is available at http://markup.sourceforge.net/ The markup module is an intuitive, lightweight, easy-to-use, customizable and pythonic HTML/XML generator. New features in the 1.5 release include: * use attribute=None to have no value for an attribute such as the emp

Re: testing for valid reference: obj vs. None!=obs vs. obj is not None

2006-09-04 Thread Carl Banks
alf wrote: > Hi, > > I have a reference to certain objects. What is the most pythonic way to > test for valid reference: > > if obj: > > if None!=obs: > > if obj is not None: If you're checking whether an object is None or not, the third is the best way. Some people might say y

Re: Access elements from nested tuples

2006-09-04 Thread jss
Hi Georg! In [1]: 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. In [2]: k=t[1] In [3]: k[1] Out[3]: 3 In [4]: t[1][1] Out[4]: 3 In [5]: k.__getitem__(1) Out[5]: 3 In [6]: k.[1] ---

Re: Access elements from nested tuples

2006-09-04 Thread Tim Chase
> 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? What is "t"? It's a tuple. A tuple can be indexed, or you can call its __getitem__ method. Thus, the one-th element of t is eith

Re: inaccuracy in the time module

2006-09-04 Thread alf
Paul Rubin wrote: > alf <[EMAIL PROTECTED]> writes: > >> >>> t=time() >> >>> mktime(gmtime(t))-t >>17999.680048942566 >>why there is a difference? > > > time() is a floating point number with fractional seconds. > gmtime()'s resolution is one second. thx, got it now. replacing with "t=round(tim

Need help with SOAPpy -- how to supply user credentials?

2006-09-04 Thread Roy Smith
I just got SOAPpy 0.11.6 running under Python 2.3.5. I can do some simple stuff like: from SOAPpy import WSDL wsdlFile = 'http://myserver/soap/XPlanner?wsdl' server = WSDL.Proxy(wsdlFile) print server.methods.keys() The problem is, this (not surprisingly) prompts for a username and password on t

Re: inaccuracy in the time module

2006-09-04 Thread Paul Rubin
alf <[EMAIL PROTECTED]> writes: > >>> t=time() > >>> mktime(gmtime(t))-t > 17999.680048942566 > why there is a difference? time() is a floating point number with fractional seconds. gmtime()'s resolution is one second. -- http://mail.python.org/mailman/listinfo/python-list

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

2006-09-04 Thread [EMAIL PROTECTED]
I am have to be able to distribute se with the project in order to use it I started with import se but I did not use the setup command when I comment out import se the program works and when I use import se everything connected to the library crashes on the import line.. Anthra Norell wrote: >

testing for valid reference: obj vs. None!=obs vs. obj is not None

2006-09-04 Thread alf
Hi, I have a reference to certain objects. What is the most pythonic way to test for valid reference: if obj: if None!=obs: if obj is not None: -- alfz1 -- http://mail.python.org/mailman/listinfo/python-list

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

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)

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

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

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: 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: 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: 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: 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: 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

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: 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

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: 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: 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: 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: 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: 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: 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: 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 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: 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: 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: 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: >

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: 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

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

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

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

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

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

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: 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

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: 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

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: 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

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 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

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

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: 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

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 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 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: 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: 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: 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: 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: 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: 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: 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: 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. >

  1   2   >