I'm building a turn based RPG game as a hobby. The design is becoming
increasingly complicated and confusing, and I think I may have
tendency to over-engineer simple things. Can anybody please check my
problems-solutions and point me to more elegant solution?
Every item/character/room is a separat
I've found the module pkipplib which seems to work well for things like
interrogating an IPP (CUPS) server. But is there a way to send a print
job to an IPP print queue? [and no, the local system knows nothing about
the print architecture so popenlp is not an option]. I just want to
send the
I've found the module pkipplib which seems to work well for things like
interrogating an IPP (CUPS) server. But is there a way to send a print
job to an IPP print queue? [and no, the local system knows nothing about
the print architecture so popenlp is not an option]. I just want to
send the
Kruptein wrote:
on steven, peter and eliasf:
Well okay I'm new to the world of developing programs, if I encounter
problems I directly post a bug on the relevant page, that's maybe why
I was a bit frustrated :)
but what you three say is indeed true..
Hi,
It does not work with python 2.5 (w
Dana Sun, 17 Oct 2010 15:36:13 -0400,
Benjamin Kaplan kaze:
> On Sun, Oct 17, 2010 at 3:04 PM, Nikola Skoric wrote:
> You're trying to write Unicode to a file. But there's no such thing as
/snip
> .encode("cp1252") or whatever encoding you want to use to the end of
> the mytemplate.render_unicod
On Oct 18, 12:28 am, dex wrote:
> Every item/character/room is a separate object. Items/characters need
> to have references to room they are in, and room needs to have a list
> of references to items/characters that are contained within. I decided
> to use weak references. That way I can destroy
Steven D'Aprano wrote:
I am pleased to announce the first public release of stats for Python.
http://pypi.python.org/pypi/stats
stats is a pure-Python module providing basic statistics functions
similar to those found on scientific calculators. It currently includes:
Univariate statistics in
dex wrote:
In each object's
__init__() that object is added to game_object list, and in each
__del__() they are removed from game_object list. This mechanism keeps
them safe from garbage collector. How pythonic is this design?
You don't have to manage memory with python, I don't know if you w
On Sun, 2010-10-17 at 17:10 +, Steven D'Aprano wrote:
> I am pleased to announce the first public release of stats for Python.
>
> http://pypi.python.org/pypi/stats
Quick comment on your sum() function:
http://docs.python.org/library/math.html#math.fsum
(in 2.6 and above)
should do the sa
On 17/10/2010 20:25, John Henry wrote:
Not knowing anything about MAPI, I tried a number of the MAPI flags,
the only one that works appears to be PR_SUBJECT.
PR_CLIENT_SUBMIT_TIME, PR_CREATION_TIME and so forth doesn't work.
I'll try to fish out some of the code we use, but for most
of the fiel
On Oct 17, 12:35 pm, Florian Weimer wrote:
> * Chris Torek:
>
> > In article <[email protected]>
> > Florian Weimer wrote:
> >>Are there libraries which implement some form of spreadsheet-style
> >>dependency tracking? The idea is to enable incremental updates to
> >>some fairly
hello , I have started python last week,so maybe my question is a bit
stupid.
I got this error in my simple python code while trying to load data
into the code. I have added this libaraies
from pylab import *
from scipy import *
import matplotlib.mlab as mlab
from numpy import *
from scipy import o
Hello.
I have a class A that contains two classes B and C:
class A:
class B:
self.x = 2
class C:
Is there a way to access the x defined in B in class C?
Thanks.
--
F. Delente
--
http://mail.python.org/mailman/listinfo/python-list
On 2010-10-18,
wrote:
> Hello.
>
> I have a class A that contains two classes B and C:
>
> class A:
> class B:
> self.x = 2
>
> class C:
>
> Is there a way to access the x defined in B in class C?
That's not valid Python code. Do you mean:
Class A:
Class B:
x = 2
or
Class A
On 2010-10-18, Neil Cerutti wrote:
> On 2010-10-18,
> wrote:
>> Hello.
>>
>> I have a class A that contains two classes B and C:
>>
>> class A:
>> class B:
>> self.x = 2
>>
>> class C:
>>
>> Is there a way to access the x defined in B in class C?
>
> That's not valid Python code. Do
Neil Cerutti wrote:
>> I have a class A that contains two classes B and C:
>>
>> class A:
>> class B:
>> self.x = 2
>>
>> class C:
I only wanted to show the structure of the code, not the actual
instructions.
> That's not valid Python code. Do you mean:
>
> Class A:
> Class B:
>
> You're aware Python can collect reference cycles, correct? You don't
> have to delete references; Python will get them eventually.
I'm not sure I understand this part? If I don't delete all strong
references, the object will not be deleted.
It will persist and occupy memory as long as there's
On 10/18/2010 06:45 AM, [email protected] wrote:
Neil Cerutti wrote:
I have a class A that contains two classes B and C:
class A:
class B:
self.x = 2
class C:
I only wanted to show the structure of the code, not the actual
instructions.
That's not valid Python code. D
On 2010-10-18, Steven D'Aprano wrote:
> Neither is accurate. all_ascii would be:
>
> all(ord(c) <= 127 for c in string for string in L)
Definitely.
> all_printable would be considerably harder. As far as I can tell, there's
> no simple way to tell if a character is printable.
There's no easy
Gary Herron wrote:
> Well, your code still doesn't make sense, but the generic answers are:
I'll clarify what I need then:
I'm drawing Bézier curves. I draw them on a zone that is defined as a
subclass of GtkDrawingArea.
In a zone, I define a system of coordinates by 4 values: xmin, xmax,
ymin,
[email protected] wrote:
Neil Cerutti wrote:
I have a class A that contains two classes B and C:
class A:
class B:
self.x = 2
class C:
I only wanted to show the structure of the code, not the actual
instructions.
Always post working code, or at least some
On Mon, Oct 18, 2010 at 9:50 AM, dex wrote:
>> You're aware Python can collect reference cycles, correct? You don't
>> have to delete references; Python will get them eventually.
>
> I'm not sure I understand this part? If I don't delete all strong
> references, the object will not be deleted.
>
Jean-Michel Pichavant wrote:
> Always post working code, or at least something we can paste in the
> python interpreter (even if it's buggy)
Ok, noted.
> class A:
>class B:
>x=2
>class C:
>def __init__(self):
>print A.B.x
>
> c = A.C()
>
> >2
Good, thanks.
On Mon, 18 Oct 2010 14:35:58 +, fab wrote:
> So my way of coding it is the following:
>
> class zone(GtkDrawingArea):
>
> class systemOfCoordinates:
> self.xmin = -5
> self.xmax = 5
> self.ymin = -5
> self.ymax = 5
"self" isn't meaningful within a class definition.
It's f
Am 18.10.2010 16:35, schrieb [email protected]:
> So my way of coding it is the following:
>
> class zone(GtkDrawingArea):
>
> class systemOfCoordinates:
> self.xmin = -5
> self.xmax = 5
> self.ymin = -5
> self.ymax = 5
>
> class Curve:
> self.listOfPoints = ()
Christian Heimes wrote:
> Don't nest classes. Just don't. This might be a valid and good approach
> in some programming languages but it's not Pythonic. Your code can
> easily be implemented without nested classes.
I think you're right. It would have been more aesthetically pleasant
to me (a Hand
I'm trying to delete some messages from a mailbox when they are older
than a certain number of days.
If I iterate through the mailbox and find a message that needs
deleting how do I get its key so I can do "remove(key)"?
The trouble is that, as the documentation says: "The default Mailbox
iterat
On Mon, 18 Oct 2010 17:17:52 +0200 Christian Heimes
wrote:
> [snip]
> Don't nest classes. Just don't. This might be a valid and good
> approach in some programming languages but it's not Pythonic.
Explain!
/W
--
To reach me via email, replace INVALID with the country code of my home
country
On 10/18/10 09:28, Grant Edwards wrote:
There's no easy way to even define what "printable" means. Ask three
different people, and you'll get at least four different answers
answers.
I don't have a printer...that makes *all* characters unprintable,
right? Now I can convert the algorithm to O
nakisa writes:
> hello , I have started python last week,so maybe my question is a bit
> stupid.
> I got this error in my simple python code while trying to load data
> into the code. I have added this libaraies
> from pylab import *
> from scipy import *
> import matplotlib.mlab as mlab
> from n
On Oct 18, 5:02 pm, [email protected] (Diez B. Roggisch) wrote:
> nakisa writes:
> > hello , I have started python last week,so maybe my question is a bit
> > stupid.
> > I got this error in my simple python code while trying to load data
> > into the code. I have added this libaraies
> > from pylab im
[email protected] wrote:
Christian Heimes wrote:
Don't nest classes. Just don't. This might be a valid and good approach
in some programming languages but it's not Pythonic. Your code can
easily be implemented without nested classes.
I think you're right. It would have been
On Mon, Oct 18, 2010 at 8:58 AM, Andreas Waldenburger
wrote:
> On Mon, 18 Oct 2010 17:17:52 +0200 Christian Heimes
> wrote:
>
>> [snip]
>> Don't nest classes. Just don't. This might be a valid and good
>> approach in some programming languages but it's not Pythonic.
>
> Explain!
"Private" classe
On Mon, Oct 18, 2010 at 8:42 AM, wrote:
> I'm trying to delete some messages from a mailbox when they are older
> than a certain number of days.
>
> If I iterate through the mailbox and find a message that needs
> deleting how do I get its key so I can do "remove(key)"?
>
> The trouble is that, a
[email protected] wrote:
Jean-Michel Pichavant wrote:
Always post working code, or at least something we can paste in the
python interpreter (even if it's buggy)
Ok, noted.
class A:
class B:
x=2
class C:
def __init__(self):
print A.B.x
c
Diez B. Roggisch wrote:
> nakisa writes:
>
>> hello , I have started python last week,so maybe my question is a bit
>> stupid.
>> I got this error in my simple python code while trying to load data
>> into the code. I have added this libaraies
>> from pylab import *
>> from scipy import *
>> imp
Printable in the screen, all of them are, except for blank spaces ehhehehe
2010/10/18, Tim Chase :
> On 10/18/10 09:28, Grant Edwards wrote:
>> There's no easy way to even define what "printable" means. Ask three
>> different people, and you'll get at least four different answers
>> answers.
>
>
On Oct 18, 4:09 am, Tim Golden wrote:
> On 17/10/2010 20:25, John Henry wrote:
>
> > Not knowing anything about MAPI, I tried a number of the MAPI flags,
> > the only one that works appears to be PR_SUBJECT.
> > PR_CLIENT_SUBMIT_TIME, PR_CREATION_TIME and so forth doesn't work.
>
> I'll try to fis
On 10/18/2010 8:17 AM, Christian Heimes wrote:
Am 18.10.2010 16:35, schrieb [email protected]:
So my way of coding it is the following:
class zone(GtkDrawingArea):
class systemOfCoordinates:
self.xmin = -5
self.xmax = 5
self.ymin = -5
self.ymax = 5
class Cu
When I do import tkMessageBox the Python Shell tells me that this
does not exist. Where do I find it? You may reply to my academic
email: [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, Oct 18, 2010 at 11:32 AM, richard wrote:
> When I do import tkMessageBox the Python Shell tells me that this
> does not exist. Where do I find it?
What OS are you using? How did you install Python? Can you `import Tkinter`?
Cheers,
Chris
--
http://blog.rebertia.com
--
http://mail.py
On Oct 18, 6:50 am, dex wrote:
> > You're aware Python can collect reference cycles, correct? You don't
> > have to delete references; Python will get them eventually.
>
> I'm not sure I understand this part? If I don't delete all strong
> references, the object will not be deleted.
> It will p
Here is an example straight out of the help, and for some reason, it
is not working. I get the error messages in the log, but I do not get
the info messages in the console.
import datetime, logging
def main():
timestamp = datetime.datetime.now().strftime("%Y%m%d-%I%M%S")
#set up logging
2010/10/17 Steven D'Aprano :
> I am pleased to announce the first public release of stats for Python.
>
> http://pypi.python.org/pypi/stats
>
> stats is a pure-Python module providing basic statistics functions
> similar to those found on scientific calculators. It currently includes:
>
> Univariat
Hello, I am using os.path to get the absolute paths of a few
directories that some python files are in.
FIlePath = os.path.dirname(os.path.realpath(__file__))
which returns a path similar to /home/devinm/project/files
Now I want to get the directory above this one. (/home/devinm/
project/) Is there
On Mon, 18 Oct 2010 11:52:36 -0700, [email protected] wrote:
> Here is an example straight out of the help, and for some reason, it is
> not working. I get the error messages in the log, but I do not get the
> info messages in the console.
>
Hello,
I don't see this code in the help; nevert
I have two issues dealing with the table widget, though they may be
interconnected. I'm not sure. Both delete the cell widgets off of my
table but leave the rows, and then when I have the table update, it
complains the c++ object has been deleted.
# self.tableData.setCellWidget(rowCount, 0, trackI
On Mon, 18 Oct 2010 14:24:39 -0700 (PDT) Devin M
wrote:
> Hello, I am using os.path to get the absolute paths of a few
> directories that some python files are in.
> FIlePath = os.path.dirname(os.path.realpath(__file__))
> which returns a path similar to /home/devinm/project/files
> Now I want to
On Mon, 18 Oct 2010 17:29:11 -0400 Andreas Waldenburger
wrote:
> On Mon, 18 Oct 2010 14:24:39 -0700 (PDT) Devin M
> wrote:
> [snip]
>
> Maybe os.relpath("..", FilePath) ? Python > 2.6 only.
>
Gah! I should learn to copy&paste more. Obviously it's the second one
(os.path.relpath), not the first
On Mon, Oct 18, 2010 at 2:24 PM, Devin M wrote:
> Hello, I am using os.path to get the absolute paths of a few
> directories that some python files are in.
> FIlePath = os.path.dirname(os.path.realpath(__file__))
> which returns a path similar to /home/devinm/project/files
> Now I want to get the
On 10/18/2010 2:24 PM Devin M said...
Hello, I am using os.path to get the absolute paths of a few
directories that some python files are in.
FIlePath = os.path.dirname(os.path.realpath(__file__))
which returns a path similar to /home/devinm/project/files
Now I want to get the directory above thi
If I set logging.basicConfig() call to logging.INFO, then I see info
messages in the logfile. I only want to see error messages in the
logfile.
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 18 Oct 2010 17:17:52 +0200, Christian Heimes wrote:
> Don't nest classes. Just don't. This might be a valid and good approach
> in some programming languages but it's not Pythonic. Your code can
> easily be implemented without nested classes.
I'll accept that nested classes are unusual, b
On Mon, 18 Oct 2010 09:34:07 -0700, Chris Rebert wrote:
> Also, Python's scoping rules, particularly for class-level scopes, don't
> work the way programmers from languages where nested classes are common
> would expect:
[snip example]
I'm sorry, I don't see that "language Foo programmers will b
On Mon, 18 Oct 2010 09:34:07 -0700, Chris Rebert wrote:
> Also, Python's scoping rules, particularly for class-level scopes, don't
> work the way programmers from languages where nested classes are common
> would expect:
[snip example]
I'm sorry, I don't see that "language Foo programmers will b
On Mon, 18 Oct 2010 09:34:07 -0700, Chris Rebert wrote:
> Also, Python's scoping rules, particularly for class-level scopes, don't
> work the way programmers from languages where nested classes are common
> would expect:
[snip example]
I'm sorry, I don't see that "language Foo programmers will b
On Mon, 18 Oct 2010 09:34:07 -0700, Chris Rebert wrote:
> Also, Python's scoping rules, particularly for class-level scopes, don't
> work the way programmers from languages where nested classes are common
> would expect:
[snip example]
I'm sorry, I don't see that "language Foo programmers will b
On Mon, 18 Oct 2010 09:34:07 -0700, Chris Rebert wrote:
> Also, Python's scoping rules, particularly for class-level scopes, don't
> work the way programmers from languages where nested classes are common
> would expect:
[snip example]
I'm sorry, I don't see that "language Foo programmers will b
On 18.10.2010 23:24, Devin M wrote:
Hello, I am using os.path to get the absolute paths of a few
directories that some python files are in.
FIlePath = os.path.dirname(os.path.realpath(__file__))
which returns a path similar to /home/devinm/project/files
Now I want to get the directory above this
On Mon, 18 Oct 2010 09:34:07 -0700, Chris Rebert wrote:
> Also, Python's scoping rules, particularly for class-level scopes, don't
> work the way programmers from languages where nested classes are common
> would expect:
[snip example]
I'm sorry, I don't see that "language Foo programmers will b
On Mon, 18 Oct 2010 09:34:07 -0700, Chris Rebert wrote:
> Also, Python's scoping rules, particularly for class-level scopes, don't
> work the way programmers from languages where nested classes are common
> would expect:
[snip example]
I'm sorry, I don't see that "language Foo programmers will b
On Mon, 18 Oct 2010 09:34:07 -0700, Chris Rebert wrote:
> Also, Python's scoping rules, particularly for class-level scopes, don't
> work the way programmers from languages where nested classes are common
> would expect:
[snip example]
I'm sorry, I don't see that "language Foo programmers will b
On Mon, 18 Oct 2010 09:34:07 -0700, Chris Rebert wrote:
> Also, Python's scoping rules, particularly for class-level scopes, don't
> work the way programmers from languages where nested classes are common
> would expect:
[snip example]
I'm sorry, I don't see that "language Foo programmers will b
On Mon, 18 Oct 2010 09:34:07 -0700, Chris Rebert wrote:
> Also, Python's scoping rules, particularly for class-level scopes, don't
> work the way programmers from languages where nested classes are common
> would expect:
[snip example]
I'm sorry, I don't see that "language Foo programmers will b
In article <[email protected]>,
Steven D'Aprano wrote:
>
>I'm sorry, I don't see that "language Foo programmers will be surprised
>that Python is not language Foo" is an argument against Python
>programmers using nested classes. Surely it's an argument against
>w
On Mon, 18 Oct 2010 11:56:39 +0200, Jean-Michel Pichavant wrote:
> I already have a stats module:
> /usr/lib/python2.5/site-packages/stats.py
The name of my module is not set in stone.
I can't help what site-packages you have, but the above is not on PyPI,
and it's certainly not part of the sta
In message , Dave
Angel wrote:
> As you've noticed, many times a program started from the start menu
> doesn't leave its command window open long enough to read the messages.
Windows needs an equivalent to ~/.xsession-errors.
--
http://mail.python.org/mailman/listinfo/python-list
In message
<42d82f8a-4ee6-44a7-914d-86dfc21f1...@a36g2000yqc.googlegroups.com>,
Fuzzyman wrote:
> Allowing calculations to complete even in the presence of cycles can be
> very useful.
But then the answer is no longer completely deterministic.
--
http://mail.python.org/mailman/listinfo/python-
On Oct 18, 2:43 pm, Alexander Kapps wrote:
> On 18.10.2010 23:24, Devin M wrote:
>
> > Hello, I am using os.path to get the absolute paths of a few
> > directories that some python files are in.
> > FIlePath = os.path.dirname(os.path.realpath(__file__))
> > which returns a path similar to /home/de
On Oct 18, 10:45 pm, "[email protected]"
wrote:
> If I setlogging.basicConfig() call tologging.INFO, then I see info
> messages in the logfile. I only want to see error messages in the
> logfile.
What you need to do is,
1. Set the root logger's level to INFO. That's because you want at
leas
welcome to http://www.jialiuonline.com/FOOTWEAR/ or feel
All the products are listed as following:
Footwear:
NikeAF1,Airmax,Shox,Adidas,Timberland,Puma,Gucci,Prada,LV,Chanel,Lacoste,Lebron,Kobe,Rift,
Dunk SB, Nike Women Shoes, Nike Children Shoes, Hogan, Obama, Coogi,
Bape Star, Adicolor, Ice Cr
Hi,
i have a program that have to execute linux commands. I do it like this:
retcode = Popen(["xterm", "-e", command],stdin=PIPE, stdout=PIPE,
stderr=PIPE)
I have to use xterm because some commands need further input from the user
after they are executed.
But when i use xterm i can't get t
On 2010-10-18, Aahz wrote:
> In article <[email protected]>,
> Steven D'Aprano wrote:
>>[duplicate post]
> Maybe, but there's no reason for posting that ten times! ;-)
I would guess that there is almost certainly a reason. My first candidate
would be "buggy
Steven D'Aprano writes:
> On Mon, 18 Oct 2010 11:56:39 +0200, Jean-Michel Pichavant wrote:
>
> > I already have a stats module:
> > /usr/lib/python2.5/site-packages/stats.py
>
> The name of my module is not set in stone.
>
> I can't help what site-packages you have, but the above is not on
> PyPI
On Mon, 18 Oct 2010 16:05:04 -0700, Aahz wrote:
> In article <[email protected]>, Steven
> D'Aprano wrote:
>>
>>I'm sorry, I don't see that "language Foo programmers will be surprised
>>that Python is not language Foo" is an argument against Python
>>programmers
On Tue, 19 Oct 2010 11:53:40 +1100, Ben Finney wrote:
> Steven D'Aprano writes:
>
>> On Mon, 18 Oct 2010 11:56:39 +0200, Jean-Michel Pichavant wrote:
>>
>> > I already have a stats module:
>> > /usr/lib/python2.5/site-packages/stats.py
>>
>> The name of my module is not set in stone.
>>
>> I can
On Oct 18, 4:15 pm, Lawrence D'Oliveiro wrote:
> In message
> <42d82f8a-4ee6-44a7-914d-86dfc21f1...@a36g2000yqc.googlegroups.com>,
>
> Fuzzyman wrote:
> > Allowing calculations to complete even in the presence of cycles can be
> > very useful.
>
> But then the answer is no longer completely determ
Hello all.
I am sorry for the cross posting but I really would like to hear
comments from experience people in Python.
I am new to Python, not new in programming. I am leaving the PHP path
and moving to Python. When I was learning PHP it was very useful to
learn to install OpenSource solutio
Hello,
I'm trying to find a way to collect a set of values from real data,
and then sample values randomly from this data - so, the data I'm
collecting becomes a kind of probability distribution. For instance, I
might have age data for some children. It's very easy to collect this
data using a lis
Steven D'Aprano wrote:
> I'll accept that nested classes are unusual, but unPythonic? Never!
Not even if "flat is better than nested" ;)
And are you the same Steven D'Aprano who once wrote:
"Never nest classes, unless you need to, or to win a bet."
Given that there's little if anything gained
On Tue, Oct 19, 2010 at 1:37 PM, alex23 wrote:
> Given that there's little if anything gained from nesting classes
> (other than possible scoping confusion) is there ever a need?
15+ years of programming and I've never used nested classes in any language :)
cheers
James
--
-- James Mills
--
--
On Tue, 19 Oct 2010 13:54:32 +1000, James Mills wrote:
> On Tue, Oct 19, 2010 at 1:37 PM, alex23 wrote:
>> Given that there's little if anything gained from nesting classes
>> (other than possible scoping confusion) is there ever a need?
>
> 15+ years of programming and I've never used nested cl
On Mon, Oct 18, 2010 at 3:24 PM, Steven D'Aprano
wrote:
> On Mon, 18 Oct 2010 09:34:07 -0700, Chris Rebert wrote:
>
>> Also, Python's scoping rules, particularly for class-level scopes, don't
>> work the way programmers from languages where nested classes are common
>> would expect:
> [snip exampl
I'm writing a simple simulator, and I want to schedule an action to
occur at a later time. Basically, at some later point I want to call a
function f(a, b, c). But the values of a, b and c are determined at
the current time.
One way way to do this is to keep a list of entries of the form [[T
On Mon, Oct 18, 2010 at 9:21 PM, TomF wrote:
> I'm writing a simple simulator, and I want to schedule an action to occur at
> a later time. Basically, at some later point I want to call a function f(a,
> b, c). But the values of a, b and c are determined at the current time.
See the `sched` std
On Mon, Oct 18, 2010 at 8:27 PM, elsa wrote:
> Hello,
>
> I'm trying to find a way to collect a set of values from real data,
> and then sample values randomly from this data - so, the data I'm
> collecting becomes a kind of probability distribution. For instance, I
> might have age data for some
On Mon, 18 Oct 2010 20:37:34 -0700, alex23 wrote:
> Steven D'Aprano wrote:
>> I'll accept that nested classes are unusual, but unPythonic? Never!
>
> Not even if "flat is better than nested" ;)
But "Namespaces are one honking great idea -- let's do more of
those!" (classes are a good thing) an
On Mon, 18 Oct 2010 21:21:41 -0700, TomF wrote:
> I'm writing a simple simulator, and I want to schedule an action to
> occur at a later time. Basically, at some later point I want to call a
> function f(a, b, c). But the values of a, b and c are determined at the
> current time.
>
> One way wa
In message <2010101821214168010-tomfsess...@gmailcom>, TomF wrote:
> One way way to do this is to keep a list of entries of the form [[TIME,
> FN, ARGS]...] and at simulated time TIME do:
fn(*args) or fn(**kwargs)
--
http://mail.python.org/mailman/listinfo/python-list
On 19Oct2010 04:59, Steven D'Aprano
wrote:
| Chris Rebert has already mentioned the sched module. Otherwise, put the
| function call in a thread, and have the thread use time.sleep to wait
| until the right time to execute.
There is also the Timer class from the threading module.
Cheers,
--
Steven D'Aprano wrote:
> Avoiding namespace pollution and information hiding are two good reasons
> for nesting classes.
Python already has a great mechanism for regulating namespaces:
modules & importing. Information hiding seems to go against the 'all
consenting adults' ethos as well.
> There'
elsa writes:
> Hello,
>
> I'm trying to find a way to collect a set of values from real data,
> and then sample values randomly from this data - so, the data I'm
> collecting becomes a kind of probability distribution. For instance, I
> might have age data for some children. It's very easy to col
On Mon, Oct 18, 2010 at 11:40 PM, Arnaud Delobelle wrote:
> elsa writes:
>> Hello,
>>
>> I'm trying to find a way to collect a set of values from real data,
>> and then sample values randomly from this data - so, the data I'm
>> collecting becomes a kind of probability distribution. For instance,
93 matches
Mail list logo