how to run python file from the python IDLE editor

2008-11-20 Thread Seid Mohammed
hi all, I have a problem. when i run a file "python xxx.py " from a comand line, it just work. But the DOS command line do not support unicode and I want to run it just from the IDLE editor. i can run by pressing F5, but without an argument anybody can hint me how to run with an argument just i

Re: Optional parameter object re-used when instantiating multiple objects

2008-11-20 Thread Chris Rebert
On Thu, Nov 20, 2008 at 9:26 PM, alex23 <[EMAIL PROTECTED]> wrote: > On Nov 21, 10:07 am, Aaron Brady <[EMAIL PROTECTED]> wrote: >> Why, I would expect the interpreter to define the functions when it >> first hits the def, that is, at the point of definition. > > Then why are you arguing that the p

capacitor

2008-11-20 Thread anju
A capacitor is an electrical/electronic device that can store energy in the electric field between a pair of conductors (called "plates"). The process of storing energy in the capacitor is known as "charging", and involves electric charges of equal magnitude, but opposite polarity, building up on e

Re: function parameter scope python 2.5.2

2008-11-20 Thread Arnaud Delobelle
J Kenneth King <[EMAIL PROTECTED]> writes: > I recently encountered some interesting behaviour that looks like a bug > to me, but I can't find the appropriate reference to any specifications > to clarify whether it is a bug. > > Here's the example code to demonstrate the issue: > > class SomeObjec

Re: How to get the class instance of a passed method ?

