hi,
i am running Linux Ubuntu Hoary and am trying to build the Python
numarray package, v. 1.3.2 by hand since ubuntu's repos won't be
updated until breezy.
i have python 2.4, and gcc 3.3.5
after unpacking the tar, i run "python setup.py install", as it says in
the installation instructions. i g
Steven Bethard wrote:
> I have a string with a bunch of whitespace in it, and a series of chunks
> of that string whose indices I need to find. However, the chunks have
> been whitespace-normalized, so that multiple spaces and newlines have
> been converted to single spaces as if by ' '.join(chun
The reason I ask is that I often (well... a couple of times anyway) see
cryptic omments like :
and if you inherit from object you get all the benefits of new
style classes
Now I know about the advantages of inheriting from the built in types
(if that's what you want to do) -but am a bit fuzzi
I'm building an application that makes several user-specified internet
connections; twisted meets my needs more or less perfectly.
I'm running into a problem, however, in that twisted is not allowing
connections (reactor.connectTCP) by hostname, only IP address. [read:
connections to IP address
Well i want a external app to maximize and minimize my app.
And later on i want the external one to send some data. Thought this
would be the most easy (and fast) way!
Greetz
--
http://mail.python.org/mailman/listinfo/python-list
I use the pty module, in combination with select.select.
Search for Pexpect for an elaborate example.
It basically goes something like this:
-
import os, select, pty
pid, fd = pty.fork()
fd_eof = 0
if pid == 0:
os.execvp('ls',['ls']) # child proce
MS Visual C++ 6 is indeed the compiler that the python.org
distributions are built with, but MinGW works fine too. In fact, the
code generated by MinGW-GCC 3.4.4 outpaces that generated by MSVC++ 6.0
by a considerable margin in some of my performance-critical extensions,
and the size of the binari
Joseph Garvin <[EMAIL PROTECTED]> writes:
> I'm curious -- what is everyone's favorite trick from a non-python
> language?
Metapost solution of linear equations:
x1+9=x2-8=2;
> And -- why isn't it in Python?
I'd like to know too.
--
Brian (remove the sport for mail)
http://www.et.web.mek.dtu
[DeRRudi]
| Well i want a external app to maximize and minimize my app.
| And later on i want the external one to send some data. Thought this
| would be the most easy (and fast) way!
|
| Greetz
|
Rudi. I, at least, am reading this via the mailing list, not
via Usenet nor via Google. This means
Christopher Subich wrote:
> From what I can tell, the problem lies in that Twisted simply isn't
> performing the DNS resolutions. From the connection factory's
> startedConnecting method, print connector.getDestination() results in:
>
> IPv4Address(TCP, 'hostname', port)
Update: after doing s
On Sun, 26 Jun 2005 16:10:05 -0700, Steve Jorgensen <[EMAIL PROTECTED]>
wrote:
>I'm posting this message for 2 reasons.
>
>First, I'm still pretty new and shakey to the whole Acceptance Testing thing,
>and I'm hoping for some feedback on whether I'm on the right track. Second,
>although all the A
On 29 Jun 2005 15:34:11 -0700, Luis M. Gonzalez <[EMAIL PROTECTED]> wrote:
> What's exactly the "cockney" accent?
> Is it related to some place or it's just a kind of slang?
A cockney is a *real* Londoner, that is, someone born within the City
of London, a.k.a The Square Mile. More specifically, i
In message <[EMAIL PROTECTED]>, Markus Wankus
<[EMAIL PROTECTED]> writes
>just think it is silly not to benefit from them.
In which case you misunderstood me - I never said people should not use
them, just that they should not be relied on for productivity
improvements. They must factor in at a
> Tim Goldenwrote:
>
> Rudi. I, at least, am reading this via the mailing list, not
> via Usenet nor via Google. This means that if you don't put
> any kind of context in what you post, I have to guess at what
> you're responding to. (All I see is the exact text you typed,
> nothing else).
>
> A
[DeRRudi]
| > Tim Goldenwrote:
|
| > Assuming that you're answering my question: why use mmap and
| > not just two events? I understand what your overall plan is,
| > and it looks like you have a way to solve it. It just seemed
| > that you might be able to achieve the same thing with two
| > even
Op 2005-06-29, Scott David Daniels schreef <[EMAIL PROTECTED]>:
> Roy Smith wrote:
>> Andrew Durdin <[EMAIL PROTECTED]> wrote:
>>>Corrected version:
>>>result = [(lambda: expr0), lambda: expr1][bool(cond)]()
> Sorry, I thought cond was a standard boolean.
> Better is:
> result = [(lambda:
On Wednesday 29 June 2005 10:51 pm, Paddy wrote:
> Joseph Garvin wrote:
> 'm curious -- what is everyone's favorite trick from a non-python
> language? And -- why isn't it in Python?
>
> I use constraints programming at work, Check out "System Verilog" or
> OZ/Mozart.
>
> It would be great i
I do fundamentally not agree with you that IDE's and GUI design tools
are a waste of time.
I think that with a good IDE (graphical or not) the synergy between
editor, debugger, documentation, refactoring,
translations/internationalization, version control, software modelling,
profiling, metrics, c
Dennis Lee Bieber wrote:
> On Mon, 27 Jun 2005 13:26:12 +0200, Fredrik Normann <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
>
>>Hello,
>>
>>I'm trying to read the binary files under /var/spool/rwho/ so I'm wondering
>>if
>>anyone has done that before or could give me som
Thomas Bartkus wrote:
> I was thinking of Win32com which I expect lets you put a wrapper around ADO
> and work the ADO (or any other ActiveX) object model from within Python.
Sure, but since others have made wrappers around ADO for Python before,
you'd either reivent the wheel or or use e.g.
http
"jtan325" <[EMAIL PROTECTED]> writes:
> customize_compiler
> cc_cmd = cc + ' ' + opt
> TypeError: cannot concatenate 'str' and 'NoneType' objects
[...]
> upon closer inspection of Python's distutils sysconfig.py, is the error
> being caused by the ' ' in "cc_cmd = cc + ' ' + opt"? Any ideas
Christopher Subich wrote:
> Christopher Subich wrote:
>
>> From what I can tell, the problem lies in that Twisted simply isn't
>> performing the DNS resolutions. From the connection factory's
... right, finally figured it out after a very long time at debugging
the beast.
It's an interactio
On 6/29/05, Christopher Arndt <[EMAIL PROTECTED]> wrote:
(snip)
> Most of these are probably not elegible due to license issues but I'd
> love to see SQLite support added to Python-out-of-the-box.
Adding sqllite to the standard library has been discussed before:
http://groups-beta.google.com/gro
> Gentle folk of comp.lang.python, I heartily thank you all for your
> input. I think I'm taking the boys through the door marked "Logo." We
> may be back this way, though. We will likely need MORE in the nebulous
> future. I am impressed with the outpouring of support here!
Before you commit
Je connais mal python et n'est pas trop le temps de m'y plonger bien
que cela semble être assez puissant...
import sys
import ixio
import os
M = ixio.getMAC("eth0")
S = "%08X %08X" % (M[0] | M[1]<<8 | M[2]<<16 | M[3]<<24, M[4] |
M[5]<<8)
K = "Errorin:"
if len(sys.argv) <> 3:
print "Usage %s
I use the debugger that comes with Eric3, but it is only free for Linux/
OS X, as it needs PyQt.
asside from setting (conditional) breakpoints, one of it's features is
that it can show you a browsable tree of all your variables. something
like this:
class MyClass
|
L-- string 'username' - 'myuser'
Hello,
Is there any option to suppress the JVM activity report that gets displayed,
when you execute Java APIs from within Python using JPype.
E.g.,
JVM activity report :
classes loaded : 26
JVM has been shutdown
I know I can do it by re-directing the std err to NUL.
But is
> Tim Goldenwrote:
> If you wanted to send over arbitrary data from another application,
> then this is certainly a way to do it. (Another way might be to use
a
> Windows pipe, for example). My point was only that if you are
signalling
> an event as a wake-up call plus an atom of extra information
Steven D'Aprano wrote:
> with colour do begin
> red := 0; blue := 255; green := 0;
> end;
>
> instead of:
>
> colour.red := 0; colour.blue := 255; colour.green := 0;
c = colour
c.red = 0; c.blue = 255; c.green = 0
del c # Not strictly needed, but limits the scope of c
When everything's a referenc
In English:
I don't know much about python and I won't have much time to learn much
about it even if it seems powerful...
import sys
import ixio
import os
M = ixio.getMAC("eth0")
S = "%08X %08X" % (M[0] | M[1]<<8 | M[2]<<16 | M[3]<<24, M[4] |
M[5]<<8)
K = "Errorin:"
if len(sys.argv) <> 3:
pr
Hallöchen!
At http://pyvisa.sourceforge.net you can find information about the
PyVISA package. It realises Python bindings for the VISA library
functions, which enables you to control measurement devices via
Python.
Yesterday I released version 0.9. I tried to provide it with good
documentation
On 6/29/05, Thomas Heller <[EMAIL PROTECTED]> wrote:
>
> To me, this sounds that *at least* a PEP would be needed to convince
> Guido. Or, to record the reasoning why it cannot be included.
I have a feeling that Guido won't allow ctypes into the standard
library since it can crash Python. I don'
[woodsplitter]
> MS Visual C++ 6 is indeed the compiler that the python.org
> distributions are built with
Just to add back some context for people not following the thread: this is
Python 2.3 we're talking about. 2.4 is built with Visual Studio.NET.
> but MinGW works fine too. In fact, the
>
Hi all.
I'm writing a simple Python module containing functions to process
strings in various ways. Actually it works importing the module that
contains the function I'm interested in, and calling
my_module.my_function('mystring').
I was just asking if it is possible to "extend" string objects'
be
Hi folks,
I am writing a script to print a few thousand pdf documents and I need
to have some control over the number of jobs that are sent to the
printer queue at time ... something along the lines of
if number_jobs > MAX_JOBS:
time.sleep(10)
else:
#Print More Files
I have been investi
Statesman wrote:
> In English:
>
> I don't know much about python and I won't have much time to learn much
> about it even if it seems powerful...
>
(snip code)
> Here is an error I get trying to run this script:
>
> AttributeError: 'string' object has no attribute 'index'
>
> According to me,
Hello,
I would like to store multiple dictionaries in a file, if possible one per
line. My code currently produces a new dictionary every iteration and
passes it on to another peace of code. In order to be able to re-run some
experiments at a later date I would like to store every dictionary in th
Statesman wrote in comp.lang.python:
Hi Statesman
comp.lang.python is the english-speaking Python forum. You may want to
try the french-speaking one at fr.comp.lang.python (xpost and fu2 set)
> Je connais mal python et n'est pas trop le temps de m'y plonger bien
> que cela semble être assez pui
[binarystar]
| Hi folks,
|
| I am writing a script to print a few thousand pdf documents and I need
| to have some control over the number of jobs that are sent to the
| printer queue at time ... something along the lines of
|
| if number_jobs > MAX_JOBS:
| time.sleep(10)
| else:
| #Print
Philipp H. Mohr wrote:
> Hello,
>
> I would like to store multiple dictionaries in a file, if possible one per
> line.
Why "one per line" ?
> My code currently produces a new dictionary every iteration and
> passes it on to another peace of code.
May this code rest in piece
> In order to be
I think Python works on fairly antique hardware, whatever
OS you use (as long as the OS works ok). You can get a DOS
version of Python 2.2 at http://www.caddit.net/ , but I don't
have any good suggestions for a UI then. This might work after
some tweaking: http://www.effbot.org/zone/console-index.h
I'd propose a pyparsing implementation, but you don't give us many
specifics. Is there any chance you could post some sample data, and
one or two of the regexps you are using for matching?
-- Paul
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for the information, I stumbled across that page yesterday. It
seems all the problems with this are solved. The executable works just
like the Python version. Now I have to come up with an algorithm to
parse through the output data to come up with the version numbers.
Thanks for all your
How so?
>>> import cPickle as cp
>>> f=open("/tmp/test.pck", "wb")
>>> cp.dump(dict(a=1), f)
>>> cp.dump(dict(b=1), f)
>>> f.close()
>>> f=open("/tmp/test.pck", "rb")
>>> cp.load(f)
{'a': 1}
>>> cp.load(f)
{'b': 1}
>>> cp.load(f)
Traceback (most recent call last):
File "", line 1, in ?
EOFError
Thank you for you answer.
> > I would like to store multiple dictionaries in a file, if possible one per
> > line.
>
> Why "one per line" ?
I agree with you that it sounds like nasty code :-) but there is a good
reason for doing it this way - I think. My code collects data (attributes)
of its cu
Rocco Moretti <[EMAIL PROTECTED]> wrote:
> So for Math you'd do something like:
>
> y = b + mx + cx^2
>
> (Where ^2 is a superscript 2)
>
> For Python it would be:
>
> y = b + m*x + c*x**2
>
> IIRC, for Forth it would be something like (please excuse the mistakes
> in operator notation
when I type sys.ps2 after import sys,
I got the message like:
Traceback (most recent call last):
File "", line 1, in -toplevel-
sys.ps2
AttributeError: 'module' object has no attribute 'ps2'
why does it happen?
--
http://mail.python.org/mailman/listinfo/python-list
Hello All,
Is there a way to know in a POP session of a message was seen (old) or not
(new)?
Thanks.
--
Miki Tebeka <[EMAIL PROTECTED]>
http://tebeka.bizhat.com
The only difference between children and adults is the price of
Steven Bethard wrote:
> John Machin wrote:
>
>> If "work" is meant to detect *all* possibilities of 'chunks' not
>> having been derived from 'text' in the described manner, then it
>> doesn't work -- all information about the positions of the whitespace
>> is thrown away by your code.
>>
>> For
You should be in interactive mode to see those, otherwise you get the
error
--
http://mail.python.org/mailman/listinfo/python-list
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote:
>Fuzzyman a écrit :
>> *Should* I in fact write :
>>
>> class foo(object):
>> def __init__(self, *args, **kwargs):
>> object.__init__(self)
>>
>> ?
>Nope.
And if you were to do so, surely:
class foo(object):
def __init__(self, *arg
Philipp H. Mohr wrote:
> I would like to store multiple dictionaries in a file, if possible one per
> line. My code currently produces a new dictionary every iteration and
> passes it on to another peace of code. In order to be able to re-run some
> experiments at a later date I would like to stor
I found dircmp compare only the direct dirs and files,
and it will not do anything to the sub-directories.
On 6/29/05, Michael Hoffman <[EMAIL PROTECTED]> wrote:
> could ildg wrote:
> > I want to compare 2 directories,
> > and find If all of theire sub-folders and files and sub-files are identical
[EMAIL PROTECTED] (Negroup) wrote:
> I was just asking if it is possible to "extend" string objects'
> behaviour so that it becomes possible to invoke something like
> 'anystring'.my_method().
You can't quite do that, but you can get close. You can define your own
class which inherits from str,
>
>
> Hello All,
>
> Is there a way to know in a POP session of a message was seen (old) or not
> (new)?
>
You have to keep a persistant local list of viewed messages , UID
into a text file is often the simplest method.
HTH :)
--
http://mail.python.org/mailman/listinfo/python-list
Terry Hancock wrote:
> http://www.logilab.org/projects/python-logic/
> This is something pretty new to me, so I can't comment on how well
> it would meet your expectations, but I see now that the site does mention
> OZ/Mozart as comparables.
I've used both, the logilab stuff is cool, but no where
bruno modulix wrote:
> Philipp H. Mohr wrote:
>>My code currently produces a new dictionary every iteration and
>>passes it on to another peace of code.
>
>
> May this code rest in piece
Perhaps it's the piece of code that passeth all understanding?
--
http://mail.python.org/mailman/listinfo
You can even get closer, but it is NOT recommended
class foostr(str):
def plural (self):
if self.value[-1] in "sz":
return self.value + "es"
else:
return self.value + "s"
#ugly hack
setattr(__builtins__, "str", foostr)
print str("apple").plural()
#
Miki Tebeka wrote:
> Is there a way to know in a POP session of a message was seen (old) or not
> (new)?
Define "seen". It could be interpreted as either "TOP" or "RETR" having
been executing for a message, or something like "this client has seen
this message before" ... not sure what you mean.
Nick Craig-Wood <[EMAIL PROTECTED]> wrote:
> In FORTH you don't generally use variables unless you really have to -
> that is what the stack is for
Exactly. Every language has its natural way of doing things. You can
usually bludgeon a language into doing things some other way, and newcomers
t
[John Machin]
|
| bruno modulix wrote:
| > Philipp H. Mohr wrote:
|
| >>My code currently produces a new dictionary every iteration and
| >>passes it on to another peace of code.
| >
| >
| > May this code rest in piece
|
| Perhaps it's the piece of code that passeth all understanding?
Th
Wed, 29 Jun 2005 08:33:58 -0700 skrev Scott David Daniels:
> Mandus wrote:
>> 29 Jun 2005 10:04:40 GMT skrev F. Petitjean:
>>
>>>Le Wed, 29 Jun 2005 09:46:15 + (UTC), Mandus a écrit :
>>>
>>>res = [ bb+ii*dd for bb,ii,dd in zip(b,i,d) ]
>>
>> seem to be a tad slower than the map, but nothing
In article <[EMAIL PROTECTED]>,
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> You can even get closer, but it is NOT recommended
>
> class foostr(str):
> def plural (self):
> if self.value[-1] in "sz":
> return self.value + "es"
> else:
> return se
QOTW: "And what defines a 'python activist' anyway? Blowing up Perl
installations worldwide?" - Ivan Van Laningham
"Floating point is about nothing if not being usefully wrong." - Robert Kern
Sibylle Koczian needs to sort part of a list. His first attempt made
the natural mistake - sort
You might want to take a look at the shelve module.
-Larry
Philipp H. Mohr wrote:
> Hello,
>
> I would like to store multiple dictionaries in a file, if possible one per
> line. My code currently produces a new dictionary every iteration and
> passes it on to another peace of code. In order to b
Negroup wrote:
> Hi all.
> I'm writing a simple Python module containing functions to process
> strings in various ways. Actually it works importing the module that
> contains the function I'm interested in, and calling
> my_module.my_function('mystring').
>
> I was just asking if it is possible t
if you please i want a help
im a beginner in using python
i want to know how can i run a GUI module
i installed python on windows platform
thanks [EMAIL PROTECTED] wrote:
Send Python-list mailing list submissions topython-list@python.orgTo subscribe or unsubscribe via the World Wide Web, visitht
nephish wrote:
[...]
>> Try the following from the shell (NOT the python shell):
>> mysql -u user -p
>> [Enter passwd]
>> mysql> show databases;
>>
>> If MyDB isn't in the list either something went wrong with the xampp
>> installation or the database for xampp got a different name. (I am no
>>
[Greg Miller]
|
| Thanks for the information, I stumbled across that page yesterday. It
| seems all the problems with this are solved. The executable
| works just
| like the Python version. Now I have to come up with an algorithm to
| parse through the output data to come up with the version n
Well, yes, it is kinda off topic, but very interesting...
Being myself an argentine with spanish as mother tongue and a very bad
English, it's hard foro me to tell the difference between accents. I can
hardly tell an Irish from an English...
But what I did tell is the broad range of different acc
Roy Smith wrote:
> In article <[EMAIL PROTECTED]>,
> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
>
>>You can even get closer, but it is NOT recommended
>>
>>class foostr(str):
>> def plural (self):
>>if self.value[-1] in "sz":
>>return self.value + "es"
>>els
#! rnews 2572
Newsgroups: comp.lang.python
Path:
news.xs4all.nl!newsspool.news.xs4all.nl!transit.news.xs4all.nl!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!attws2!ip.att.net!NetNews1!xyzzy!nntp
From: Harry George <[EMAIL PROTECTED]>
Subject: Re: Modules for inclusion in standard l
Simon Brunning schrieb:
> On 6/29/05, Christopher Arndt <[EMAIL PROTECTED]> wrote:
>
>
> Adding sqllite to the standard library has been discussed before:
> http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/fd150297c201f814
Yeah, but they didn't seem to have come to a con
#! rnews 2218
Newsgroups: comp.lang.python
Path:
news.xs4all.nl!newsspool.news.xs4all.nl!transit.news.xs4all.nl!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!attws2!ip.att.net!NetNews1!xyzzy!nntp
From: Harry George <[EMAIL PROTECTED]>
Subject: Re: Boss wants me to program
X-Nntp-Pos
Hey this is probally a noob question but here goes. . .How could I open the
command line inside of a python script? Would I have to use COM?
-Ivan
_
Dont just search. Find. Check out the new MSN Search!
http://search.msn.click
Hello,
this is the solution I went for, as I am indeed not concernt about
security and the implementation is straight forward.
Thank you,
Phil
> If you're not worried about security, you could write the repr() of each
> dict to the file and get the values back by using the eval() function.
> r
[Ivan Shevanski]
| Hey this is probally a noob question but here goes. . .How
| could I open the
| command line inside of a python script? Would I have to use COM?
(Assuming you're on Windows from your reference to COM).
Depending on exactly what you want to do with it, you could just do:
imp
Steven D'Aprano wrote:
> Speaking as an Australia, ...
> [snip]
> But don't worry, there is one thing we all agree on throughout the
> English-speaking world: you Americans don't speak English.
And lest you feel Steven's observation don't bear much weight, keep in
mind that he is speaking as an en
Graham Fawcett wrote:
> keep-your-stick-on-the-ice'ly yours,
Is that a Red Green reference? Man, I didn't think this could get any
more off-topic. :)
python-needs-more-duct-tape'ly yours,
Benji
--
http://mail.python.org/mailman/listinfo/python-list
"Björn Lindström" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> "F. Petitjean" <[EMAIL PROTECTED]> writes:
>
> > res = [ bb+ii*dd for bb,ii,dd in zip(b,i,d) ]
> >
> > Hoping that zip will not be deprecated.
>
> Nobody has suggested that. The ones that are planned to be removed are
What is the proper way to pass command line parameters to a python
script called from C++? I'm tryng this:
path = "c:\\someDir\\someScript.py param1 param2 param3";
PyRun_SimpleFile(PyFile_AsFile( PyFile_FromString( path, "r")),
"someScript.py");
I'm getting a "format error someScript.py, line 1"
On 2005-06-30, Luis M. Gonzalez <[EMAIL PROTECTED]> wrote:
> Well, yes, it is kinda off topic, but very interesting...
> Being myself an argentine with spanish as mother tongue and a
> very bad English, it's hard foro me to tell the difference
> between accents. I can hardly tell an Irish from an
There's a reprint this morning on slashdot of a 1984 review Byte did
on the brand-new Macintosh (executive summary: cool machine, needs
more memory). The first four software packages available for the new
machine?
MacWrite/MacPaint (they seem to count this as one package)
Microsoft Multiplan
Micr
On 30 Jun 2005 07:52:04 -0700
"Wesley Henwood" <[EMAIL PROTECTED]> wrote:
> What is the proper way to pass command line parameters to a python
> script called from C++? I'm tryng this:
Have you tried PySys_SetArgv?
> path = "c:\\someDir\\someScript.py param1 param2 param3";
> PyRun_SimpleFile(Py
Hi all,
I'm currently migrating an application
from a windows platform to linux.
I have somewhere a module which uses
embedded python: (a python script where I want to call some functions...)
// Initialize the python
library
Py_Initialize();
PyObject *pName = PyString_FromString("RASBa
If I had to choose one feature, I would like to see better support for
nested lexical scopes. However, I imagine this is no easy "trick" to
add to the language.
> I'm curious -- what is everyone's favorite trick from a non-python
> language? And -- why isn't it in Python?
--
http://mail.python.
Hi all,
Does Python have a random function? If so, can you show me an example
using it?
Thanks,
Nathan Pinno
http://www.npinnowebsite.ca/
--
Posted via UsenetRevolution.com - Revolutionary Usenet
** HIGH RETEN
Nathan Pinno wrote:
> Does Python have a random function? If so, can you show me an example
> using it?
http://docs.python.org/lib/module-random.html
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
could ildg wrote:
> I found dircmp compare only the direct dirs and files,
> and it will not do anything to the sub-directories.
The documentation for dircmp.report_full_closure() disagrees with you.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
That code works great, and is a tad bit cleaner than what I came up
with, thanks again.
--
http://mail.python.org/mailman/listinfo/python-list
Nathan Pinno said unto the world upon 30/06/2005 11:22:
>
> Hi all,
>
> Does Python have a random function? If so, can you show me an example
> using it?
>
> Thanks,
> Nathan Pinno
> http://www.npinnowebsite.ca/
>>> import random
>>> print "It took %s seconds to find the module name
Nathan Pinno wrote:
> Hi all,
>
> Does Python have a random function? If so, can you show me an example
>using it?
>
> Thanks,
> Nathan Pinno
> http://www.npinnowebsite.ca/
>
>
>
>
>
Take your pick:
In [5]: import random
In [6]: random.choice(range(10))
Out[6]: 2
In [7]: random.choice(ra
Hello,
I am embedding a python script in a C++ application. The script can be
called simultaneously from multiple threads.
What is the correct way to implement this situation:
1) Have unique python interpreter instantiations ( Py_Initialize() ) for
each thread.
2) Have one python interpreter
Sion Arrowsmith wrote:
> ... And if you were to do so, surely:
> class foo(object):
> def __init__(self, *args, **kwargs):
> super(foo, self).__init__(self)
>
> would be the preferred way to go?
>
Or, perhaps:
class foo(object):
def __init__(self, *args, **kwargs):
Well, depends on what you want to achieve :)
First, I don't think you can call Py_Initialize on many threads. You
have special function to initialise different interpreters on per-thread
basis.
However, the main problem is: do you want to share data across your
threads ? If the answer is 'no' the
On Thu, 02 Jun 2005 19:52:24 +0200, N. Volbers wrote:
> Thanks for taking care of it ;-)
I submitted patch #1230446 today which ought to fix the problem.
--
Lars Gustäbel
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
>
>
> Chung Leong wrote:
>> Isn't that an NP-complete problem or am I crazy?
>
> That makes it a more realistic challange, doesn't it?
>
> Suppose it was something simple, like calculating a
> minimal spanning tree. Every program would produce the
> same output. What k
On Wed, 29 Jun 2005, it was written:
> Rocco Moretti <[EMAIL PROTECTED]> writes:
>
>> Except that (please correct me if I'm wrong) there is somewhat of a
>> policy for not including interface code for third party programs which
>> are not part of the operating system.
>
> I've never heard of Pyt
On Wed, 29 Jun 2005, phil wrote:
>> Wow! How about a sextant? Simple device really. And a great practical
>> demonstration of trigonometry.
>
> Excellent idea, even found a few how to sites. We'll do it.
> Any others?
A ballista? For many years when i was a kid, my dad wanted to build a
ballist
Don wrote:
> I was thinking maybe you could use a genetic algorithm, where the fitness
> function would caluclate the amount of waste. I'm not very familar with how
> to implement this sort of thing, though.
This problem is well suited to the abilities of genetic algorithms, and
this would probab
1 - 100 of 228 matches
Mail list logo