Hi,
I want to implement chain of responsibility pattern in Python (for
a Django project)
The problem that I see is a rather odd one - how to link the
subclasses with the super class.
Ex: Suppose the two child classes are as given below (A1, A2 child
classes of A)
class A:
...
class A1(
Duncan Booth wrote:
farsi...@gmail.com wrote:
Thanks all, that's very helpful, sorry to waste your time with a
common question. I have tried the decimal module and will definitely
keep using it if I need to do this kind of calculation again.
Try to remember though that the decimal module simp
Martin v. Löwis wrote:
Just create an empty one.
Won't quite work: merge tries to find full_current_version
which is determined (if None) in msi.py from the rather
involved current version stuff.
Only if you don't pass an msi file on the command line. So
I recommend that you do that.
OK.
On Sun, Mar 8, 2009 at 10:23 PM, John Machin wrote:
> On Mar 9, 3:15 pm, Jack Steven wrote:
>> Isn't string.Template suppose to be faster than calling replace multiple
>> times? That's what I thought until I benchmarked this code, where
>> string.Template ended up being 4 times slower.
>>
>> This
On Mar 9, 3:15 pm, Jack Steven wrote:
> Isn't string.Template suppose to be faster than calling replace multiple
> times? That's what I thought until I benchmarked this code, where
> string.Template ended up being 4 times slower.
>
> This doesn't make sense to me, since unlike when you are calling
r wrote:
On Mar 8, 9:34 pm, "W. eWatson" wrote:
Radiboutton(master, textvariable = ...
Radiobutton(msster, textvariable = ...
Checkbox(master, text=...
entry = Entry(master, width=10, ...
entry.insert(0,self.slowdown)# testing a default methodology
Label( master, text="Max...
Entry(master,
try any one 1)
>>>from __future__ import division
>>>2/3 -1/3
0.1
2)
>>>x = 2/3.0
>>>x - 1/3.0
0.1
On Mon, Mar 9, 2009 at 9:33 AM, Daniel Dalton wrote:
> Hi,
>
> On Mon, Mar 09, 2009 at 12:08:16AM +0100, Lo wrote:
> > I just tried python first time.
> >
> > 2/3
I'd rather not have to download and install them as I don't want to be
installing them into my actual system, so can someone please tell me
whether the MacOS X dmg installers provided from www.python.org are
still not full universal builds. That is, that the Python framework
component only contains
On Mar 8, 12:31 pm, Dennis Lee Bieber wrote:
> On Sat, 7 Mar 2009 23:07:55 -0800 (PST), odeits
> declaimed the following in gmane.comp.python.general:
>
>
>
>
>
> > For those of you who asked about the SQL the full function is here.
> > The connection is to a sqlite database with the row_factory
Isn't string.Template suppose to be faster than calling replace multiple
times? That's what I thought until I benchmarked this code, where
string.Template ended up being 4 times slower.
This doesn't make sense to me, since unlike when you are calling replace
multiple times, code behind Template ca
Steve Sobol wrote:
>
> On 2009-03-09, Kenneth Tilton wrote:
>
>> Buddha taught that the universe is ineluctably a single
>> interconnected web of cause and effect, which is my haughty preamble
>> to this observation: it depends on the newsgroup.
>>
>> comp.lang.lisp is cool so here Xah particip
Hi,
On Mon, Mar 09, 2009 at 12:08:16AM +0100, Lo wrote:
> I just tried python first time.
>
> 2/3
>
> the result is zero
That's because your dividing an int by an int to an int. The definition
of an int is a "whole number". So just use floating point I think it's
called, this should work, and d
> or like this:
>
> print '\r'+str(percent),
>
> Then make sure it gets sent out, like this:
>
> sys.stdout.flush()
Hey!
Thanks very much, that did the trick!
Thanks to everyone that replied, I discovered converting to str was
crutial to actually print anything. :)
Cheers,
Daniel.
--
http:/
Steven D'Aprano wrote:
> Steve Holden wrote:
>
>> If x and b are meant to be global than bite the bullet and *make* them
>> global.
>
> Well, there's global, and there's global.
>
> There's global to a few functions in a module, there's global to everything
> in a module, and global to an entire
Aahz wrote:
> In article ,
> Tim Chase wrote:
>>> Assuming this is a real task and not a homework problem, then
>>> I'd do it this way:
>>>
>>> $ cd [directory containing 50 test files]
>>> $ (for file in *; do head -n11 $file | tail -n5; done)
>>> >/path/to/results-file.txt
>> I'd use sed:
On Mar 8, 12:35 pm, iu2 wrote:
> On Mar 8, 1:42 pm, Carl Banks wrote:
>
>
>
> > On Mar 8, 1:52 am, iu2 wrote:
>
> > > On Mar 6, 6:52 pm, Mike Driscoll wrote:
>
> > > > ...
> > > > Can you post a sample application so we can try to figure out what's
> > > > wrong? You might also cross-post this
On Mar 7, 8:47 pm, Raymond Hettinger wrote:
> The existing groupby() itertool works great when every element in a
> group has the same key, but it is not so handy when groups are
> determined by boundary conditions.
>
> For edge-triggered events, we need to convert a boundary-event
> predicate to
On Mar 8, 9:34 pm, "W. eWatson" wrote:
> Radiboutton(master, textvariable = ...
> Radiobutton(msster, textvariable = ...
> Checkbox(master, text=...
> entry = Entry(master, width=10, ...
> entry.insert(0,self.slowdown) # testing a default methodology
> Label( master, text="Max...
> Entry(maste
For a couple of months, I've been successfully using the Python
set_process_affinity_mask wrapper from
http://pypi.python.org/pypi/affinity/0.1.0
Now I've upgraded from Ubuntu 8.04 to Ubuntu 8.10 (from gcc 4.2.3 to gcc 4.3.2)
and set_process_affinity_mask seems to fail on the x86 Ubuntu inst
I'm looking at some Tk code written by someone else, and am curious about a
methodology in the code. A setup object called SetDlg contains to code to
set up parameters for some widgets for a dialog of radio buttons,
checkboxes, and text/string entries. It then calls ShowDlg. After it returns
in
iu2 writes:
> Indeed, but I don't think the CallAfter is necessary. I could just as
> well remove the time.sleep in the original code. I could also make a
> tight loop to replace time.sleep
> for i in range(100): pass
> and tune it to fit the speed I need.
Except that CallAfter passed contro
On Mar 8, 11:31 am, Dennis Lee Bieber wrote:
> On Sat, 7 Mar 2009 23:07:55 -0800 (PST), odeits
> declaimed the following in gmane.comp.python.general:
>
>
>
>
>
> > For those of you who asked about the SQL the full function is here.
> > The connection is to a sqlite database with the row_factory
JanC wrote:
Krishnakant wrote:
This is my last attempt to search for a nice python library for creating
open document spreadsheet.
I tryed python-ooolib but did not find a few features like merging cells
(may be I am missing out some thing stupid ).
You could add that feature to python-oooli
On Mar 9, 12:09 pm, Larry wrote:
> Friends,
>
> I need to read a binary file using a Fortran 77 code to integrate with
> a legacy code It looked very much complicated to me for I have no
> knowledge in Fortran.
>
> I could read the file with ease using Python, as shown in the
> following.
>
>
I will do that. I want to tinker with it just a little bit more to make
sure I am not missing anything first.
Thanks again.
Steve
On 3/8/09, Fabio Zadrozny wrote:
>
> > Thanks. I noticed that when I was on my windows box at work and I
> > would check it and click apply then ok and when I go bac
On Mar 9, 9:02 am, BigHand wrote:
> On Mar 8, 9:49 pm, "Gabriel Genellina" wrote:
>
>
>
> > En Sat, 07 Mar 2009 21:18:22 -0200, BigHand escribió:
>
> > > On 3月7日, 下午11时21分, "Gabriel Genellina"
> > > wrote:
> > >> En Sat, 07 Mar 2009 11:46:08 -0200, BigHand
> > >> escribió:
>
> > >> > I wan
On Mar 7, 9:22 pm, "Gabriel Genellina" wrote:
> En Sat, 07 Mar 2009 01:43:05 -0200, BigHand escribió:
>
>
>
> > On Mar 7, 11:40 am, BigHand wrote:
> >> Guys:
> >> I have a embedded python in MFC app. to execute a py script of a.py,
> >> the is only one line in a.py, it "a()" , normally ,excute t
Friends,
I need to read a binary file using a Fortran 77 code to integrate with
a legacy code It looked very much complicated to me for I have no
knowledge in Fortran.
I could read the file with ease using Python, as shown in the
following.
###
from numpy import*
On Mar 8, 9:49 pm, "Gabriel Genellina" wrote:
> En Sat, 07 Mar 2009 21:18:22 -0200, BigHand escribió:
>
> > On 3月7日, 下午11时21分, "Gabriel Genellina"
> > wrote:
> >> En Sat, 07 Mar 2009 11:46:08 -0200, BigHand
> >> escribió:
>
> >> > I want the exception printted like this:
> >> > File "", l
On Sat, 7 Mar 2009 14:52:02 -0800 (PST), Xah Lee
wrote, quoted or indirectly quoted someone who said :
>
>I consider this post relevant because i've been perennially gossiped
>about in comp.lang.* groups today and in the past 5 or 10 years, many
>of the threads mentioning my name are not started
On 2009-03-08, Rhodri James wrote:
b = (n is not None) and (n != [])
>>>
>>> The second comparison isn't actually necessary, since an
>>> empty list is True and a non-empty one False.
>>>
>>>b = (n is not None) and n
>>>
>>> Putting the comparison in does make the code slightly les
On Mar 9, 12:44 am, Scott David Daniels wrote:
> iu2 wrote:
> > Here is the timer version. It works even more slowly, even with
> > PyScripter active: ...
>
> > I actually tried this one first. Due to the slow speed I changed to
> > looping inside the event.
> > I don't understand why it takes so
On Sat, 07 Mar 2009 05:03:08 -, Grant Edwards wrote:
On 2009-03-07, Rhodri James wrote:
On Fri, 06 Mar 2009 15:34:08 -, Grant Edwards
wrote:
On 2009-03-06, Fencer wrote:
Hi, I need a boolean b to be true if the variable n is not
None and not an empty list, otherwise b should b
RT wrote:
I have been doing Python development at work for several years. I
started with the official documentation and tutorial, by
necessity, the examples tend to be rather simple and none of them
really explain the process of developing complete, industrial
strength Python applications.
Lo wrote:
I just tried python first time.
2/3
the result is zero
I want the result to be .333...
How do I get this?
That's integer division (integer divided by integer is integer).
If you want the result to be floating point then make one of them
floating point:
2.0 / 3
or do this
Lo pisze:
I just tried python first time.
2/3
the result is zero
Float type must be specified explicitly:
2/3.0 or 2.0/3
In Python 3.x operators behave differently and '2/3' would give float
number as a result.
I want the result to be .333...
Than try: 1/3.0 because 2/3.0 will never
On Sun, Mar 8, 2009 at 3:08 PM, Lo wrote:
> I just tried python first time.
>
> 2/3
>
> the result is zero
>
> I want the result to be .333...
>
> How do I get this?
Add the following to the top of your program:
from __future__ import division
That tells Python to use the proper kind of divisio
On 2009-03-08, Lo wrote:
> I just tried python first time.
>
> 2/3
>
> the result is zero
>
> I want the result to be .333...
How odd.
> How do I get this?
1./3
--
Grant
--
http://mail.python.org/mailman/listinfo/python-list
Lo schrieb:
I just tried python first time.
2/3
the result is zero
I want the result to be .333...
Well, that's not going to happen - 2/3 is .666 if not done with integers...
How do I get this?
Use floating points.
>>> 2.0 / 3.0
0.3
Diez
--
http://mail.python.org/mailma
I just tried python first time.
2/3
the result is zero
I want the result to be .333...
How do I get this?
Thanks a lot
L
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 9, 3:37 am, Chris Rebert wrote:
> Learn about the methods of the string class
> (str):http://docs.python.org/library/stdtypes.html#id4
>
> You'll probably be most interested in .split()
OK, thanks I got it. I was trying to use Regex but .split() just
worked like a charm. Thank you ;)
>
>
andrew cooke wrote:
> above is with 3.0. for some odd reason i thing the order of teh args to
> MethodType may have changed recently, so be careful.
sorry, no, had 2.6 running there... andrew
--
http://mail.python.org/mailman/listinfo/python-list
Aaron Brady wrote:
> Hello,
>
> I am creating a container. I have some types which are built to be
> members of the container. The members need to know which container
> they are in, as they call methods on it, such as finding other
> members. I want help with the syntax to create the members.
>
iu2 wrote:
Here is the timer version. It works even more slowly, even with
PyScripter active: ...
I actually tried this one first. Due to the slow speed I changed to
looping inside the event.
I don't understand why it takes so long to move that square with
wx.Timer set to 1 ms interval. Perhaps
On Sun, Mar 8, 2009 at 5:18 PM, Oltmans wrote:
> I'm at a loss to figure out how to extract some text from a string.
> Here is a string:
>
> setTimeout("location.href='http://youtube.example.com/login.aspx'",
> 5000);
>
> and I want to only retrieve the URL from above i.e I only want this
> http:/
>> Just create an empty one.
>
> Won't quite work: merge tries to find full_current_version
> which is determined (if None) in msi.py from the rather
> involved current version stuff.
Only if you don't pass an msi file on the command line. So
I recommend that you do that.
> I'm going to give up
On Sun, Mar 8, 2009 at 2:18 PM, Oltmans wrote:
> I'm at a loss to figure out how to extract some text from a string.
> Here is a string:
>
> setTimeout("location.href='http://youtube.example.com/login.aspx'",
> 5000);
>
> and I want to only retrieve the URL from above i.e I only want this
> http:/
I'm at a loss to figure out how to extract some text from a string.
Here is a string:
setTimeout("location.href='http://youtube.example.com/login.aspx'",
5000);
and I want to only retrieve the URL from above i.e I only want this
http://youtube.example.com/login.aspx from the above string. Any ide
Martin v. Löwis wrote:
merge.py attempts to import config.py but I can't find it...
Just create an empty one.
Won't quite work: merge tries to find full_current_version
which is determined (if None) in msi.py from the rather
involved current version stuff.
I'm going to give up on this for to
Hello,
I am creating a container. I have some types which are built to be
members of the container. The members need to know which container
they are in, as they call methods on it, such as finding other
members. I want help with the syntax to create the members.
Currently, the container has to
Krishnakant wrote:
> This is my last attempt to search for a nice python library for creating
> open document spreadsheet.
>
> I tryed python-ooolib but did not find a few features like merging cells
> (may be I am missing out some thing stupid ).
You could add that feature to python-ooolib.
> I
On Mar 8, 12:42 am, Stefan Behnel wrote:
> rpar...@gmail.com wrote:
> > I am trying to process an xml file that contains unicode characters
> > (seehttp://vyakarnam.wordpress.com/). Wordpress allows exporting the
> > entire content of the website into an xml file. Using
> > xml.dom.minidom, I wro
> First, it relies on config.py whose existence msi.py
> optionally ignores.
Feel free to create a patch for that.
> File "", line 2, in OpenDatabase
> pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, None,
> None, None, 0, -2147024786), None)
This is 0x8007006e; 0x6E, in turn, mi
> merge.py attempts to import config.py but I can't find it...
Just create an empty one.
Martin
--
http://mail.python.org/mailman/listinfo/python-list
seconded.
--
http://mail.python.org/mailman/listinfo/python-list
hello all, Sorry for the frustrated mail.
This is my last attempt to search for a nice python library for creating
open document spreadsheet.
I tryed python-ooolib but did not find a few features like merging cells
(may be I am missing out some thing stupid ).
I have asked for some help before
Python Nutter wrote:
Looks like we finally get tkinter GUI based programs according to
Issue# 2983 in Python 3.1a so our programs don't look like something
out of early 1980's
Please don't confuse History gratuitously. Make that mid 90's.
Cheers, BB
--
http://mail.python.org/mailman/listinfo/
En Sun, 08 Mar 2009 18:08:50 -0200, Martin v. Löwis
escribió:
What does the merge do? I can't find mention of it
in the docs.
It merges the msvcrt merge module into the installer (and then
monkey patches it, to revert the msm decision of setting
ALLUSERS). I tried to integrate it originally
Martin v. Löwis wrote:
What does the merge do? I can't find mention of it
in the docs.
It merges the msvcrt merge module into the installer (and then
monkey patches it, to revert the msm decision of setting
ALLUSERS). I tried to integrate it originally as a step
after creating the msi. Unfortun
On Mar 8, 1:24Â pm, Steven D'Aprano wrote:
> r wrote:
> > This is to all usenet readers who think they own c.l.py!
>
> [snip abusive, anti-social rant]
>
> Well, after kill-filing this kiddie for a few months, I thought I'd give him
> a chance. By pure luck I chose this post to read.
>
> Good news
> What does the merge do? I can't find mention of it
> in the docs.
It merges the msvcrt merge module into the installer (and then
monkey patches it, to revert the msm decision of setting
ALLUSERS). I tried to integrate it originally as a step
after creating the msi. Unfortunately, the merge objec
> Thanks. I noticed that when I was on my windows box at work and I
> would check it and click apply then ok and when I go back to those
> prefs and it isn't checked. I did that a few times. I will try it on
> my Linux box tomorrow at home and see if I have the same results.
If it doesn't work fo
Scott David Daniels wrote:
Tim Golden wrote:
... Anyhow, at the end I have a working Python 2.7a0 running
under Windows.
Do you mean 3.1a0? As far as I know, 2.7a0 requires the use
of the time machine, as it is expected to be 3 months out.
No; 2.7a0 is the version number of the svn HEAD.
Martin v. Löwis wrote:
In addition, the CVS version of pywin32 which I built in
order to run the msi.py script has a small bug in genpy
which prevents it from generating COM support in the way
in which msi.py does it.
I'm using Python 2.4 to run msi.py; that has always worked
fine for me.
Int
> Do you mean 3.1a0? As far as I know, 2.7a0 requires the use
> of the time machine, as it is expected to be 3 months out.
The current trunk calls itself 2.7a0. I think you might be referring
to 3.0a1.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
> In addition, the CVS version of pywin32 which I built in
> order to run the msi.py script has a small bug in genpy
> which prevents it from generating COM support in the way
> in which msi.py does it.
I'm using Python 2.4 to run msi.py; that has always worked
fine for me.
Regards,
Martin
P.S.
Tim Golden wrote:
... Anyhow, at the end I have a working Python 2.7a0 running
under Windows.
Do you mean 3.1a0? As far as I know, 2.7a0 requires the use
of the time machine, as it is expected to be 3 months out.
If you do get an installer built, even having a semi-official copy
around for th
Ville M. Vainio wrote:
> Alan G Isaac wrote:
>
>> 3. Chandler is not really an email client. So specifically,
>> which of its functionalities is it slow, and what evidence
>> if any is there that Python is causing this?
>
> I remember reading "somewhere" that the cause of slowness is/was
> arch
On Mar 8, 1:42 pm, Carl Banks wrote:
> On Mar 8, 1:52 am, iu2 wrote:
>
>
>
> > On Mar 6, 6:52 pm, Mike Driscoll wrote:
>
> > > ...
> > > Can you post a sample application so we can try to figure out what's
> > > wrong? You might also cross-post this to thewxPythonmailing list.
> > > They might k
On Sat, 2009-03-07 at 22:05 +, Ville M. Vainio wrote:
> Alan G Isaac wrote:
>
> > 3. Chandler is not really an email client. So specifically,
> > which of its functionalities is it slow, and what evidence
> > if any is there that Python is causing this?
>
> I remember reading "somewhere" tha
On Mar 8, 1:36 pm, ET wrote:
> I have been using the 'threading' library and decided to try swapping it
> out for 'processing'... while it's awesome that processing so closely
> mirrors the threading interface, I've been having trouble getting my
> processes to share an object in a similar way.
>
ET wrote:
Using the 'with' keyword didn't work...
Just an aside here for any multiprocessing maintainers
watching ;) . I expect that the "didn't work" here
refers to this bug:
http://bugs.python.org/issue5261
Altho' if the OP cares to clarify, it might be something
else.
TJG
--
http://mail.
I have been using the 'threading' library and decided to try swapping it
out for 'processing'... while it's awesome that processing so closely
mirrors the threading interface, I've been having trouble getting my
processes to share an object in a similar way.
Using the 'with' keyword didn't work, a
Tim Golden wrote:
Diez B. Roggisch wrote:
Hans Larsen schrieb:
Could you help me ?
How could I "take" an elemment from a set or a frozenset
.-) ?
From a string (unicode? Python<3), or from a
tuple,or from a list: Element by index or slice.
Diez B. Roggisch wrote:
Hans Larsen schrieb:
Could you help me ?
How could I "take" an elemment from a set or a frozenset
.-) ?
From a string (unicode? Python<3), or from a
tuple,or from a list: Element by index or slice.
From a dict: by k
r wrote:
> This is to all usenet readers who think they own c.l.py!
[snip abusive, anti-social rant]
Well, after kill-filing this kiddie for a few months, I thought I'd give him
a chance. By pure luck I chose this post to read.
Good news "r", you've earned yourself a permanent kill-filing. I'll
BigHand wrote:
> Finally I got the results now. This did take me 10 hours to solve
> this. the docs of 3.0..
You will have to get used to Unicode. The code you used against the C-API
mimics almost exactly the steps you'd use at the Python level.
Stefan
--
http://mail.python.org/mailman/listin
BigHand wrote:
> I know that there is no PyString_AsString in Python3.0,
> could you guys give me instruction about how can I do with the
> following ?
>
> PyObject *exc_type = NULL, *exc_value = NULL, *exc_tb = NULL;
> PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
>
> how do I transfer the exc_ty
Hans Larsen schrieb:
Could you help me ?
How could I "take" an elemment from a set or a frozenset .-) ?
From a string (unicode? Python<3), or from a tuple,or
from a list: Element by index or slice.
From a dict: by key.
But
On Mar 8, 4:48 am, "andrew cooke" wrote:
> odeits wrote:
> > On Mar 7, 1:07 pm, Scott David Daniels wrote:
> >> odeits wrote:
> >> > I am looking to clean up this code... any help is much appreciated.
> >> > Note: It works just fine, I just think it could be done cleaner.
>
> >> > The result is a
On Mar 7, 6:59 pm, Carl Banks wrote:
>
> I see that Brett Canon's importlib has finally made it into Python
> standard library. Congrats there (if you still read this list), I am
> struggling with Python's arcane import semantics (for something
> ridiculously silly) now and I feel your pain.
>
H
Could you help me ?
How could I "take" an elemment from a set or a frozenset .-) ?
From a string (unicode? Python<3), or from a tuple,or
from a list: Element by index or slice.
From a dict: by key.
But what concerning a set o
Gabriel Genellina wrote:
En Fri, 06 Mar 2009 06:52:00 -0200, escribió:
I have succeeded in building Python 2.6.1 from source under Windows XP
by running Visual C++ 2008 Express on the PCbuild/pcbuild.sln file
both from the Visual C++ application as well as from the commandline
[...]
I would li
On Mar 7, 2:14 pm, Christian Heimes wrote:
> Steven D'Aprano wrote:
> > Yes. Floating point NANs are required to compare unequal to all floats,
> > including themselves. It's part of the IEEE standard.
>
> As far as I remember that's not correct. It's just the way C has
> interpreted the standard
On Mar 7, 5:52Â pm, Xah Lee wrote:
> HARASSMENT BY JOHN BOKMA
>
> I was harassed by a newsgroup poster John Bokma (a regular of
> comp.lang.perl.misc) to have my web hosting service provider kick me
> off. This happened in 2006.
I know the feeling. I have this super geek with nothing but time on
On Mar 8, 7:50Â am, "D'Arcy J.M. Cain" wrote:
> So you are going to repeat his postings in their entirety so that those
> that block him will see them anyway, right? Â Wrong. Â We'll just block
> your posts too.
>
> *plonk*
This is to all usenet readers who think they own c.l.py!
Colin J. Williams ncf.ca> writes:
> Do you have any schedule for a Windows
> binary release?
They should materialize on Monday.
--
http://mail.python.org/mailman/listinfo/python-list
Xah Lee wrote:
For those of you imperative programers who kept on hearing about lisp
and is tempted to learn, then, ...
You:
* consider yourself unfairly treated by various communities
* post a long drivel about various Lisp flavors to newsgroups
that are not in any way Lisp related
?
There
Thanks duncan, thats very helpful. I'll be more careful with floating
point numbers in future.
--
http://mail.python.org/mailman/listinfo/python-list
farsi...@gmail.com wrote:
> Thanks all, that's very helpful, sorry to waste your time with a
> common question. I have tried the decimal module and will definitely
> keep using it if I need to do this kind of calculation again.
Try to remember though that the decimal module simply replaces one so
RT wrote:
Can you recommend any books or articles that you have found offer
useful advice on program structure, design and use of classes or any
other features or best practices that you feel are important for
professional Python development.
In my opinion, 'professional development' has sur
Thanks all, that's very helpful, sorry to waste your time with a
common question. I have tried the decimal module and will definitely
keep using it if I need to do this kind of calculation again.
I have 1 more question that the floating point article that was linked
didn't really answer:
>>> x =
Scott David Daniels wrote:
Lie Ryan wrote:
Fencer wrote:
The literal translation of that would be:
if n is not None and n != []:
b = True
else:
b = False
it is a bit verbose, so one might want to find something shorter
b = True if n is not None and n != [] else False
I always feel if and
On Mar 8, 7:22 pm, farsi...@gmail.com wrote:
> On Mar 8, 2:16 pm, farsi...@gmail.com wrote:
>
> > >>> 4 / 5.0
>
> > 0.84>>> 0.8 * 5
>
> > 4.0
>
> > python 2.6.1 on mac. What the hell is going on here?
>
> Pure curiosity prompted me to try the following:>>> 40 / 5.0
>
> 8.0
>
> Stran
Victor Lin wrote:
On 3月8日, 下午9時56分, "Diez B. Roggisch" wrote:
Victor Lin schrieb:
Hi,
I am going to develop a c library binding with ctypes. That c library
will call callback from worker threads it created. Here comes the
problem : Will the GIL be acquired before it goes into Python
functio
farsi...@gmail.com wrote:
On Mar 8, 2:16 pm, farsi...@gmail.com wrote:
4 / 5.0
0.84
This one is a common FAQ. Basically floating point is never to be
trusted. This issue is quite language agnostic, however some language
decided to "hide" the issue, python does not. For more
Victor Lin wrote
> I know I have to call PyEval_InitThreads if my module create threads
> that will contact python stuff, for example, call a python callback
> function from threads. But however, it is ctypes. I have no idea
> should I do that for the imported dll? If it is, how?
You have to initi
En Sun, 08 Mar 2009 12:22:50 -0200, escribió:
On Mar 8, 2:16 pm, farsi...@gmail.com wrote:
>>> 4 / 5.0
0.84
>>> 0.8 * 5
4.0
python 2.6.1 on mac. What the hell is going on here?
Pure curiosity prompted me to try the following:
40 / 5.0
8.0
Strange...
See http://docs.py
On 3月8日, 下午10時20分, Christian Heimes wrote:
> Victor Lin wrote:
> > Hi,
>
> > I am going to develop a c library binding with ctypes. That c library
> > will call callback from worker threads it created. Here comes the
> > problem : Will the GIL be acquired before it goes into Python
> > function?
>
On 3月8日, 下午9時56分, "Diez B. Roggisch" wrote:
> Victor Lin schrieb:
>
>
>
> > Hi,
>
> > I am going to develop a c library binding with ctypes. That c library
> > will call callback from worker threads it created. Here comes the
> > problem : Will the GIL be acquired before it goes into Python
> > fu
1 - 100 of 132 matches
Mail list logo