Hi,
with mod_wsgi (apache2) a process created with os.system()
has a modified signal mask, that SIGPWR gets ignored.
A small wrapper (see bottom) resets the signal mask and uses execv to
run the programm.
Unfortunately python does not support sigprocmask. Is there
any other way to reset the sign
On Jan 4, 5:11 am, Carsten Haese <[EMAIL PROTECTED]> wrote:
> On Thu, 2008-01-03 at 17:25 -0800, t_rectenwald wrote:
> > On Jan 3, 7:47 pm, t_rectenwald <[EMAIL PROTECTED]> wrote:
> > > I have a python script that uses the cx_Oracle module. I have a list
> > > of values that I iterate through via
On Jan 3, 8:06 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
> In Py3k this will be a syntax error, like assigning to None is now.
> Possibly also in 2.6.
thanks. I feed much better with that :-)
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 3, 5:43 pm, Matias Surdi <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Could anybody tell me which is the easier way to do a SOAP call to a web
> service wich requires an http header to be present?
>
> I can't figure it out.
>
> Thanks a lot
>
> Some code I'm using:
>
> import SOAPpy
> s =
> SOAPpy.S
Hi all,
The Jython team got an honourable mention on the Headius blog this
morning. Apparently they have got Django working with the latest
builds of Jython: http://headius.blogspot.com/2008/01/jythons-back-baby.html
So congratulations!
--
Ant.
--
http://mail.python.org/mailman/listinfo/python-
grbgooglefan wrote:
> char* plevel = NULL;
> if(NULL != (plevel = PyString_AsString(pResult))){
> ret = 0;
> strncpy(szEvalResult,plevel,strlen(plevel));
strncpy doesn't check the size of the target buffer, so that's no
different from just doing strcpy(szEvalR
Reedick, Andrew wrote:
> As a Perl monkey in the process of learning Python, I just stepped on
> the "'1' (string) is not the same as 1 (integer) in regards to keys for
> dictionaries/hashes" landmine.
This isn't a landmine; this is a _good_ thing. Python is strongly typed.
> Is there a good wa
jo3c wrote:
> i have a 2000 files with header and data
> i need to get the date information from the header
> then insert it into my database
> i am doing it in batch so i use glob.glob('/mydata/*/*/*.txt')
> to get the date on line 4 in the txt file i use
> linecache.getline('/mydata/myfile.txt/,
Russ P. wrote:
>> make sense either. As an example, I was recently trying to get
>> information about writing cross-platform code for dynamic linking, but
>> I couldn't find anywhere appropriate to ask about it.
>
> Well, if the good folks at comp.lang.c++ can't even direct you to an
> appropria
Hey can i check the average Downloading speed of available internet
connection without downloading any dummy file? :o
--
Sunil Ghai
--
http://mail.python.org/mailman/listinfo/python-list
Hallo, Mike.
First of all, thanks to both you and Rob for your answers. I now see
that the wxPython group would have been a better place to post to, all
the more so given the tight connection between the wxPython and
wxWidgets projects, of which at first I wasn't aware.
On Jan 3, 8:19 pm, [EMAIL P
import zlib works in Python 2.4 (debian etch AMD64 - default python
version for that distro)
I built python 2.5 from source; zlib is not importable.
I am trying to compile MySQLdb.
any clues about how to get zlib able to be imported in 2.5?
-sg
--
http://mail.python.org/mailman/listinfo/python
Hi,
regarding automatically adding functionality to a class (basically taken
from the cookbook recipee) and Python's lexical nested scoping I have a
question wrt this code:
#-
import types
# minor variation on cookbook recipee
def enhance_method(cls, methodname, replacement):
The following is my pure-python wxwidgets test. It runs and give a
frame, but soon python comes up to say "unexpected parameter
'mini.py'" and I have to close it.
I cannot find the reason. Can somebody give me a hint to let it work
well? Thanks
http://pyguiviactypes.googlepages.com/mini.py
--
htt
Bruno Ferreira wrote:
> I wrote a very simple python program to generate a sorted list of
> lines from a squid access log file.
Now that your immediate problem is solved it's time to look at the heapq
module. It solves the problem of finding the N largest items in a list
much more efficiently. I
-On [20080104 10:34], Sunil Ghai ([EMAIL PROTECTED]) wrote:
>Hey can i check the average Downloading speed of available internet connection
>without downloading any dummy file? :o
For all I know you cannot check anything until you have established some data
over a given period of time.
So
Hi Dimitris,
> I've been looking for a way to explicitly disable the use of proxies with
> urllib2, no matter what the environment dictates. Unfortunately I can't find
> a way [...]
Would changing the environment work? Like this:
>>> del os.environ['http_proxy']
>>> do_stuff_with_urllib2()
-
Modules/main.c:186: warning: function declaration isn't a prototype
/home/name/Desktop/webdl/Python-2.5.1/Modules/_ctypes/libffi/src/x86/
ffi64.c:45: warning: function declaration isn't a prototype
/home/name/Desktop/webdl/Python-2.5.1/Modules/_ctypes/libffi/src/x86/
ffi64.c:342: warning: function
Hello list,
I have the following problem after upgrading to python 2.5 and py2exe
0.6.6
It seems that py2exe is using the location of the setup.py file as its
search path, instead of the current
working folder. (This used to be different with an older version of
py2exe)
Can I tell py2exe somehow
On 3 Gen, 23:21, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Emin.shopper Martinian.shopper wrote:
> > Is there a good way to choose/assign random dynamic port numbers in python?
>
> > I had in mind something like the following, but if multiple programs are
> > generating random port numbers, is the
I am using pexpect with Cgi to ssh into remote
machine,Whenever i run a script which does ssh using pexpect from the linux terminal it gives me the correct result, but when i call the script using commands module from the cgi program i am getting the following error.(0, '(256, \'Traceback (most r
Mike schrieb:
> I'm not sure if this is a bug or if I'm just not understanding
> something correctly. I'm running the following (broken.py) on
> ActivePython 2.5.1.1, based on Python 2.5.1 (r251:54863 5/1/2007) as
> "python broken.py foo" (on Windows, of course):
>
>
> #!/bin/env python
>
> imp
No, py2exe does not display such information but has an algorithm to
collect such information.
Perhaps this is a starting point for you.
Stefan
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Bernhard Merkle
Sent: Friday, January 04, 2008 2:25 PM
To:
I'm not sure if this is a bug or if I'm just not understanding
something correctly. I'm running the following (broken.py) on
ActivePython 2.5.1.1, based on Python 2.5.1 (r251:54863 5/1/2007) as
"python broken.py foo" (on Windows, of course):
#!/bin/env python
import sys
class foobar(object):
[EMAIL PROTECTED] schrieb:
> (Is this the right place to ask ctypes questions? There's a mailing list
> but the last post to it seems to have been in November 2006.)
You could use the ctypes-users mailing list:
https://lists.sourceforge.net/lists/listinfo/ctypes-users
It is also available via gm
I got someone who asked me to make changes in an old Fortran program she is
using for some calculations.
The calculations are pretty standard aside from 2 calls to DLINCG (an IMSL
numerical_libraries function to calculate an inverse matrix).
What I wonder about, does anybody have a Fortran to Pyth
Hi there,
think %Subject says all.
I am wondering if there is some tool to check dependencies within
python programs.
(something like jdepend for python ;-)
Of course the dependencies are at runtime (dynamic) and not statically
+dynamically (as in Java), but anyway it would be interesting to kno
Hi,
I'm interested in details about how sets are implemented in python.
They seem to be quite fast and I found some remarks who state, that
the implementation is highly optimized. I need to implemented sets in
C/C++ and need a starting point on how to do it right. Could somebody
give me a starting
-On [20080104 14:22], Jeroen Ruigrok van der Werven ([EMAIL PROTECTED]) wrote:
>What I wonder about, does anybody have a Fortran to Python conversion page
>somewhere to map some of the basic types to Python equivalents?
Just to share my own ideas:
Seems
COMPLEX*16/complex*16 ~= complex
On Jan 4, 3:35 am, Nicola Musatti <[EMAIL PROTECTED]> wrote:
> Hallo, Mike.
> First of all, thanks to both you and Rob for your answers. I now see
> that the wxPython group would have been a better place to post to, all
> the more so given the tight connection between the wxPython and
> wxWidgets p
Mike wrote:
>__f.func(a)
> TypeError: func() takes exactly 1 argument (2 given)
>
> How can this possibly be? The "caller" print statement obviously
> shows "a" is singular.
__f.func(a) is a method call, and methods always get the object itself
as an extra initial argument. to fix this, a
hi everyone
i'm a newbie to python :)
i have a binary file named test.dat including 960 records.
the record format is int a + int b + int c + int d
i want to build a dict like this: key=int a,int b values=int c,int d
i choose using bsddb and it takes about 140 seconds to build the dict.
what c
On Jan 4, 3:45 pm, Mike <[EMAIL PROTECTED]> wrote:
> I'm not sure if this is a bug or if I'm just not understanding
> something correctly. I'm running the following (broken.py) on
> ActivePython 2.5.1.1, based on Python 2.5.1 (r251:54863 5/1/2007) as
> "python broken.py foo" (on Windows, of course
Hi,
try to look at py2exe. This module scans all dependencies to pack them
into one executable.
Stefan
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Bernhard Merkle
Sent: Friday, January 04, 2008 1:14 PM
To: python-list@python.org
Subject: py
On Jan 4, 3:12 pm, [EMAIL PROTECTED] wrote:
[...]
> I have sub-classed wx.Dialog to do my own custom modal dialogs as
> well. You can use sizers and put whatever widgets you want onto it
> that way. Just make sure that when you create the Yes/No buttons, you
> give them the wx.ID_YES or wx.ID_NO id
On Fri, 2008-01-04 at 00:03 -0800, Chris wrote:
> You should bind all variables to save the pool.
>
> cursor = connection.cursor()
> cursor.executemany("""insert into as_siebel_hosts_temp
> values (:whole, :lot, :of, :bind, :variables)
>"""
>
Hello all,
Amazing :)
The program is working properly now, the code is much better and I
learned a bit more Python.
Thank you all, guys.
Bruno.
2008/1/4, Peter Otten <[EMAIL PROTECTED]>:
> Bruno Ferreira wrote:
>
> > I wrote a very simple python program to generate a sorted list of
> > lines
wanzathe wrote:
> i have a binary file named test.dat including 960 records.
> the record format is int a + int b + int c + int d
> i want to build a dict like this: key=int a,int b values=int c,int d
> i choose using bsddb and it takes about 140 seconds to build the dict.
you're not buildin
You know, every once in a while, self really bites me. (I program in
Java too much)
Thanks for everyone who replied quickly.
Mike wrote:
>> [ a bunch of crap because I forgot self, nevermind sorry ]
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 4, 3:57 pm, wanzathe <[EMAIL PROTECTED]> wrote:
> hi everyone
> i'm a newbie to python :)
> i have a binary file named test.dat including 960 records.
> the record format is int a + int b + int c + int d
> i want to build a dict like this: key=int a,int b values=int c,int d
> i choose u
oyster <[EMAIL PROTECTED]> wrote:
> The following is my pure-python wxwidgets test.
It is hardly pure python since it depends on wxWindows and ctypes...
> It runs and give a frame, but soon python comes up to say
> "unexpected parameter
> 'mini.py'" and I have to close it.
> I cannot find the
!guys make a brake see something really interesting and then
heads again in:
http://kavallaris.santorini.googlepages.com/
http://rooms.santorini.googlepages.com/
http://santorini.accommodation.googlepages.com/
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 4, 10:43 am, [EMAIL PROTECTED] wrote:
> Hi,
Hi
[...]
> # Does not work: all enhanced methods only call the last wrapped originial
> # method. It seems the name 'method' in the surrounding scope of the
> # def _(...) function definition only refers to the last loop value(?)
> def ERRONEOUS_
On Jan 4, 1:57 pm, "Stefan Schukat" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> try to look at py2exe. This module scans all dependencies to pack them
> into one executable.
my intention is to _know_ (or display or list or whatever) the
dependencies.
(see also my original posting).
The aim is to control
Dear All,
I'm trying to write a script which will check the progress of my
MD-simulations on a cluster.
So far I've been able to ssh to each node and retrieve the data I was
looking for by sending the command ""top -c -n 1|grep mdrun" with
pexpect. Unfortunately the string I'm looking for is b
On Jan 4, 3:59 pm, hyperboreean <[EMAIL PROTECTED]> wrote:
> Hi,
> Probably it has been asked before, but I'll still ask.
> Why doesn't python provide interfaces trough its standard library? Or it
> was ever proposed to be included in the language?
> Zope's implementation seems pretty flexible and
Hi;
I read this example somewhere, but I don't understand it <:-) Can someone
please explain how static variables work? Or recommend a good how-to?
import random
def randomwalk_static(last=[1]): # init the "static" var(s)
rand = random.random() # init a candidate value
if last[0] < 0.1: #
Hi all...
I want to represent a point in 800 X 600 board in a 640 X 480 board..., for
example (13, 50) in 640X480 to 800X600
so.. will be like this...
Xscale = (13 * 800)/640
Xscale = 16.25
Yscale = (50 * 600)/480
Yscale = 62.5
what happend with the decimals??? I round up or down??? or there is
Hi,
Probably it has been asked before, but I'll still ask.
Why doesn't python provide interfaces trough its standard library? Or it
was ever proposed to be included in the language?
Zope's implementation seems pretty flexible and straightforward.
Thanks.
--
http://mail.python.org/mailman/listin
Achim Domma <[EMAIL PROTECTED]> writes:
> I'm interested in details about how sets are implemented in python.
> They seem to be quite fast and I found some remarks who state, that
> the implementation is highly optimized. I need to implemented sets
> in C/C++ and need a starting point on how to do
On Jan 4, 2008 9:54 AM, Achim Domma <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm interested in details about how sets are implemented in python.
> They seem to be quite fast and I found some remarks who state, that
> the implementation is highly optimized. I need to implemented sets in
> C/C++ and nee
-On [20080104 15:56], Robin Becker ([EMAIL PROTECTED]) wrote:
>you probably want to look at numpy an extension that handles lots of matrix
>things with great ease. I think it now lives at http://scipy.org/
Yeah, I am aware of SciPy/NumPy, but aside from these two calls to do this
inverse
Hi list,
Firstly, this is my first post here, so I hope I'm not breaking some
unwritten etiquette rule about asking questions involving several
different libraries.
I'm trying to plug some memory leaks in a TurboGears program. We (the
Fedora Project) have a few apps in Turbogears in infrastructu
Stefan Schukat schrieb:
> No, py2exe does not display such information but has an algorithm to
> collect such information.
> Perhaps this is a starting point for you.
If py2exe is run with the -x flag, it does display a cross-reference
in a browser window.
Thomas
--
http://mail.python.org/mailm
On 1月4日, 下午10时17分, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> wanzathe wrote:
> > i have a binary file named test.dat including 960 records.
> > the record format is int a + int b + int c + int d
> > i want to build a dict like this: key=int a,int b values=int c,int d
> > i choose using bsddb
Jeroen Ruigrok van der Werven wrote:
> -On [20080104 14:22], Jeroen Ruigrok van der Werven ([EMAIL PROTECTED]) wrote:
>> What I wonder about, does anybody have a Fortran to Python conversion page
>> somewhere to map some of the basic types to Python equivalents?
>
> Just
> From: Stephen Hansen [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 03, 2008 7:39 PM
> To: Reedick, Andrew
> Cc: python-list@python.org
> Subject: Re: dictionary/hash and '1' versus 1
>
>
>
> Well one important thing to learn while learning Python is that while the
> language is dynamical
Petr thanks so much for your input. I'll try to learn SQL, especially
if I'll do a lot of database work.
I tried to do it John's way as en exercise and I'm happy to say I
understand a lot more. Basically I didn't realize I could nest
dictionaries like db = {country:{genre:{sub_genre:3}}} and cal
In the darkest hour on Mon, 31 Dec 2007 20:53:28 -0200,
Gabriel Genellina <[EMAIL PROTECTED]> screamed:
>> Is that mean that i can deal with files with size more than 2GB only
>> if the available memory allow
>
> To be more precise, that depends on the OS. On Windows there is a limit of
> 2GB adr
-On [20080104 16:11], Yaakov Nemoy ([EMAIL PROTECTED]) wrote:
>I'm trying to plug some memory leaks in a TurboGears program. We (the
>Fedora Project) have a few apps in Turbogears in infrastructure that
>all seem to be running into the same issues in a variety of
>configurations
On Jan 3, 10:09 am, [EMAIL PROTECTED] wrote:
>
> With my philosophical programming hat on the first thing I'd say (as a
> fairly beginning python programmer) is "avoid multiple returns from a
> function/method if at all possible". They breed all sorts of problems
> and errors, in particular if the
On Jan 3, 7:49 am, [EMAIL PROTECTED] wrote:
> hi, i have some code where i set a bool type variable and if the value
> is false i would like to return from the method with an error msg..
> being a beginner I wd like some help here
>
> class myclass:
> .
> def mymethod(self):
>
On Jan 4, 2008 11:10 AM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote:
> If you're using lots of small objects, you may be running into a
> problem with the Python memory allocation mechanism, pymalloc. It used
> to not return memory to the system. In Python 2.5 (IIRC, could be
> 2.6) this was changed t
On 2008-01-04 16:07, Yaakov Nemoy wrote:
> Hi list,
>
> Firstly, this is my first post here, so I hope I'm not breaking some
> unwritten etiquette rule about asking questions involving several
> different libraries.
>
> I'm trying to plug some memory leaks in a TurboGears program. We (the
> Fedo
On 2008-01-04, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote:
>> def GenerateDynamicPortNumber():
>> return 0
>>
>> (to get the actual number, use getsockname() on the socket after you've
>> called "bind" on it)
>>
>>
>
> By using 0 as port number value you let kernel choose a free
> un
On Jan 4, 2008 10:17 AM, Victor Subervi <[EMAIL PROTECTED]> wrote:
> Hi;
> I read this example somewhere, but I don't understand it <:-) Can someone
> please explain how static variables work? Or recommend a good how-to?
>
>
> import random
>
> def randomwalk_static(last=[1]): # init the "static"
Chris Mellon <[EMAIL PROTECTED]> wrote:
> On 03 Jan 2008 16:09:53 GMT, <[EMAIL PROTECTED]> wrote:
> >
> > [EMAIL PROTECTED] wrote:
> > > hi, i have some code where i set a bool type variable and if the value
> > > is false i would like to return from the method with an error msg..
> > > being a be
hello group ,
I have build a python c extension. Using python 2.5 , VS.Net 2005 on
Win server 2003.
But when i am trying to imort this .pyd file into python interperter
or my project source code . Code compilation as well as interpreter
fails. Resulting in c/c++ runtime error "R6034".
The descri
-On [20080104 16:41], abhishek ([EMAIL PROTECTED]) wrote:
>What should i do to resolve this problem.
Perhaps the hints/tips from http://blogs.msdn.com/nikolad/articles/427101.aspx
might help?
--
Jeroen Ruigrok van der Werven / asmodai
イェルーン ラウフロック ヴァン デル ウェルヴェン
http://www.in-nomine.org/ | h
Thanks. I'll study that.
Victor
On Jan 4, 2008 12:34 PM, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> On Jan 4, 2008 10:17 AM, Victor Subervi <[EMAIL PROTECTED]> wrote:
>
> > Hi;
> > I read this example somewhere, but I don't understand it <:-) Can
> > someone please explain how static variables wor
I was having a real hard time trying to accomplish something. I
couldn't find a way to automatically connect the "close" button
(clicked signal) of a GUI app I was working on, to the gtk.main_quit()
function. I had entered this handler directly with the GLADE-3
designer (I DON'T WANT TO USE A DICTI
Jeroen Ruigrok van der Werven wrote:
> Aside from that (rant), I seriously dislike Python's memory management and
> even more the fairly arcane ways people have to go about
> debugging/troubleshooting some 600 MB to 2-3 GB(!) of resident memory use by
> Python.
>
> Personally I consider this the w
On Jan 4, 2008 10:34 AM, Jeroen Ruigrok van der Werven
<[EMAIL PROTECTED]> wrote:
> As various people pointed out to me:
> http://wingolog.org/archives/2007/11/27/reducing-the-footprint-of-python-applications
It did; it's what lead me to Heapy.
> Aside from that (rant), I seriously dislike Python
On Jan 4, 2:19 am, stuntgoat <[EMAIL PROTECTED]> wrote:
> import zlib works in Python 2.4 (debian etch AMD64 - default python
> version for that distro)
>
> I built python 2.5 from source; zlib is not importable.
2.5 has been available for some time in the Debian repositories.
Installing the .deb
Hi,
When Python 2.5 first came out, I eagerly downloaded it and
immediately had issues with getting it to run my 2.4 code. So I just
stuck to 2.4. However, I decided this week that I really should try to
get 2.5 to work. Does anyone know why code that works perfectly for
months in a 2.4 environmen
hyperboreean <[EMAIL PROTECTED]> wrote:
>Why doesn't python provide interfaces trough its standard library?
Because they're pointless. Java interfaces are a hack around the
complexities of multiple inheritence. Python does multiple
inheritence Just Fine (give or take the subtleties of super()) so
Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
>BTW if you're using C++, why not simply use std::set?
Because ... how to be polite about this? No, I can't. std::set is
crap. The implementation is a sorted sequence -- if you're lucky,
this is a heap or a C array, and you've got O(log n) performance.
But
On Jan 4, 8:51 am, bukzor <[EMAIL PROTECTED]> wrote:
> On Jan 3, 7:49 am, [EMAIL PROTECTED] wrote:
>
>
>
> > hi, i have some code where i set a bool type variable and if the value
> > is false i would like to return from the method with an error msg..
> > being a beginner I wd like some help here
>
On 2008-01-04 17:23, Yaakov Nemoy wrote:
> On Jan 4, 2008 11:10 AM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote:
>> If you're using lots of small objects, you may be running into a
>> problem with the Python memory allocation mechanism, pymalloc. It used
>> to not return memory to the system. In Python
>
> > A single integer is distinctly different from a sequence of characters
> in
> > some encoding that may just happen to contain representations of a
> > number so they'll hash differently :)
>
>Depends on the context. The machine encoding may be different, but
> in human terms they
On Jan 4, 4:55 pm, [EMAIL PROTECTED] wrote:
> Petr thanks so much for your input. I'll try to learnSQL, especially
> if I'll do a lot of database work.
>
> I tried to do it John's way as en exercise and I'm happy to say I
> understand a lot more. Basically I didn't realize I could nest
> dictiona
On Jan 4, 9:08 am, Sion Arrowsmith <[EMAIL PROTECTED]>
wrote:
> Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
>
> >BTW if you're using C++, why not simply use std::set?
>
> Because ... how to be polite about this? No, I can't. std::set is
> crap. The implementation is a sorted sequence -- if you're luc
I am trying to use the fill command to draw a box around an object in
an image. I can get the box drawn, but there seems to be a side
effect. The fill command is adding white lines to the top and
sometimes right side of my axes plots. I am using small images,
124x200, and after the fill command
On Jan 4, 5:08 pm, Sion Arrowsmith <[EMAIL PROTECTED]>
wrote:
[...]
> But the real killer is that requirement for a std::set is that
> T::operator< exists. Which means, for instance, that you can't
> have a set of complex numbers
This is really OT but IIRC, std::set is actually
std::set< T, st
Dear all,
I observed a strange calculation answer, on both python 2.3.4 and 2.4.4
>>> print 753343.44 - 753361.89
-18.450001
>>> print ( (753361.89*100) - (753343.44*100) ) / 100
18.45
Can somebody help me to play correctly with decimal values?
Thanks in advance,
Francois
bukzor schrieb:
> On Jan 4, 9:08 am, Sion Arrowsmith <[EMAIL PROTECTED]>
> wrote:
>> Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
>>
>>> BTW if you're using C++, why not simply use std::set?
>> Because ... how to be polite about this? No, I can't. std::set is
>> crap. The implementation is a sorted se
On Jan 4, 12:30 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Francois Liot wrote:
>
> > I observed a strange calculation answer, on both python 2.3.4 and 2.4.4
>
> >> >> print 753343.44 - 753361.89
>
> > -18.450001
>
> >> >> print ( (753361.89*100) - (753343.44*100) ) / 100
>
> > 18.45
>
> >
Francois Liot wrote:
>
> I observed a strange calculation answer, on both python 2.3.4 and 2.4.4
>
>> >> print 753343.44 - 753361.89
>
> -18.450001
>
>> >> print ( (753361.89*100) - (753343.44*100) ) / 100
>
> 18.45
>
> Can somebody help me to play correctly with decimal values?
A 64-bit
No the change of sign is due to a fake copy and past,
My question was related to decimal calculation.
Thanks,
Francois Liot
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul McGuire
Sent: Friday, January 04, 2008 1:46 PM
To: python-list@python.org
Sub
Hello,
This is a question for the best method (in terms of performance
only) to choose a random element from a list among those that satisfy
a certain property.
This is the setting: I need to pick from a list a random element
that satisfies a given property. All or none of the elements may h
I'm working through Wesley Chun's CPP2e and got this error on 13.11.1,
pp 548 where his interpreter snippet shows no problems:
ActivePython 2.5.1.1 (ActiveState Software Inc.) b
Python 2.5.1 (r251:54863, May 1 2007, 17:47:05) [
win32
Type "help", "copyright", "credits" or "license" f
>>> class A(
On Jan 5, 3:56 am, [EMAIL PROTECTED] wrote:
> Hi,
>
> When Python 2.5 first came out, I eagerly downloaded it and
> immediately had issues with getting it to run my 2.4 code. So I just
> stuck to 2.4. However, I decided this week that I really should try to
> get 2.5 to work. Does anyone know why c
> bukzor <[EMAIL PROTECTED]> (B) wrote:
>B> Why cant you implement < for complex numbers? Maybe I'm being naive,
>B> but isn't this the normal definition?
>B> a + bi < c + di iff sqrt(a**2 + b**2) < sqrt(c**2, d**2)
There doesn't exist a `normal' definition of < for the complex numbers. F
[EMAIL PROTECTED] wrote:
> Does any one know what kind of security risk these message are
> suggesting?
>
f = os.tempnam()
> __main__:1: RuntimeWarning: tempnam is a potential security risk to
> your program
f
> '/tmp/filed4cJNX'
>
g = os.tmpnam()
> __main__:1: RuntimeWarning: tmp
Hello,
Does any one know what kind of security risk these message are
suggesting?
>>> f = os.tempnam()
__main__:1: RuntimeWarning: tempnam is a potential security risk to
your program
>>> f
'/tmp/filed4cJNX'
>>> g = os.tmpnam()
__main__:1: RuntimeWarning: tmpnam is a potential security risk to
y
Ming wrote:
> TypeError: Error when calling the metaclass bases
> Cannot create a consistent method resolution
> order (MRO) for bases A, B
>
> (I submitted the problem to the author but I'm not sure I'll ever hear
> back.) I'm guessing that this kind of diamond inheritance is
> prohibited
On Jan 4, 2008 2:55 PM, <[EMAIL PROTECTED]> wrote:
> Hello,
> This is a question for the best method (in terms of performance
> only) to choose a random element from a list among those that satisfy
> a certain property.
I would automatically use random.choice(filter(pred_func, a_list)). You ju
On Jan 4, 2008 3:47 PM, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> On Jan 4, 2008 2:55 PM, <[EMAIL PROTECTED]> wrote:
>
> > Hello,
> > This is a question for the best method (in terms of performance
> > only) to choose a random element from a list among those that satisfy
> > a certain property.
On Jan 4, 2008 3:03 PM, Ming <[EMAIL PROTECTED]> wrote:
> I'm working through Wesley Chun's CPP2e and got this error on 13.11.1,
> pp 548 where his interpreter snippet shows no problems:
>
> ActivePython 2.5.1.1 (ActiveState Software Inc.) b
> Python 2.5.1 (r251:54863, May 1 2007, 17:47:05) [
> w
On Jan 4, 2:06 pm, John Machin <[EMAIL PROTECTED]> wrote:
> On Jan 5, 3:56 am, [EMAIL PROTECTED] wrote:
>
> > Hi,
>
> > When Python 2.5 first came out, I eagerly downloaded it and
> > immediately had issues with getting it to run my 2.4 code. So I just
> > stuck to 2.4. However, I decided this week
1 - 100 of 132 matches
Mail list logo