2008-11-20 Thread Arnaud Delobelle
Christian Heimes <[EMAIL PROTECTED]> writes: > Stef Mientki wrote: >> hello, >> >> if I pass a class method to a function, >> is it possible to determine the class instance in that function ? >> >> class test ( object ) : >> def My_Method ( self ) : >>return 22 >> >> def do_something ( param

Re: Sending username password to a webpage

2008-11-20 Thread r0g
KDawg44 wrote: > Hi, > > Is there a way to essentially simulate populating a text box and > calling a submit button on a webpage? I want to write an app that > gets a users information from a website and then uses that to get > information from another site. The first site requires a log in. >

how to run afile with an argument from python IDLE editor

2008-11-20 Thread Seid Mohammed
hi all, I have a problem. when i run a file "python xxx.py " from a comand line, it just work. But the DOS command line do not support unicode and I want to run it just from the IDLE editor. i can run by pressing F5, but without an argument anybody can hint me how to run with an argument just i

Re: Problem with writing fast UDP server

2008-11-20 Thread Greg Copeland
On Nov 20, 9:03 am, Krzysztof Retel <[EMAIL PROTECTED]> wrote: > Hi guys, > > I am struggling writing fast UDP server. It has to handle around 1 > UDP packets per second. I started building that with non blocking > socket and threads. Unfortunately my approach does not work at all. > I wrote a

Re: Optional parameter object re-used when instantiating multiple objects

2008-11-20 Thread alex23
On Nov 21, 10:07 am, Aaron Brady <[EMAIL PROTECTED]> wrote: > Why, I would expect the interpreter to define the functions when it > first hits the def, that is, at the point of definition. Then why are you arguing that the parameters should be re-defined at the point of calling? -- http://mail.py

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-20 Thread Steven D'Aprano
On Fri, 21 Nov 2008 03:32:25 +, Steven D'Aprano wrote: >> Rather it seems to me that the essence of the idea they had in mind is >> that call-by-value is equivalent to assignment. > > You've just *assumed* that assignment in Algol 60 doesn't involving > copying. Based on the very little I kno

Re: function parameter scope python 2.5.2

2008-11-20 Thread Steven D'Aprano
On Thu, 20 Nov 2008 18:31:12 -0500, J Kenneth King wrote: > Of course I expected that recursive_func() would receive a copy of > weird_obj.words but it appears to happily modify the object. I am curious why you thought that. What made you think Python should/did make a copy of weird_obj.words wh

Re: Programming exercises/challenges

2008-11-20 Thread skip
>> I am constantly amazed at work that people open a separate emacs for >> each file they want to edit.  Most of them seem not to even know that >> find-file exists. Edwin> Come on mate... it's already a bit hard to post in a non-native Edwin> language. As a beginner in Python

Re: GzipFile as a Context manager

2008-11-20 Thread Gabriel Genellina
En Wed, 19 Nov 2008 17:04:22 -0200, Mikolai Fajer <[EMAIL PROTECTED]> escribió: Is there a reason that the gzip.GzipFile class does not have __enter__ and __exit__ methods that mimic those of the file object? I expected the following to work but it doesn't: import gzip with gzip.open('temp.g

Re: F2PY: Access Fortran module data from multiple python module

2008-11-20 Thread Gabriel Genellina
En Wed, 19 Nov 2008 20:06:37 -0200, Yann Vonder <[EMAIL PROTECTED]> escribió: Here is a description of what I am trying to implement using F2PY: I have created two python extension modules using F2PY. The first extension module (say fsubr1.so) contains a Fortran module (say "tmod") and a su

Re: Optional parameter object re-used when instantiating multiple objects

2008-11-20 Thread Steven D'Aprano
On Thu, 20 Nov 2008 04:42:24 -0800, Aaron Brady wrote: > On Nov 19, 7:58 pm, alex23 <[EMAIL PROTECTED]> wrote: >> On Nov 20, 10:14 am, Aaron Brady <[EMAIL PROTECTED]> wrote: >> >> > If you had a menu in a browser interface that had the items, say, >> > 'Stop' and 'Reload', what would you expect to

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-20 Thread John Nagle
Steven D'Aprano wrote: On Thu, 20 Nov 2008 14:22:50 +1300, greg wrote: Antoon Pardon wrote: You are changing your argument. In a follow up you made the point that call by value should be as it was intended by the writers of the algol 60 report. No, I was countering the argument that "call by

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-20 Thread Steven D'Aprano
On Wed, 19 Nov 2008 11:20:05 -0500, Terry Reedy wrote: >> It is useful and convenient to have "null values" like None, but it >> isn't useful to say that None is not a value. > > I never said that. But you've been defending the views of somebody who did. If you're going to play Devil's Advoca

Re: Optional parameter object re-used when instantiating multiple objects

2008-11-20 Thread Steven D'Aprano
On Wed, 19 Nov 2008 11:26:54 -0800, George Sakkis wrote: > On Nov 19, 1:05 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > >> On Wed, 19 Nov 2008 05:41:57 -0800 (PST), Rick Giuly >> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: >> >> >> >> > (By "better" I mean that over man

Re: Using eval, or something like it...

2008-11-20 Thread Steven D'Aprano
On Thu, 20 Nov 2008 11:12:56 +1000, James Mills wrote: > DON'T USE eval! If you're going to make a sweeping generalization like that, at least offer some alternatives, and explain why eval should be avoided. Otherwise your advice is just cargo-cult programming. eval is not inherently bad, it d

Re: function parameter scope python 2.5.2

2008-11-20 Thread Rafe
On Nov 21, 6:31 am, J Kenneth King <[EMAIL PROTECTED]> wrote: > I recently encountered some interesting behaviour that looks like a bug > to me, but I can't find the appropriate reference to any specifications > to clarify whether it is a bug. > > Here's the example code to demonstrate the issue: >

Re: Sending username password to a webpage

2008-11-20 Thread Chris Rebert
On Thu, Nov 20, 2008 at 7:52 PM, KDawg44 <[EMAIL PROTECTED]> wrote: > Hi, > > Is there a way to essentially simulate populating a text box and > calling a submit button on a webpage? I want to write an app that > gets a users information from a website and then uses that to get > information from

Re: Module Structure/Import Design Problem

2008-11-20 Thread Gabriel Genellina
En Thu, 20 Nov 2008 17:36:11 -0200, Stef Mientki <[EMAIL PROTECTED]> escribió: I'm not an expert, I even don't fully understand your problem, but having struggled with imports in the past, I've a solution now, which seems to work quit well. That's not very helpful, is it? Were you planning t

Sending username password to a webpage

2008-11-20 Thread KDawg44
Hi, Is there a way to essentially simulate populating a text box and calling a submit button on a webpage? I want to write an app that gets a users information from a website and then uses that to get information from another site. The first site requires a log in. Thanks for any advice that ge

Re: Problem with writing fast UDP server

2008-11-20 Thread Jean-Paul Calderone
On Fri, 21 Nov 2008 00:20:49 -0200, Gabriel Genellina <[EMAIL PROTECTED]> wrote: En Thu, 20 Nov 2008 14:24:20 -0200, Krzysztof Retel <[EMAIL PROTECTED]> escribió: On Nov 20, 4:00 pm, [EMAIL PROTECTED] wrote: On 20 Nov, 16:03, Krzysztof Retel <[EMAIL PROTECTED]> wrote: > I am struggling writing

Re: sorting list of complex numbers

2008-11-20 Thread Steven D'Aprano
On Wed, 19 Nov 2008 18:39:27 -0800, Paul Rubin wrote: > Terry Reedy <[EMAIL PROTECTED]> writes: >> >> Do your tuple destructuring in the first statement in your body and >> >> nothing will break. > > Why get rid of a useful feature that unclutters code? Unfortunately, the people who find it usef

Re: Module Structure/Import Design Problem

2008-11-20 Thread Steve Holden
Rafe wrote: > On Nov 21, 1:39 am, Steve Holden <[EMAIL PROTECTED]> wrote: >> Rafe wrote: >>> Hi, >>> I am in a situation where I feel I am being forced to abandon a clean >>> module structure in favor of a large single module. If anyone can save >>> my sanity here I would be forever grateful. >>> M

Re: How to get the class instance of a passed method ?

2008-11-20 Thread Rafe
On Nov 21, 6:41 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > Christian Heimes wrote: > > thanks Christian, > > cheers, > Stef OT: Just to pass along some great advice I got recently. Read PEP008. It contains guidelines for formatting your code. - Rafe -- http://mail.python.org/mailman/listinfo/p

Re: How to run a python app in the background?

2008-11-20 Thread Steve Holden
Aaron Brady wrote: > On Nov 20, 6:13 pm, [EMAIL PROTECTED] wrote: >> I'm a beginning programmer writing a tiny app with a TkInter GUI. >> Desired functionality: >> When the user enters a time interval, I want the windows to disappear, >> and the program to lie dormant until the scheduled time (curr

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-20 Thread Steven D'Aprano
On Thu, 20 Nov 2008 14:22:50 +1300, greg wrote: > Antoon Pardon wrote: > >> You are changing your argument. In a follow up you made the point that >> call by value should be as it was intended by the writers of the algol >> 60 report. > > No, I was countering the argument that "call by value" is

Re: Programming exercises/challenges

2008-11-20 Thread Edwin
On Nov 20, 6:28 am, [EMAIL PROTECTED] wrote: >     >> a diary manager compatible with my Emacs diary file (sometimes I >     >> don't want to open Emacs for a quick note) > >     Arnaud> You mean that you sometimes don't have emacs open? > > I am constantly amazed at work that people open a separat

Re: Module Structure/Import Design Problem

2008-11-20 Thread Rafe
On Nov 21, 2:36 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > >> I'm not an expert, I even don't fully understand your problem, > >> but having struggled with imports in the past, > >> I've a solution now, which seems to work quit well. > > > That's not very helpful, is it? Were you planning to kee

Re: Optional parameter object re-used when instantiating multiple objects

2008-11-20 Thread Steven D'Aprano
On Wed, 19 Nov 2008 10:05:23 -0800, Dennis Lee Bieber wrote: > Do you really want a "default" argument that changes value depending > upon actions performed in the /surrounding/ scope? And if you do, it is easy to get: default_y = "something" def parrot(x, y=None): if y is None: y =

Re: Module Structure/Import Design Problem

2008-11-20 Thread Rafe
On Nov 21, 1:39 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Rafe wrote: > > Hi, > > > I am in a situation where I feel I am being forced to abandon a clean > > module structure in favor of a large single module. If anyone can save > > my sanity here I would be forever grateful. > > > My problem i

Re: How to run a python app in the background?

2008-11-20 Thread Aaron Brady
On Nov 20, 6:13 pm, [EMAIL PROTECTED] wrote: > I'm a beginning programmer writing a tiny app with a TkInter GUI. > Desired functionality: > When the user enters a time interval, I want the windows to disappear, > and the program to lie dormant until the scheduled time (currently > using sched modul

Re: Tyrton ERP 1.0 released

2008-11-20 Thread CL (Ciu Loeng) Lam
HiCould the trython use the Oracle instead of the default postgresql ? 2008/11/19 erp software <[EMAIL PROTECTED]> > On Nov 18, 3:26 pm, Hartmut Goebel <[EMAIL PROTECTED]> wrote: > > On behalf of the Tryton team I'm proud to announce Tryton 1.0, > > an Open Source application platform and ERP. It

Re: Problem with writing fast UDP server

2008-11-20 Thread John Nagle
Gabriel Genellina wrote: En Thu, 20 Nov 2008 14:24:20 -0200, Krzysztof Retel <[EMAIL PROTECTED]> escribió: On Nov 20, 4:00 pm, [EMAIL PROTECTED] wrote: On 20 Nov, 16:03, Krzysztof Retel <[EMAIL PROTECTED]> wrote: > I am struggling writing fast UDP server. It has to handle around 1 > UDP pa

Re: Python / Debian package dependencies

2008-11-20 Thread Steven Samuel Cole
Hey Paul thanks for your reply! :-) 2008/11/21 Paul Boddie <[EMAIL PROTECTED]>: > Are you saying that psycopg2 needs setuptools for the setup.py script > to work? This isn't generally the case (or wasn't), but maybe the > "entry point" is a setuptools thing which would then demand that > software

Re: Python / Debian package dependencies

2008-11-20 Thread Steven Samuel Cole
Hi Stephane, thanks for your reply! :-) I do not get any notification or warning or whatever from dpkg, all output I get when running # sudo dpkg -i python-_0.0.1-4927-1_all.deb is Selecting previously deselected package python-. (Reading database ... 15026 files and directories cur

