I wrote
I'm trying to build the recent Python-3.2a (SVN).
It fails in
Lib/tokenize.py (line 87)
85 def group(*choices): return '(' + '|'.join(choices) + ')'
86 def any(*choices): return group(*choices) + '*'
87 def maybe(*choices): return group(*choices) + '?'
with: TypeError: group() argum
--
http://mail.python.org/mailman/listinfo/python-list
Dave Angel wrote:
For that, I'd suggest reserving a directory at a known location, doing
an os.path.dirname() on that directory, and building a list of module
names. Then use __import__() to load them, and build a list of module
objects, and a list of classes in those modules. Suggest classn
Nadav, it's because reverse() modifies the list in-place. I've gotten this
gotcha many times,
If you had done:
>>> a = [1,2,3,4]
>>> a.reverse()
>>> a
[4, 3, 2, 1]
Or even better:
>>> a = [1,2,3,4][::-1]
>>> a
[4, 3, 2, 1]
Cheers,
Xav
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 12, 12:43 am, TerryP wrote:
> On Aug 27, 9:22 pm, r wrote:
> > *Too many noobs start out with the "from Tkinter import *" idiom,
>
> 'import Tkinter as tk', that I like -- my fingers are lazier then the
> mind ;).
>
> When I see the from whatever import *; I generally regard it in one of
>
The reverse function is a function to reverse the list in place, not a
function to get the reverse of the list:
x = [1,2,3,4]
y = x
z = x.reverse()
will result in:
x = y = [4,3,2,1]
z = None
--
André Engels, andreeng...@gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
Help on built-in function reverse:
reverse(...)
L.reverse() -- reverse *IN PLACE*
On Mon, Oct 12, 2009 at 1:22 AM, Nadav Chernin wrote:
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
--
http://mail.python.org/mailman/listinfo/python-list
Andre Engels wrote:
The reverse function is a function to reverse the list in place, not a
function to get the reverse of the list:
x = [1,2,3,4]
y = x
z = x.reverse()
will result in:
x = y = [4,3,2,1]
z = None
.reverse returns None. See the documentation.
--
Erik Max Francis && m...@alcyo
...becauase you were looking for:
reversed([1,2,3,4])
Chris
--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I need to write a stand-alone gui written in python to operate with an
app written in C
via rpc. I've managed to get an older version of the pynfs demo client
and server to together.
However, a client written in Python and a server written in "C", gen'd
from the same *.x file don't see
This may not be the correct list for this issue, if so I would appreciate if
anyone could forward it to the correct list.
I had experienced a number of problems with standard library SocketServer when
implementing a tcp forking server under python 2.6. I fixed every
issue including some timin
This code fails:
##
from multiprocessing import Manager
manager = Manager()
ns_proxy = manager.Namespace()
evt_proxy = manager.Event()
ns_proxy.my_event_proxy = evt_proxy
print ns_proxy.my_event_proxy
##
Traceback (most recent call last):
File "test_nsproxy.py", line 39, in
print ns_
Speaking of itch, that's exactly the phrase Eric Steven Raymond uses
for the same purpose in his famous essay: "Cathedral and the Bazaar"
(http://www.catb.org/~esr/writings/cathedral-bazaar/). Someone
Something, you should read this essay first, before anything else.
Cheers,
Brendon
PS: I agree w
Enrico Franchi ha scritto:
spazza wrote:
...snip...
Non mi pare che al momento Python sia in grado di reggere tutto questo.
Scusa, proseguendo in questa maniera andiamo pesantemente OT.
Rimane pero' il problema di *dimostrare* la tua affermazione. Da quanto
leggo, mi sembra che tu di Python
On Oct 10, 6:00 am, Neil Hodgson
wrote:
> kakarukeys:
>
> > I followed your hints, and wrote the following code. It works for most
> > clipboard formats except files. Selecting and copying a file, followed
> > by backup() and restore() throw an exception:
>
> For some formats the handle stored
Environment:
PythonWin 2.5.4 (r254:67916, Apr 27 2009, 15:41:14) [MSC v.1310 32 bit
(Intel)] on win32.
Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin'
for further copyright information.
Evil Code:
class Foo:
def __init__(self, *args):
print args
Fo
On Oct 11, 3:04 am, metal wrote:
> Environment:
>
> PythonWin 2.5.4 (r254:67916, Apr 27 2009, 15:41:14) [MSC v.1310 32 bit
> (Intel)] on win32.
> Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin'
> for further copyright information.
>
> Evil Code:
>
> class Foo:
> def
Perl's directory tree traversal facility is provided by the function
find of the File::Find module. This function accepts an optional
callback, called postprocess, that gets invoked "just before leaving
the currently processed directory." The documentation goes on to
say "This hook is handy fo
The following fragment is from a tiny maintenance script that,
among other things, edits itself, by rewriting the line that ends
with '### REPLACE'.
##
import re
import fileinput
LAST_VERSION = 'VERSION 155' ### REPLACE
ser
Dear comp.lang.python users,
Firstly, this a is a Job post for a on-site Freelance Python Job in
Belgium, I know
this is frowned upon by some, so I am very sorry if it is not well
received,
but as it is such a great job, I have been encouraged to post this to
the list.
So, apology done, and hopef
On 2009-10-11, Bearophile wrote:
> Peter Billam:
>> I remember in the structured-programming revolution the
>> loop { ... if whatever {break;} ... }
>> idiom was The Recommended looping structure, because the code is
>> more maintainable.
>
> I think "break" was almost the antithesis of structu
Peter Billam:
> I remember in the structured-programming revolution the
> loop { ... if whatever {break;} ... }
> idiom was The Recommended looping structure, because the code is
> more maintainable.
I think "break" was almost the antithesis of structured programming,
it was seen as the little
kakarukeys:
> I followed your hints, and wrote the following code. It works for most
> clipboard formats except files. Selecting and copying a file, followed
> by backup() and restore() throw an exception:
For some formats the handle stored on the clipboard may not be a
memory handle so may no
On Oct 9, 1:36 pm, Rob Garrett wrote:
> Hi,
> I'm trying to get gnuplot to display multiple data series on a single
> plot using gnuplot in python. I've searched around and haven't found
> a solution to how to do this when I have a variable-length list of
> plots to add.
>
What module are you us
Steven D'Aprano wrote:
Back in ancient days when dinosaurs walked the Earth,
and I was programming in THINK Pascal on Apple Macintosh System 6, I'd go
into nervous palpitations writing the equivalent of "while True" because
if I got it wrong, I'd lock up the machine and need to hit the power
b
On 10.10.2009 5:03, Kazimir Majorinc wrote:
I am Lisp programmer and I write an article on issues
as macros, fexprs and eval. I want to compare opinions
of programmers of various programming languages on eval.
If you want to contribute your opinion on eval in Python
(or you want to look at resu
RDrewD wrote:
my_prissy_little_indicator_variable = true
while (my_prissy_little_indicator_variable){
}
isn't satisfying because it doesn't guard the with any
assurance that the loop invariant will be true before you enter into
that block of code.
The loop invariant and the exit conditio
Mensanator wrote:
while not done:
...
if n==1: done = True
...
Seems to me that 'while not done:' is no better than
'while True:', because in both cases you have to look
inside the loop to find out what the exit condition
is.
Using a more meaningful name for the flag can help,
but
Chris Withers wrote:
...becauase you were looking for:
reversed([1,2,3,4])
OK, but my question is generic. Why when I use object's function that
changed values of the object, I can't to get value of it on the fly
without writing additional code?
>>> a=[1,3,2,4]
>>> a.so
I have a daemon process which will call a python program.
What do I do if I want to dump the exception when the python program exist
by uncaught exception.
Thanks a lot!
--
[1;36mâ»Post by [37mcommand [36mfrom [33m59-124-255-226.HINET-IP.[m
[1;36mèé¼ çé¦é¦ä¹³é
ªæ´[31mË[33m
kj wrote:
I'm coaching a group of biologists on basic Python scripting. One
of my charges mentioned that he had come across the advice never
to use loops beginning with "while True".
It's possible this is something he was told in relation to
another language that has more options.
For example
Dave Angel wrote:
The point you should get from that link is
"Don't do circular imports. Ever."
No, I would say the lesson to be learned from this is
"don't use the same file as both a main script and an
imported module".
I would create another file called e.g. 'main.py' that
simply contain
On Oct 12, 7:29 am, r wrote:
> Obviously you have never used packages that are meant for global
> importing or you would know how such systems are designed. OpenGL is
> a good example. OpenGL has over 3600 functions and constants all of
> which start with "gl" and GL respectivly. However the Tkin
Hi everyone,
How can I transfer a string from a cgi at server side to a
javascript function at client side as an argument? Here is my case:
1. client side: javascript in html page:
...
mygrid = new dhtmlXGridObject('gridbox');
...
var cgi3 = "/bop-cgi/xbop";
cgi3 += "?requestIds=[wisco.mPr
â» å¼è¿°ãcommand (æ¾å°èªå·±çä¸ç天)ãä¹éè¨ï¼
: I have a daemon process which will call a python program.
: What do I do if I want to dump the exception when the python program exist
: by uncaught exception.
: Thanks a lot!
By the way, the python program is multi-thread
--
[1;36
MRAB wrote:
And when someone says "January 30", do they really mean the day before
the last day of the month?
No, no, that's January -2, a *completely* different thing!
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Nadav Chernin wrote:
>
> Chris Withers wrote:
>
> ...becauase you were looking for:
>
> reversed([1,2,3,4])
>
> OK, but my question is generic. Why when I use object's function that
> changed values of the object, I can't to get value of it on the fly
> without writing additional code?
>
Emeka wrote:
Hello All,
I am new to python , and my aim is to use it to write sugar-based
applications on XO(OLPC). I am not new to programming in general, I would
want to know the best route to take in learning python. I have
background in FP and Imperative languages.
Regards,
Emeka
Welcom
Hi, I woul like to start a program from within python (under linux):
This works fine:
import os
path = 'tclsh AppMain.tcl hej.gb'
os.system(path)
The file AppMain.tcl is the executable and the file hej.gb is a
textfile in the same directory.
The text file gets opened in the app in the correct wa
On Oct 12, 7:55 am, Helmut Jarausch
wrote:
> I wrote
> I'm trying to build the recent Python-3.2a (SVN).
> It fails in
> Lib/tokenize.py (line 87)
>
> 85 def group(*choices): return '(' + '|'.join(choices) + ')'
> 86 def any(*choices): return group(*choices) + '*'
> 87 def maybe(*choices): ret
On Mon, Oct 12, 2009 at 10:44 AM, Nadav Chernin
wrote:
>
> Chris Withers wrote:
>
> ...becauase you were looking for:
>
> reversed([1,2,3,4])
>
> OK, but my question is generic. Why when I use object's function that
> changed values of the object, I can't to get value of it on
> greg (g) wrote:
>g> MRAB wrote:
>>> And when someone says "January 30", do they really mean the day before
>>> the last day of the month?
>g> No, no, that's January -2, a *completely* different thing!
But for someone else it would be February -2.
--
Piet van Oostrum
WWW: http://pietvano
kj wrote:
Perl's directory tree traversal facility is provided by the function
find of the File::Find module. This function accepts an optional
callback, called postprocess, that gets invoked "just before leaving
the currently processed directory." The documentation goes on to
say "This hook is
On Mon, Oct 12, 2009 at 4:27 AM, Piet van Oostrum wrote:
>> greg (g) wrote:
>
>>g> MRAB wrote:
And when someone says "January 30", do they really mean the day before
the last day of the month?
>
>>g> No, no, that's January -2, a *completely* different thing!
>
> But for someone else
greg wrote:
Dave
Angel wrote:
The point you should get from that link is
"Don't do circular imports. Ever."
No, I would say the lesson to be learned from this is
"don't use the same file as both a main script and an
imported module".
I would create another file called e.g. 'main.py' that
TerryP wrote:
Somehow I doubt that "Look up X in dictionary D" could ever be more
efficient (in terms of space and time, at least) then "Check if X is
equal to Y". It's not about what you get in runtime but what you get
in monkey time.
Most expressions that would make someone reach for a C-lik
Dear All
I am running this piece of code:
from threading import Thread
import copy
class Ashish(Thread):
def __init__(self, i):
Thread.__init__(self)
self.foo = i
def run(self):
print (self, self.foo)
d= Ashish(4)
e = copy.deepcopy(d) <--- Exception here...
On Sunday 11 October 2009 11:56:55 pm Dennis Lee Bieber wrote:
> In this situation, the middle exit works best -- using
> non-optimal Python
>
> while True:
> lin = file_object.readline()
> if not lin: break
> do something with lin
Actually,
On Wed, 2009-10-07, OdarR wrote:
> hello,
>
> * this is not a troll *
>
> which kind of help you have with your favorite editor ?
Syntax highlighting and help with the indentation (move to the
right after an else:, keep in the same column normally, etc).
Nothing else specific to Python.
> personn
VYAS ASHISH M-NTB837 wrote:
Dear All
I am running this piece of code:
from threading import Thread
import copy
class Ashish(Thread):
def __init__(self, i):
Thread.__init__(self)
self.foo = i
def run(self):
print (self, self.foo)
d= Ashish(4)
e = copy.de
On Mon, Oct 12, 2009 at 11:32 PM, Luis Zarrabeitia wrote:
> Actually, in python, this works even better:
>
> for lin in iter(file_object.readline, ""):
>... do something with lin
>
>
What about
>>> with open(path_string) as f:
>>> for line in f:
>>> # do something
Cheers,
X
On 11 Oct, 10:53 pm, fordhai...@gmail.com wrote:
I've been programming since about 3 years, and come to think of it
never
written anything large. I know a few languages: c, python, perl, java.
Right
now, I just write little IRC bots that basically don't do anything.
I have two questions:
1) W
Piet van Oostrum wrote:
greg (g) wrote:
g> MRAB wrote:
And when someone says "January 30", do they really mean the day before
the last day of the month?
g> No, no, that's January -2, a *completely* different thing!
But for someone else it would be February -2.
When is February 0? :-)
On Oct 12, 7:55 am, Helmut Jarausch
wrote:
> I wrote
> I'm trying to build the recent Python-3.2a (SVN).
> It fails in
> Lib/tokenize.py (line 87)
[...]
> with: TypeError: group() argument after ** must be a mapping, not tuple
I believe I've found the source of this problem: the --with-tsc
conf
Ben Finney wrote:
> TerryP writes:
>
>> One thing you should also learn about me, is I do not deal in
>> absolutes.
>
> What, *never*? That's a pretty uncompromising position to h—
>
> I'll get my coat.
Note, he said he does not deal in absolutes. He didn't deny that he does.
Mel.
Luis Zarrabeitia wrote:
> On Sunday 11 October 2009 11:56:55 pm Dennis Lee Bieber wrote:
>> In this situation, the middle exit works best -- using
>> non-optimal Python
>>
>> while True:
>> lin = file_object.readline()
>> if not lin: break
>> do something with lin
>
> Actually, in python, this wo
Hi,
If I define my own class and use pickle to serialize the objects in
this class, will the serialized object be successfully read in later
version of python.
What if I serialize (using pickle) an object of a class defined in
python library, will it be successfully read in later version of
pytho
hello
im using mechanize .
i want to send some post value by use mechanize.
but problem is one of POST value in html source is
looks like below.
post.category.categoryNo=[*1]
anyway so i was tried several method but all failed.
here is source .
.
.
br = mechanize.browser()
br.select_form(nr=0)
On 12 oct, 00:08, Philip Semanchuk wrote:
> On Oct 11, 2009, at 11:56 PM, Dennis Lee Bieber wrote:
>
> > On Sun, 11 Oct 2009 13:45:54 -0700 (PDT), Yusniel
> > declaimed the following in gmane.comp.python.general:
>
> >> prolog.consult("hanoi.pl")
> >
> >> where "hanoy.pl" is a program with
On 03:17 pm, pengyu...@gmail.com wrote:
Hi,
If I define my own class and use pickle to serialize the objects in
this class, will the serialized object be successfully read in later
version of python.
What if I serialize (using pickle) an object of a class defined in
python library, will it be s
On Oct 12, 2009, at 11:27 AM, Yusniel wrote:
On 12 oct, 00:08, Philip Semanchuk wrote:
On Oct 11, 2009, at 11:56 PM, Dennis Lee Bieber wrote:
On Sun, 11 Oct 2009 13:45:54 -0700 (PDT), Yusniel
declaimed the following in gmane.comp.python.general:
prolog.consult("hanoi.pl")
whe
Yusniel wrote:
> Exactly. "hanoi.pl" is a prolog program. I'm using Ubuntu(9.04) 32
> bit. In this case, this error is generated when I try run the above
> script. However, others scripts in python, not throws this error, I
> think that there are some problem with this library.
Maybe, but it's imp
james27 wrote:
>
> hello
> im using mechanize .
> i want to send some post value by use mechanize.
> but problem is one of POST value in html source is
> looks like below.
>
> post.category.categoryNo=[*1]
>
> anyway so i was tried several method but all failed.
>
> here is source .
> .
> .
>
On Oct 12, 10:15 am, Bjorn wrote:
> Hi, I woul like to start a program from within python (under linux):
> This works fine:
>
> import os
> path = 'tclsh AppMain.tcl hej.gb'
> os.system(path)
>
> The file AppMain.tcl is the executable and the file hej.gb is a
> textfile in the same directory.
> Th
I have Python program that lets me interact with a bunch of files.
Unfortunately, the program assumes that the bunch is fairly small, and
I have thousands of files on relatively slow storage. Just creating a
list of the file names takes several minutes, so I'm planning to
replace the list with an
Hi
I have an object which has a run() method. But I can call it only once.
Calling the start() again will give
RuntimeError: thread already started
So what is the way to do this?
I thought of doing a deep copy of the object, as shallow copy will also
lead to the above error.
I tried this:
- d
On 2009-10-12 11:21 AM, samwyse wrote:
Previous discussions in c.l.py (primarily those that propose new
functions to be added to itertools) claim that people do this all the
time, but seem woefully short of actual examples. Before I possibly
re-invent the wheel(*), could someone point me to som
On Oct 12, 12:19 am, Donn wrote:
> On Monday 12 October 2009 00:53:42 Someone Something wrote:> 1) What should I
> start programming (project that takes 1-2 months, not very
> > short term)?
> > 2) Whtat are some good open source projects I can start coding for?
>
> These kinds of questions amaze
On Monday 12 October 2009 09:47:23 am Xavier Ho wrote:
> On Mon, Oct 12, 2009 at 11:32 PM, Luis Zarrabeitia wrote:
> > Actually, in python, this works even better:
> >
> > for lin in iter(file_object.readline, ""):
> >... do something with lin
>
> What about
>
> >>> with open(path_string)
Che M wrote:
2. Start your own.
As long it is not another new code editor for Python.
There are a lot already.
How about writing a web framework instead? [grins & ducks]
-tkc
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I am new to python I have few questions regarding it. I have to me a website
with python scripts from one server to another server , when I moved the
content the website is not working, do I have to recompile the code in new
server too. Can any help me to resolve this issue ??
Thanks
Bhanu
--
VYAS ASHISH M-NTB837 schrieb:
> I have an object which has a run() method. But I can call it only once.
> Calling the start() again will give
>
> RuntimeError: thread already started
>
> So what is the way to do this?
>
> I thought of doing a deep copy of the object, as shallow copy will also
>
On Oct 1, 6:01 pm, Laszlo Nagy wrote:
> I'm looking for an open source, AJAX based widget/windowing framework.
> Here is what I need:
>
> - end user opens up a browser, points it to a URL, logs in
> - on the server site, sits my application, creating a new session for
> each user that is logged in
On Oct 12, 3:36�am, greg wrote:
> Mensanator wrote:
> > while not done:
> > � � ...
> > � � if n==1: done = True
> > � � ...
>
> Seems to me that 'while not done:' is no better than
> 'while True:', because in both cases you have to look
> inside the loop to find out what the exit condition
> is.
On Oct 5, 8:26 am, "Diez B. Roggisch" wrote:
> james27 wrote:
>
> > hello..
> > im new to python.
> > i have some problem with mechanize.
> > before i was used mechanize with no problem.
> > but i couldn't success login with some site.
> > for several days i was looked for solution but failed.
> >
The function that I want to run is part of a class, not a standalone
function. There are several class member variables also.
Regards,
Ashish Vyas
-Original Message-
From: python-list-bounces+ntb837=motorola@python.org
[mailto:python-list-bounces+ntb837=motorola@python.org] On
Tim Chase wrote:
>> Month arithmetic is a bit of a mess, since it's not clear how
>> to map e.g. Jan 31 + one month.
>
> "Jan 31 + one month" usually means "add one to the month value and then
> keep backing off the day if you get an exception making the date", so
> you'd get Feb 31, exception, Fe
Rhodri James wrote:
> On Fri, 09 Oct 2009 13:39:43 +0100, Tim Chase
> wrote:
>
>>> Month arithmetic is a bit of a mess, since it's not clear how
>>> to map e.g. Jan 31 + one month.
>>
>> "Jan 31 + one month" usually means "add one to the month value and
>> then keep backing off the day if you get
Mensanator wrote:
On Oct 12, 3:36�am, greg wrote:
Mensanator wrote:
while not done:
� � ...
� � if n==1: done = True
� � ...
Seems to me that 'while not done:' is no better than
'while True:', because in both cases you have to look
inside the loop to find out what the exit condition
is.
Usin
VYAS ASHISH M-NTB837 schrieb:
>
> The function that I want to run is part of a class, not a standalone
> function. There are several class member variables also.
Then try:
class MyClass(object):
...
def run(self):
""" do threaded stuff here """
...
Thread(target=MyClass().r
On Oct 10, 9:44 am, "Gabriel Genellina"
wrote:
> The good thing is that, if the backend package is properly installed
> somewhere in the Python path ... it still works with no modifications.
I'd like to get to zero-installation if possible. It's easy with
simple python scripts, why not packages
Mensanator wrote:
On Oct 12, 3:36�am, greg wrote:
Mensanator wrote:
while not done:
� � ...
� � if n==1: done = True
� � ...
Seems to me that 'while not done:' is no better than
'while True:', because in both cases you have to look
inside the loop to find out what the exit condition
is.
U
Hi;
I have the following code:
for row in data:
i += 1
total = 0
quantity = form.getfirst('order_' + str(i), '')
if quantity != '':
sql = 'select * from products p join %s c on p.ID=c.ID where
c.ID=%s;' % (client, str(i))
cursor.execute(sql)
stuf
Chris Rebert wrote:
> On Mon, Oct 12, 2009 at 4:27 AM, Piet van Oostrum wrote:
>>> greg (g) wrote:
>>
>>> g> MRAB wrote:
> And when someone says "January 30", do they really mean the day before
> the last day of the month?
>>
>>> g> No, no, that's January -2, a *completely* different
On Oct 12, 1:02�pm, John Reid wrote:
> Mensanator wrote:
> > On Oct 12, 3:36 am, greg wrote:
> >> Mensanator wrote:
> >>> while not done:
> >>> ...
> >>> if n==1: done = True
> >>> ...
> >> Seems to me that 'while not done:' is no better than
> >> 'while True:', because in both cases you have to
Chris
On Mon, Oct 12, 2009 at 11:33 AM, Victor Subervi wrote:
> Hi;
> I have the following code:
>
> for row in data:
> i += 1
> total = 0
>
In the above line, you're setting total to 0 each time the loop runs.
> quantity = form.getfirst('order_' + str(i), '')
> if
On Mon, 12 Oct 2009 11:33:31 -0700, Victor Subervi
wrote:
Hi;
I have the following code:
for row in data:
i += 1
total = 0
[snip]
As you can see, the total doesn't accumulate! There are two rows. The
second
"Total 1:" should show "1.98", not 0! What gives?
You are sett
Ouch! You're right!
<;)
V
On Mon, Oct 12, 2009 at 1:38 PM, Rami Chowdhury wrote:
> On Mon, 12 Oct 2009 11:33:31 -0700, Victor Subervi <
> victorsube...@gmail.com> wrote:
>
> Hi;
>> I have the following code:
>>
>>for row in data:
>> i += 1
>> total = 0
>>
> [snip]
>
>> As you can
Victor Subervi wrote:
Hi;
I have the following code:
[snip]
price = str(int(stuff[5]*100))
price = price[0:len(price)-2] + '.' + price[-2:]
[snip]
This is simpler:
price = "%.2f" % stuff[5]
(not that I like what you're doing with it; leaving it as a float and
just fo
On Oct 12, 12:32 pm, Mensanator wrote:
> On Oct 12, 1:02 pm, John Reid wrote:
> > Mensanator wrote:
> > > On Oct 12, 3:36 am, greg wrote:
> > >> Mensanator wrote:
> > >>> while not done:
> > >>> ...
> > >>> if n==1: done = True
> > >>> ...
> > >> Seems to me that 'while not done:' is no better t
Hi, I am new to this list. I have some goals in mind but I am unsure of
where to start. I want to connect to my gmail account, find specific emails
and save the contents of the emails to a txt file. I would like to open none
txt files (.nc files) which can be opened in note pad and saved as a txt.
On Mon, 2009-10-12, Bjorn wrote:
>
> Hi, I woul like to start a program from within python (under linux):
> This works fine:
>
> import os
> path = 'tclsh AppMain.tcl hej.gb'
> os.system(path)
>
> The file AppMain.tcl is the executable
Not really -- tclsh is the executable from Python's and the sy
Hello,
googling I found several ways of implementing a "dictionary with
attribute-style access".
1. ActiveState cookbook: http://code.activestate.com/recipes/473786/
2. ActiveState cookbook:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/361668
3. web2py codebase: Storage(dict)
I
On Mon, 2009-10-12, §ä´m¦Ã¤vª�...@¤ù¤à wrote:
> ?? ???z?mcommand (???m???v...@)?n???G
> : I have a daemon process which will call a python program.
> : What do I do if I want to dump the exception when the python program exist
> : by uncaught exception.
> : Thanks a lot!
>
> By
On Mon, 2009-10-12, Philip Semanchuk wrote:
>
> On Oct 11, 2009, at 4:45 PM, Yusniel wrote:
>
>> Hi. I did installed a library for python named pyswip-0.2.2 but when I
>> run a python example with the next lines, the python interpreter, it
>> throw me the following error: "Error en el bus". The cod
Hey guys,
this is supposed to be a Python mailing list...
Both editors are great and are with great potentials. I do use both of
them daily, though for different purposes. It is meaningless to start
this old issue of preferences anew.
--
Linux: Choice of a GNU Generation
--
http://mail.python.
Hi,
I'm wondering what is the general way to define __hash__. I could add
up all the members. But I am wondering if this would cause a
performance issue for certain classes.
Regards,
Peng
#!/usr/bin/env python
class A:
def __init__(self, a, b) :
self._a = a
self._b = b
def __str__
On Mon, Oct 12, 2009 at 3:45 PM, Peng Yu wrote:
> Hi,
>
> I'm wondering what is the general way to define __hash__. I could add
> up all the members. But I am wondering if this would cause a
> performance issue for certain classes.
>
> Regards,
> Peng
>
>
> #!/usr/bin/env python
>
> class A:
> de
On 2009-10-12 15:45 PM, Peng Yu wrote:
Hi,
I'm wondering what is the general way to define __hash__. I could add
up all the members. But I am wondering if this would cause a
performance issue for certain classes.
Unless if you are very familiar with the math of hash functions, I don't
recomme
Peng Yu schrieb:
> Hi,
>
> I'm wondering what is the general way to define __hash__. I could add
> up all the members. But I am wondering if this would cause a
> performance issue for certain classes.
> def __hash__(self):
> return self._a + self._b
The hash of a tuple is based on the ha
1 - 100 of 141 matches
Mail list logo