Re: Problem with writing fast UDP server

2008-11-20 Thread Gabriel Genellina
En Thu, 20 Nov 2008 14:24:20 -0200, Krzysztof Retel <[EMAIL PROTECTED]> escribió: On Nov 20, 4:00 pm, [EMAIL PROTECTED] wrote: On 20 Nov, 16:03, Krzysztof Retel <[EMAIL PROTECTED]> wrote: > I am struggling writing fast UDP server. It has to handle around 1 > UDP packets per second. I start

Re: SOAPpy SyntaxError

2008-11-20 Thread Jon-Pierre Gentil
[EMAIL PROTECTED] wrote: I'm going through the SOAP Web Services portion of Mark Pilgrim's tutorial and I'm getting this error when trying to build: File "/Users/username/Desktop/SOAPpy-0.12.0/SOAPpy/Client.py", line 46 from __future__ import nested_scopes SyntaxError: from __future__ imp

Re: Using eval, or something like it...

2008-11-20 Thread George Sakkis
On Nov 20, 6:54 pm, r0g <[EMAIL PROTECTED]> wrote: > It would seem from this setattr function that the proper term for these > is 'attributes'. That for many years I have considered pretty much any > named thing that may vary a 'variable' might be at the root of the > problem here as it's a very u

Re: Using eval, or something like it...

2008-11-20 Thread Scott David Daniels
r0g wrote: ... A class is like a template which combines a complex data type (made from a combination of other data types) and the methods that operate on that data type. You generally don't work with classes directly but you make instances of them, each instance has it's own internal state and

Re: Tyrton ERP 1.0 released

2008-11-20 Thread erp software
On Nov 18, 3:26 pm, Hartmut Goebel <[EMAIL PROTECTED]> wrote: > On behalf of the Tryton team I'm proud to announce Tryton 1.0, > an Open Source application platform and ERP. It provides modularity, > scalability and security. > > This is the first release of Tryton, a fork of OpenERP (formally know

Re: Test if list contains another list

2008-11-20 Thread str1442
Ali wrote: Its funny, I just visited this problem last week. ./Ali -- http://mail.python.org/mailman/listinfo/python-list That use of reduce is nice, but you better use all() / any(). -- http://mail.pytho

Re: Using eval, or something like it...

2008-11-20 Thread Chris Rebert
On Thu, Nov 20, 2008 at 3:54 PM, r0g <[EMAIL PROTECTED]> wrote: > Scott David Daniels wrote: >> r0g wrote: >>> John Machin wrote: You mention "variables of a class" but you then proceed to poke at an instance of the class Check out setattr (and getattr) in the docs. >>> The

Re: Searching for Regular Expressions in a string WITH overlap

2008-11-20 Thread Matimus
On Nov 20, 4:31 pm, Ben <[EMAIL PROTECTED]> wrote: > I apologize in advance for the newbie question.  I'm trying to figure > out a way to find all of the occurrences of a regular expression in a > string including the overlapping ones. > > For example, given the string 123456789 > > I'd like to use

Re: Python 3 __cmp__ semantic change?

2008-11-20 Thread George Sakkis
On Nov 20, 6:58 pm, [EMAIL PROTECTED] wrote: >     Johannes> Seems it was removed on purpose - I'm sure there was a good >     Johannes> reason for that, but may I ask why? > > Start here: > >     http://www.mail-archive.com/[EMAIL PROTECTED]/msg11474.html > > Also, a comment to this blog post sug

Re: function parameter scope python 2.5.2

2008-11-20 Thread George Sakkis
On Nov 20, 6:40 pm, J Kenneth King <[EMAIL PROTECTED]> wrote: > J Kenneth King <[EMAIL PROTECTED]> writes: > > > > > I recently encountered some interesting behaviour that looks like a bug > > to me, but I can't find the appropriate reference to any specifications > > to clarify whether it is a bug

Searching for Regular Expressions in a string WITH overlap

2008-11-20 Thread Ben
I apologize in advance for the newbie question. I'm trying to figure out a way to find all of the occurrences of a regular expression in a string including the overlapping ones. For example, given the string 123456789 I'd like to use the RE ((2)|(4))[0-9]{3} to get the following matches: 2345 4

Re: Python 3 __cmp__ semantic change?

2008-11-20 Thread Terry Reedy
Johannes Bauer wrote: Steve Holden schrieb: If it's not present then it would be worth reporting it as a 3.0 bug - there's still time to get it in, as the release isn't due until early December. Seems it was removed on purpose - I'm sure there was a good reason for that, but may I ask why? In

How to run a python app in the background?

2008-11-20 Thread kevintylr
I'm a beginning programmer writing a tiny app with a TkInter GUI. Desired functionality: When the user enters a time interval, I want the windows to disappear, and the program to lie dormant until the scheduled time (currently using sched module), when it would pop up another window and execute a c

Re: Optional parameter object re-used when instantiating multiple objects

2008-11-20 Thread Aaron Brady
On Nov 20, 5:54 pm, alex23 <[EMAIL PROTECTED]> wrote: > On Nov 20, 10:42 pm, Aaron Brady <[EMAIL PROTECTED]> wrote: > > > At first, I would expect it to define them at compile-time.  Then, > > when I learned there was no such thing, I would expect it to define > > them at execute-time.  What does t

Re: Python 3 __cmp__ semantic change?

2008-11-20 Thread skip
Johannes> Seems it was removed on purpose - I'm sure there was a good Johannes> reason for that, but may I ask why? Start here: http://www.mail-archive.com/[EMAIL PROTECTED]/msg11474.html Also, a comment to this blog post suggests creating a CmpMixin: http://oakwinter.com/code

Re: Optional parameter object re-used when instantiating multiple objects

2008-11-20 Thread alex23
On Nov 20, 10:42 pm, Aaron Brady <[EMAIL PROTECTED]> wrote: > At first, I would expect it to define them at compile-time.  Then, > when I learned there was no such thing, I would expect it to define > them at execute-time.  What does that have to do with evaluating a > default argument? It has -ev

Re: Using eval, or something like it...

2008-11-20 Thread r0g
Scott David Daniels wrote: > r0g wrote: >> John Machin wrote: >>> You mention "variables of a class" but you then proceed to poke >>> at an instance of the class >>> Check out setattr (and getattr) in the docs. >> The former i.e. the variables of an instance of a class. Thanks :-) > > Car

Re: Python 3 __cmp__ semantic change?

2008-11-20 Thread Terry Reedy
Christian Heimes wrote: Terry Reedy wrote: I was going to say "look in "What's New", but the __cmp__ removal is missing. So I filed http://bugs.python.org/issue4372 The whatsnew section of Python 3.0 is still empty. Guido didn't had time to write it. http://bugs.python.org/issue2306 What'

Re: function parameter scope python 2.5.2

2008-11-20 Thread alex23
On Nov 21, 9:40 am, J Kenneth King <[EMAIL PROTECTED]> wrote: > Of course, providing a shallow (or deep as necessary) copy makes it > work, I'm curious as to why the value passed as a parameter to a > function outside the class is passed a reference rather than a copy. You're passing neither a ref

Re: Python 3 __cmp__ semantic change?

2008-11-20 Thread Johannes Bauer
Steve Holden schrieb: > If it's not present then it would be worth reporting it as a 3.0 bug - > there's still time to get it in, as the release isn't due until early > December. Seems it was removed on purpose - I'm sure there was a good reason for that, but may I ask why? Instead of the sleek _

Re: How to get the class instance of a passed method ?

2008-11-20 Thread Stef Mientki
Christian Heimes wrote: thanks Christian, cheers, Stef -- http://mail.python.org/mailman/listinfo/python-list

Re: function parameter scope python 2.5.2

2008-11-20 Thread J Kenneth King
J Kenneth King <[EMAIL PROTECTED]> writes: > I recently encountered some interesting behaviour that looks like a bug > to me, but I can't find the appropriate reference to any specifications > to clarify whether it is a bug. > > Here's the example code to demonstrate the issue: > > class SomeObjec

Re: How to get the class instance of a passed method ?

2008-11-20 Thread Christian Heimes
Stef Mientki wrote: hello, if I pass a class method to a function, is it possible to determine the class instance in that function ? class test ( object ) : def My_Method ( self ) : return 22 def do_something ( parameter ) : # here I want to determine My_Instance My_Instance = test () d

function parameter scope python 2.5.2

2008-11-20 Thread J Kenneth King
I recently encountered some interesting behaviour that looks like a bug to me, but I can't find the appropriate reference to any specifications to clarify whether it is a bug. Here's the example code to demonstrate the issue: class SomeObject(object): def __init__(self): self.words

How to get the class instance of a passed method ?

2008-11-20 Thread Stef Mientki
hello, if I pass a class method to a function, is it possible to determine the class instance in that function ? class test ( object ) : def My_Method ( self ) : return 22 def do_something ( parameter ) : # here I want to determine My_Instance My_Instance = test () do something ( My_Inst

How to get the class instance of a passed method ?

2008-11-20 Thread Stef Mientki
hello, if I pass a class method to a function, is it possible to determine the class instance in that function ? class test ( object ) : def My_Method ( self ) : return 22 def do_something ( parameter ) : # here I want to determine My_Instance My_Instance = test () do something ( My_Inst

Re: Python 3 __cmp__ semantic change?

2008-11-20 Thread Christian Heimes
Terry Reedy wrote: I was going to say "look in "What's New", but the __cmp__ removal is missing. So I filed http://bugs.python.org/issue4372 The whatsnew section of Python 3.0 is still empty. Guido didn't had time to write it. http://bugs.python.org/issue2306 -- http://mail.python.org/mail

Re: Python 3 __cmp__ semantic change?

2008-11-20 Thread Terry Reedy
Ben Finney wrote: Steve Holden <[EMAIL PROTECTED]> writes: You will observe that __cmp__ no longer appears in the index: http://docs.python.org/dev/3.0/genindex-_.html I searched in vain for an official description of this changed behaviour. Where can we find an official description of how c

Re: Python 3 __cmp__ semantic change?

2008-11-20 Thread Steve Holden
Ben Finney wrote: > Steve Holden <[EMAIL PROTECTED]> writes: > >> You will observe that __cmp__ no longer appears in the index: >> >> http://docs.python.org/dev/3.0/genindex-_.html > > I searched in vain for an official description of this changed > behaviour. Where can we find an official descri

Re: Python 3 __cmp__ semantic change?

2008-11-20 Thread Ben Finney
Steve Holden <[EMAIL PROTECTED]> writes: > You will observe that __cmp__ no longer appears in the index: > > http://docs.python.org/dev/3.0/genindex-_.html I searched in vain for an official description of this changed behaviour. Where can we find an official description of how comparisons are d

Re: Programming exercises/challenges

2008-11-20 Thread r0g
Edwin wrote: > On Nov 18, 6:39 pm, [EMAIL PROTECTED] wrote: >> Hi guys, >> >> I'm learning Python by teaching myself, and after going through several >> tutorials I feel like I've learned the basics. Since I'm not taking a >> class or anything, I've been doing challenges/programs to reinforce the >

Tools for using virtual environments and PEP 370

2008-11-20 Thread Дамјан Георгиевски
Python 2.6 implemented PEP 370: Per-user site-packages Directory[1] Now, are there any tools I could use to create and activate virtual environments like workingenv, virtualenv etc. but that will use PYTHONUSERBASE instead of hard-linking the python program. [1] http://docs.python.org/dev/what

Re: Air Force1 and Air Jordan shoes PAYPAL wholesale

2008-11-20 Thread r0g
Pierre-Alain Dorange wrote: > air force1 shoes <[EMAIL PROTECTED]> wrote: > air force1 shoes. air force1 high shoes. air force1 light shoes > File "", line 1 > air force1 shoes. air force1 high shoes. air force1 light shoes > ^ > SyntaxError: invalid syntax > > LOL! X0D

Re: Python 3 __cmp__ semantic change?

2008-11-20 Thread Steve Holden
Johannes Bauer wrote: > [EMAIL PROTECTED] schrieb: >> On Nov 20, 1:18 pm, Johannes Bauer <[EMAIL PROTECTED]> wrote: >>> Hello group, >>> >>> I'm porting some code of mine to Python 3. One class has the __cmp__ >>> operator overloaded, but comparison doesn't seem to work anymore with that: >>> >>> T

Re: spam update

2008-11-20 Thread Grant Edwards
On 2008-11-20, News123 <[EMAIL PROTECTED]> wrote: > I didn't know aboug gmane. The UI isn't as fancy as Google's, but it's a way of separating yourself from the spammers. > Finding a solution which doesn't penalize gmail users is still > a good idea I think. Of course. One problem is that Goog

Re: Python 3 __cmp__ semantic change?

2008-11-20 Thread Christian Heimes
Johannes Bauer wrote: Hello group, I'm porting some code of mine to Python 3. One class has the __cmp__ operator overloaded, but comparison doesn't seem to work anymore with that: __cmp__ is gone Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3 __cmp__ semantic change?

2008-11-20 Thread Johannes Bauer
[EMAIL PROTECTED] schrieb: > On Nov 20, 1:18 pm, Johannes Bauer <[EMAIL PROTECTED]> wrote: >> Hello group, >> >> I'm porting some code of mine to Python 3. One class has the __cmp__ >> operator overloaded, but comparison doesn't seem to work anymore with that: >> >> Traceback (most recent call last

Re: Fwd: Problem with writing a long line in a text file

2008-11-20 Thread Matthew Barnett
Steve Holden wrote: Mohsen Akbari wrote: Dear guys, I'm a newbie in python and I have this problem with the code that I'm writing. There is a very long line which I wish to output it to a text file.But when I do this, in the output file, the result appears in two lines. I thought maybe that's b

Re: Python 3 __cmp__ semantic change?

2008-11-20 Thread Inyeol . Lee
On Nov 20, 1:18 pm, Johannes Bauer <[EMAIL PROTECTED]> wrote: > Hello group, > > I'm porting some code of mine to Python 3. One class has the __cmp__ > operator overloaded, but comparison doesn't seem to work anymore with that: > > Traceback (most recent call last): >   File "./parse", line 25, in

Re: spam update

2008-11-20 Thread News123
Hi, Grant Edwards wrote: > . . . It does penalizes legitimate users who post > from Google Groups. They've made the choice to use the same > posting conduit as spammers, and presumably they know the > consequences. Hmm I made the chooice to use google groups because sometimes I like to write

Python 3 __cmp__ semantic change?

2008-11-20 Thread Johannes Bauer
Hello group, I'm porting some code of mine to Python 3. One class has the __cmp__ operator overloaded, but comparison doesn't seem to work anymore with that: Traceback (most recent call last): File "./parse", line 25, in print(x < y) TypeError: unorderable types: IP() < IP() Was there som

Re: More elegant way to try running a function X times?

2008-11-20 Thread Boris Borcic
Tim Chase wrote: success = None for i in range(5): #Try to fetch public IP success = CheckIP() if success: break if not success: print "Exiting." sys.exit() Though a bit of an abuse, you can use if not any(CheckIP() for _ in range(5)): print "Exiting" sys.e

Re: help with comparison

2008-11-20 Thread tekion
On Nov 19, 11:36 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Nov 19, 10:21 pm,tekion<[EMAIL PROTECTED]> wrote: > > > > > Hi, > > Could some one take a look at the below code snipet which keep > > failing: > > > import optparse > > p = optparse.OptionParser(description="script to do stuff", >

Re: Fwd: Problem with writing a long line in a text file

2008-11-20 Thread Steve Holden
Mohsen Akbari wrote: > Dear guys, > > I'm a newbie in python and I have this problem with the code that I'm > writing. There is a very long line which I wish to output it to a text > file.But when I do this, in the output file, the result appears in two > lines. I thought maybe that's because the

Fwd: Problem with writing a long line in a text file

2008-11-20 Thread Mohsen Akbari
--- I use notepad to view my txt file. It appears that way in this tool. --- Here is the output of the debug lines that you mentioned: print *line*.find('\n') -1 print len(*line*) 1528 print repr(line) '0.0\t3.0\t10.0\t24.0\t30.0\t30.0\t30.0\t30.0\t30.0\t30.0\t30.0\t30.0\t30.0\t30.0\t30.0\t30.0\

Re: Module Structure/Import Design Problem

2008-11-20 Thread Stef Mientki
I'm not an expert, I even don't fully understand your problem, but having struggled with imports in the past, I've a solution now, which seems to work quit well. That's not very helpful, is it? Were you planning to keep the solution secret? sorry slip of the keyboard ;-) htt

Re: Using eval, or something like it...

2008-11-20 Thread Scott David Daniels
r0g wrote: John Machin wrote: You mention "variables of a class" but you then proceed to poke at an instance of the class Check out setattr (and getattr) in the docs. The former i.e. the variables of an instance of a class. Thanks :-) Careful here. Your wording seems to indicate you

Re: Memory error due to the huge/huge input file size

2008-11-20 Thread tejsupra
On Nov 10, 4:47 pm, [EMAIL PROTECTED] wrote: > Hello Everyone, > > I need to read a .csv file which has a size of 2.26 GB . And I wrote a > Python script , where I need to read this file. And my Computer has 2 > GB RAM Please see the code as follows: > > """ > This program has been developed to ret

Re: Python image library issue: domain users cannot save files?

2008-11-20 Thread [EMAIL PROTECTED]
I have no problem with the python builtin open which we use dayly. Thanks for the hints. Best, V On Nov 19, 5:56 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 19 Nov 2008 13:43:07 -0200, [EMAIL PROTECTED]   > <[EMAIL PROTECTED]> escribió: > > > Has anyone try to use PIL in a window

SOAPpy SyntaxError

2008-11-20 Thread [EMAIL PROTECTED]
Hello, I'm going through the SOAP Web Services portion of Mark Pilgrim's tutorial and I'm getting this error when trying to build: python setup.py build Traceback (most recent call last): File "setup.py", line 8, in from SOAPpy.version import __version__ File "/Users/username/Desktop/SOA

Re: Module Structure/Import Design Problem

2008-11-20 Thread Steve Holden
Stef Mientki wrote: > Rafe wrote: >> Hi, >> >> I am in a situation where I feel I am being forced to abandon a clean >> module structure in favor of a large single module. If anyone can save >> my sanity here I would be forever grateful. >> >> My problem is that classes in several modules share a c

Re: Module Structure/Import Design Problem

2008-11-20 Thread Steve Holden
Rafe wrote: > Hi, > > I am in a situation where I feel I am being forced to abandon a clean > module structure in favor of a large single module. If anyone can save > my sanity here I would be forever grateful. > > My problem is that classes in several modules share a common base > class which ne

Re: More elegant way to try running a function X times?

2008-11-20 Thread Banibrata Dutta
On Thu, Nov 20, 2008 at 11:58 PM, Steve Holden <[EMAIL PROTECTED]> wrote: > Gilles Ganault wrote: > > Hello > > > > As a newbie, it's pretty likely that there's a smarter way to do this, > > so I'd like to check with the experts: > > > > I need to try calling a function 5 times. If successful, mov

Re: More elegant way to try running a function X times?

2008-11-20 Thread Steve Holden
Gilles Ganault wrote: > Hello > > As a newbie, it's pretty likely that there's a smarter way to do this, > so I'd like to check with the experts: > > I need to try calling a function 5 times. If successful, move on; If > not, print an error message, and exit the program: > > = > success = No

Re: Module Structure/Import Design Problem

2008-11-20 Thread Stef Mientki
Rafe wrote: Hi, I am in a situation where I feel I am being forced to abandon a clean module structure in favor of a large single module. If anyone can save my sanity here I would be forever grateful. My problem is that classes in several modules share a common base class which needs to impleme

Re: More elegant way to try running a function X times?

2008-11-20 Thread Tim Chase
success = None for i in range(5): #Try to fetch public IP success = CheckIP() if success: break if not success: print "Exiting." sys.exit() Though a bit of an abuse, you can use if not any(CheckIP() for _ in range(5)): print "Exiting" sys.exit() I don't se

Re: More elegant way to try running a function X times?

2008-11-20 Thread Boris Borcic
Tim Chase wrote: success = None for i in range(5): #Try to fetch public IP success = CheckIP() if success: break if not success: print "Exiting." sys.exit() Though a bit of an abuse, you can use if not any(CheckIP() for _ in range(5)): print "Exiting" sys

Re: Python / Debian package dependencies

2008-11-20 Thread Paul Boddie
On 20 Nov, 02:14, "Steven Samuel Cole" <[EMAIL PROTECTED]> wrote: > > I am trying to build a debian package for my python modules using > stdeb and dpkg-buildpackage. The package building itself works, I also > managed to have an entry point created and I can use my python modules > on the Ubuntu v

Re: how to acces the block inside of a context manager as sourcecode

2008-11-20 Thread Daniel
Hi Aaron, the dataStore combines both the printing and analysis (it will create a report). Unfortunately the end of the block already needs to be known in __enter__, as the report starts to print during the measurement. I decided to do it the following way: __enter__ gets the start line number us

Re: Problem with writing fast UDP server

2008-11-20 Thread Krzysztof Retel
On Nov 20, 4:00 pm, [EMAIL PROTECTED] wrote: > On 20 Nov, 16:03, Krzysztof Retel <[EMAIL PROTECTED]> > wrote: > > > > > Hi guys, > > > I am struggling writing fast UDP server. It has to handle around 1 > > UDP packets per second. I started building that with non blocking > > socket and threads.

Re: Ip format

2008-11-20 Thread luca72
Many thanks for your help I have also find the correct socket function: ip 1578568204 ip = socket.inet_aton(ip) ip_dot = socket.inet_ntoa(ip) Thanks Luca On 20 Nov, 12:36, Tim Chase <[EMAIL PROTECTED]> wrote: > > Hello i have this ip 1578568204 > > > how socket function i can have the ip dotted

Re: redirecting stdout/err to mysql table

2008-11-20 Thread Nebur
I've had a similar requiredment and made a small tool for direct logging into databases (see: http://sourceforge.net/projects/rrlog/ ) It's origins are somewhat older than the Python 2.3 standard logging framework, so it can be used without that (but can also be simply integrated with it.) It even

  1   2   >