Sorin Schwimmer wrote:
I am thinking on something in the following form:
code
import time
import thread
delay=True
def fn()
global delay
time.sleep(your_amount_of_time_in_seconds)
delay=False
thread.start_new_thread(fn,())
while delay:
statement 1
statement 2
...
I'm in the the process of designing a build system written in python.
It runs from a central server with various build machines hosting
server processes, written in Python. Pyro is the chosen RPC mechanism.
What I would like to do is have the system update itself on demand. In
other words, pass
If compiling a SWIG wrapper with MinGW 3.2.3 (Windows) get the
following compilation error:
pyprog_wrap.cxx: In function `int
SWIG_Python_ConvertFunctionPtr(PyObject*,
void**, swig_type_info*)':
pyprog_wrap.cxx:2051: invalid conversion from `const char*' to `char*'
Extract from wrapper:
/*
Ray wrote:
Since I haven't used Python at work, I am using Python 2.5 right now.
However I wonder, how fast are you guys moving from version to version
at work? As an illustration my ex-company just moved to Java 5, which
was released around... what, 2-3 years ago? (While I am running Java 6
Jeremy Sanders wrote:
Janto Dreijer wrote:
I want to measure the packet delivery delays over various network
links. For this I need to synchronise the times of the sender and
receiver, either against NTP or eachother.
Couldn't you just use NTP itself to get the delivery delay? You can
alex23 wrote:
Chaos wrote:
I am looking for ways to have a Desktop Alert, like the one most IM
Messengers have (MSN, AIM) at the lower right above the taskbar. Can
anyone point me to the right resources to use?
Under Windows, they're called balloon tips. Here's a thread from a
few years
r1pp3r wrote:
What I would like to do is have the system update itself on demand. In
other words, pass pickled objects (the code comprising the server) down
the pipeline to the server, have them copied to the right place, and
then restart the server which can then invoke the new code.
should
[EMAIL PROTECTED] wrote:
Hey people!
For the first time I'm doing a client/server application, and I'm
really confused with IPC stuff.
[...]
Any suggestions?
http://pyro.sourceforge.net
depending on your needs
--Irmen
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I use RedHat linux.
How can I find where exactly the current python script is running?
I use this code:
#test.py
import os,sys
print sys.argv
os.chdir(os.path.dirname(sys.argv[0]))
It doesn't work when I run this command from the directory that
test.py is located:
python test.py
That
c.l.p-
I am undertaking writing an installer for a software package using
Python. It is exclusively for Linux. Because this is an installer and
has to run on numerous Linux distros, it is presenting some unique
challenges.
First off, I have begun this project by writing a text mode only
I'm trying to make the wsdl asociated with this sample but I cannot make it workimport SOAPpydef doUpper(word): return word.upper()server = SOAPpy.SOAPServer((, 8000))
server.registerFunction(doUpper)server.registerFunction(who)server.serve_forever()can anyone tell me how to do this?anyone who
Janto Dreijer wrote:
Jeremy Sanders wrote:
Janto Dreijer wrote:
I want to measure the packet delivery delays over various network
links. For this I need to synchronise the times of the sender and
receiver, either against NTP or eachother.
Couldn't you just use NTP itself to get
Hello,
I have a csv file which is has a field that has something like:
text.csv
text (xxx)
text (text) (yyy)
text (text) (text) (zzz)
I would like to split the last '(text)' out and put it in a new column,
so that I get:
new_test.csv
text,(xxx)
text (text),(yyy)
text (text) (text),(zzz)
how
Bruno Desthuilliers wrote:
Paul Boddie wrote:
Ray wrote:
(snip)
We're a Java shop so
our developers are trained in Java, Struts, Tomcat, etc. Any switch to
a dynamic language will be a huge change. However it baffles me that
they are open to at least a PoC in Rails. but when I
Thanks everyone for you thoughtful replies...
And yes Simon you are right... I do need to learn how to read
'tracebacks' (and de-bugging tools in general)... but you are the first
person to give me a step-by-step explination, thank you.
And LOL you all caught my dropped single-quote ;-)
but
Gabriel Genellina schrieb:
At Tuesday 29/8/2006 07:50, Joachim Durchholz wrote:
Wikipedia says it's going from 2NlogN to N. If a sort is massively
dominated by the comparison, that could give a speedup of up to 100%
(approximately - dropping the logN factor is almost irrelevant, what
counts
Norman Khine wrote:
Hello,
I have a csv file which is has a field that has something like:
text.csv
text (xxx)
text (text) (yyy)
text (text) (text) (zzz)
I would like to split the last '(text)' out and put it in a new column,
so that I get:
new_test.csv
text,(xxx)
text
Is there such a thing as a special version of python that I can run
more efficiently from a flash drive? I'll be at college for hours
every day with hours of free time for the next few months, but the only
computers at my disposal are windows PCs that use GoBack to auto-revert
every reboot. So
Adam Jones wrote:
Bruno Desthuilliers wrote:
Paul Boddie wrote:
Ray wrote:
(snip)
We're a Java shop so
our developers are trained in Java, Struts, Tomcat, etc. Any switch to
a dynamic language will be a huge change. However it baffles me that
they are open to at least a PoC in Rails. but
Hello Max,
How can I find where exactly the current python script is running?
...
That means sys.argv[0] doesn't always contain the full path of
running script.
sys.path[0] is the script directory, combined with sys.argv[0] you can
find the full path to the script.
(Note that in some rare
I am trying to pull all my information from outlook calendar so I can send
calendar information to my phone via email. I have created a python script
that will gather Outlook Calendar information and display it. I am new to
python and this is something that I am working on so I can get
Fredrik Lundh [EMAIL PROTECTED] writes:
why are you trying to reinvent doctest ?
The OP asked for unit test. This could be read that
the OP wants to use module unittest.
http://docs.python.org/lib/doctest-unittest-api.html
Ahh, that's good to know that doctests can be
integrated into
How can I find where exactly the current python script is running?
...
That means sys.argv[0] doesn't always contain the full path of
running script.
sys.path[0] is the script directory, combined with sys.argv[0] you can
find the full path to the script.
(Note that in some rare cases
Chaos wrote:
alex23 wrote:
Chaos wrote:
I am looking for ways to have a Desktop Alert, like the one most IM
Messengers have (MSN, AIM) at the lower right above the taskbar. Can
anyone point me to the right resources to use?
I get these alerts from gmail-notify. It's for linux, but a
any ideas on how to block a network port from being used, or one that
is currently in use? For example, say I want to block port 23 from
being used. by used, I mean allowing connections to or from it.
thanks in advance.
--
http://mail.python.org/mailman/listinfo/python-list
[Joachim Durchholz]
Wikipedia says it's going from 2NlogN to N. If a sort is massively
dominated by the comparison, that could give a speedup of up to 100%
(approximately - dropping the logN factor is almost irrelevant, what
counts is losing that factor of 2).
[Gabriel Genellina]
In fact
This is sort of a feature request/idea: Chaining generators.
If you have two lists (or tuples) and you add them, the result is a
concatenation of the two.
I think it would be nice if it was possible to do something similar with
generators. The best way to explain is by code example:
def
Tim Peters schrieb:
[Joachim Durchholz]
Wikipedia says it's going from 2NlogN to N. If a sort is massively
dominated by the comparison, that could give a speedup of up to 100%
(approximately - dropping the logN factor is almost irrelevant, what
counts is losing that factor of 2).
[Gabriel
Hi,
We're happy to announce version 2.1.2 of Wing IDE, an advanced
development environment for the Python programming language.
This is a bugfix release that improves support for Python 2.5
(2.5c1 is required) and fixes a number of bugs. The release
can be downloaded from:
On Tue, 29 Aug 2006 22:41:37 +0300, John Doe [EMAIL PROTECTED] wrote:
This is sort of a feature request/idea: Chaining generators.
If you have two lists (or tuples) and you add them, the result is a
concatenation of the two.
I think it would be nice if it was possible to do something similar with
John Doe wrote:
This is sort of a feature request/idea: Chaining generators.
If you have two lists (or tuples) and you add them, the result is a
concatenation of the two.
I think it would be nice if it was possible to do something similar with
generators. The best way to explain is by code
Putty wrote:
Is there such a thing as a special version of python that I can run
more efficiently from a flash drive?
google for movable python (or similar)
--
Maciej Fiedzia Dziardziel ([EMAIL PROTECTED])
In the land of the blind, the one eyed man is king.
--
At Tuesday 29/8/2006 16:41, John Doe wrote:
This is sort of a feature request/idea: Chaining generators.
If you have two lists (or tuples) and you add them, the result is a
concatenation of the two.
I think it would be nice if it was possible to do something similar with
generators. The best
Cliff Wells wrote:
On Wed, 2006-08-23 at 22:13 +0200, Peter Maas wrote:
Alex Martelli wrote:
[...]
I have already suggested to the BDFL that he can remedy this situation
in Py3k: all he has to do, of course, is to add a LOT more keywords.
Here is another remedy: he adds one of the frameworks
[EMAIL PROTECTED] wrote:
Here is another remedy: he adds one of the frameworks to the standard
library :)
Peter Maas, Aachen
But there are already 3 ;-)
http://docs.python.org/lib/module-BaseHTTPServer.html
http://docs.python.org/lib/module-SimpleHTTPServer.html
Bruno Desthuilliers wrote:
It's usually possible to modify third-parts classes behaviour on the fly
(googling for 'monkey-patching' should get you started). But true, this
doesn't work with builtins.
I guess this stems from the fact that Python dictionaries
are C creatures and they are
Grant Edwards wrote:
This is a _Microsoft_Product_. There doesn't have to be a
reason for something to be done in a half-assed manner.
No, it is a quantum effect. If the energy of a clock has a
lower bound, there must be a nonzero probability for it to
run backwards.
See [EMAIL PROTECTED]
Bruno Desthuilliers wrote:
Sam Pointon a écrit :
Bruno Desthuilliers wrote:
foo = lambda thing: thing and thing + 1 or -1
The and ... or trick is buggy (what if thing == -1?)
Yes, true - Should be:
foo2 = lambda t: t != -1 and (t and t+1 or -1) or 0
Actually, the common
abcd wrote:
any ideas on how to block a network port from being used, or one that
is currently in use? For example, say I want to block port 23 from
being used. by used, I mean allowing connections to or from it.
thanks in advance.
This is not really a Python question. Blocking ports is
You could always get an mp3 player that windows
can see as a drive letter. I'll bet the I/O
would be quite fast. Plus, you would be
getting an mp3 player.
If money is a concern, check out used ones
on ebay.
Putty wrote:
Is there such a thing as a special version of python that I can run
Jorge Vargas wrote:
On 28 Aug 2006 15:50:57 -0700, John Machin [EMAIL PROTECTED] wrote:
Jorge Vargas wrote:
On 8/28/06, Johanna Pfalz [EMAIL PROTECTED] wrote:
To be more specific, I'm interested in reading in certain rows and
columns
from an excel spreadsheet directly without
I need compile code written in Python. I use Windows 98SE. Should I
download Python for Windows installer?
http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi
Will the msi installer modify registry or other system files? Does it
possible install Python not touching registry and system files?
[Joachim Durchholz]
Wikipedia says it's going from 2NlogN to N. If a sort is massively
dominated by the comparison, that could give a speedup of up to 100%
(approximately - dropping the logN factor is almost irrelevant, what
counts is losing that factor of 2).
[Gabriel Genellina]
In fact
Tim Chase wrote:
Norman Khine wrote:
Hello,
I have a csv file which is has a field that has something like:
text.csv
text (xxx)
text (text) (yyy)
text (text) (text) (zzz)
I would like to split the last '(text)' out and put it in a new column,
so that I get:
new_test.csv
Hello Pythoneers:
I would like to ask you a simple question:
Are you satisfied by SOAPpy module?
Actually, I use this module since a year and i immediately found it very
well-implemented, corresponding to dynamic meta-data discovering
nature of SOAP/WSDL.
BUT i read sometimes threads saying
Travis E. Oliphant wrote:
The 4th beta release of NumPy 1.0 has just been made available.
NumPy 1.0 represents the culmination of over 18 months of work to unify
the Numeric and Numarray array packages into a single best-of-breed
array package for Python.
NumPy supports all the features of
Putty wrote:
Is there such a thing as a special version of python that I can run
more efficiently from a flash drive? I'll be at college for hours
every day with hours of free time for the next few months, but the only
computers at my disposal are windows PCs that use GoBack to auto-revert
Tim Chase wrote:
Norman Khine wrote:
Hello,
I have a csv file which is has a field that has something like:
text.csv
text (xxx)
text (text) (yyy)
text (text) (text) (zzz)
I would like to split the last '(text)' out and put it in a new
column, so that I get:
new_test.csv
text,(xxx)
Anthra Norell wrote:
Dexter,
I looked at the format specification. It contains an example:
---
CsoundSynthesizer;
; test.csd - a Csound structured data file
CsOptions
-W -d -o tone.wav
/CsOptions
CsVersion;optional section
[EMAIL PROTECTED] wrote:
Travis E. Oliphant wrote:
The 4th beta release of NumPy 1.0 has just been made available.
NumPy 1.0 represents the culmination of over 18 months of work to unify
the Numeric and Numarray array packages into a single best-of-breed
array package for Python.
NumPy
tobiah wrote:
Of course, fixing the csv file takes a little more work. It sounds like the
test lines given were just one of the fields, and there are
the quotes to worry about.
[snip]
But then this fails if there are commas in the
data. I could split and join on ',' but then
that fails
IMHO you're better off avoiding all this... It makes the code
unnecessarily complicated when you're not sure if this is a performance
bottleneck or not...
Common advice is to write the code as simple as possible first, then go
back and optimize as needed using the profiler. This is where
Norman Khine:
I have a csv file which is has a field that has something like:
text (xxx)
text (text) (yyy)
text (text) (text) (zzz)
I would like to split the last '(text)' out and put it in a new column,
so that I get:
text,(xxx)
text (text),(yyy)
text (text) (text),(zzz)
Maybe
At Tuesday 29/8/2006 20:31, tobiah wrote:
I have a csv file which is has a field that has something like:
But then this fails if there are commas in the
data. I could split and join on ',' but then
that fails when 'x' is either the first or last field.
Are there tools in the csv module that
[EMAIL PROTECTED] wrote:
Anthra Norell wrote:
Dexter,
I looked at the format specification. It contains an example:
---
CsoundSynthesizer;
; test.csd - a Csound structured data file
CsOptions
-W -d -o tone.wav
/CsOptions
tobiah wrote:
def foo(thing):
if thing:
return thing + 1
else:
return -1
def foo(thing):
if thing:
return thing + 1
return -1
Obviously both do the same thing. The first is
possibly clearer, while the second is more
Dennis Lee Bieber wrote:
On Tue, 29 Aug 2006 18:17:47 +0530, km [EMAIL PROTECTED]
declaimed the following in comp.lang.python:
##code start ##
import subprocess as sp
x = 'GSQIPSHYWKKNLWYYSHEIDGGCHNMW'
p0 = sp.Popen([echo,x], stdout=sp.PIPE)
Why use this at all?
p1 =
Is it possible to change the value of a variable in the outer function
if you are in a nested inner function?
For example:
def outer():
a = outer
def inner():
print a
a = inner
# I'm trying to change the outer 'a' here,
# but this
Robert Kern wrote:
[EMAIL PROTECTED] wrote:
Travis E. Oliphant wrote:
The 4th beta release of NumPy 1.0 has just been made available.
NumPy 1.0 represents the culmination of over 18 months of work to unify
the Numeric and Numarray array packages into a single best-of-breed
array
[EMAIL PROTECTED] wrote:
Is it possible to change the value of a variable in the outer function
if you are in a nested inner function?
The typical kludge is to wrap the variable in the outer function inside
a mutable object, then pass it into the inner using a default argument:
def outer():
Fredrik Lundh wrote:
http://www.catb.org/~esr/faqs/smart-questions.html#writewell
/F
and /F means?
--
http://mail.python.org/mailman/listinfo/python-list
alf wrote:
Fredrik Lundh wrote:
http://www.catb.org/~esr/faqs/smart-questions.html#writewell
/F
and /F means?
It's his signature.
--
Robert Kern
I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as
Gallagher, Tim (NE) wrote :
import win32com.client
import time
import datetime
outlook = win32com.client.Dispatch(Outlook.Application)
namespace = outlook.GetNamespace(MAPI)
appointments = namespace.GetDefaultFolder(9).Items
#print appointments.count
x = 4 # This is a number for one of
David Isaac wrote:
I'm aware of
http://cheeseshop.python.org/pypi/pytnef/
but it uses the tnef utility, and I'd like a pure Python solution
(along the lines of http://www.freeutils.net/source/jtnef/ ).
Is there one?
Thanks,
Alan Isaac
A place I once worked at had a project that included
Simon Forman wrote:
David Isaac wrote:
I'm aware of
http://cheeseshop.python.org/pypi/pytnef/
but it uses the tnef utility, and I'd like a pure Python solution
(along the lines of http://www.freeutils.net/source/jtnef/ ).
Is there one?
Thanks,
Alan Isaac
A place I once worked at had
Is this discouraged?:
for line in open(filename):
do something with line
That is, should I do this instead?:
fileptr = open(filename)
for line in fileptr:
do something with line
fileptr.close()
Can I count on the ref count going to zero to close the file?
Peter Maas [EMAIL PROTECTED] wrote:
Cliff Wells wrote:
On Wed, 2006-08-23 at 22:13 +0200, Peter Maas wrote:
Alex Martelli wrote:
[...]
I have already suggested to the BDFL that he can remedy this situation
in Py3k: all he has to do, of course, is to add a LOT more keywords.
Here is
Dan [EMAIL PROTECTED] writes:
Is this discouraged?:
for line in open(filename):
do something with line
Yes.
Can I count on the ref count going to zero to close the file?
You really shouldn't. It's a CPython artifact.
I understand that the upcoming 'with' statement will
Larry Bates wrote:
This is not really a Python question. Blocking ports is a function
of your firewall solution.
ok, no of any python solutions? or command-line firewalls?
--
http://mail.python.org/mailman/listinfo/python-list
Chaz Ginger wrote:
Chaz Ginger wrote:
glenn wrote:
hi - Im quite new to python, wondering if anyone can help me understand
something about inheritance here. In this trivial example, how could I
modify the voice method of 'dog' to call the base class 'creatures'
voice method from with
Bruno Desthuilliers wrote:
glenn wrote:
hi - Im quite new to python, wondering if anyone can help me understand
something about inheritance here. In this trivial example, how could I
modify the voice method of 'dog' to call the base class 'creatures'
voice method from with in it?
abcd wrote:
ok, no of any python solutions? or command-line firewalls?
You did try searching Google for python firewall, right?
http://www.google.com.au/search?q=python+firewall
The very first entry is a pointer to a solution for Windows.
You really need to provide more information if you
abcd wrote:
Larry Bates wrote:
This is not really a Python question. Blocking ports is a function
of your firewall solution.
ok, no of any python solutions? or command-line firewalls?
So now you're question is how to write a firewall in python?
You can probably bind to all the ports
Hi Roberto
If you want dog.voice() to just print voice: bark, you just have to omit
the voice method for the dog class: it will be inherited from creature.
I would have thought this would be correct, but in this case, plus in
others im playin with, I get this issue:
---
Paul Rubin wrote:
Dan [EMAIL PROTECTED] writes:
Is this discouraged?:
for line in open(filename):
do something with line
Yes.
Well, not what I wanted to hear, but what I expected.
Thanks,
Dan
--
dedded att verizon dott net
--
Paul Rubin wrote:
Dan [EMAIL PROTECTED] writes:
Is this discouraged?:
for line in open(filename):
do something with line
Yes.
Can I count on the ref count going to zero to close the file?
You really shouldn't. It's a CPython artifact.
I disagree, somewhat. No, you
[EMAIL PROTECTED] [EMAIL PROTECTED] writes:
I disagree, somewhat. No, you shouldn't count on the ref count per
se going to 0. And you shouldn't count on the file object being GC'd
_immediately_ after the last reference is destroyed. You should be able
to rely on it being GC'd at some point
[EMAIL PROTECTED] wrote:
I am undertaking writing an installer for a software package using
Python. It is exclusively for Linux. Because this is an installer and
has to run on numerous Linux distros, it is presenting some unique
challenges.
I had the same problem to solve as you, and I hope,
glenn [EMAIL PROTECTED] writes:
Bruno Desthuilliers wrote:
It might be better to use newstyle classes if you can. Also, the
convention is to use CamelCase for classes names (unless you have
a strong reason to do otherwise).
Note that this style is more correctly called TitleCase, since
Hi,
Is there a proper way for C code to ensure that the GIL is released? I
know about PyGILState_Ensure and PyGILState_Release, but that is to
ensure the GIL is acquired. I have some extension code that does heavy
processing and I want to release the GIL, but the code can't be sure
that the
On Wed, 30 Aug 2006 14:22:16 +1000, Ben Finney [EMAIL PROTECTED] wrote:
glenn [EMAIL PROTECTED] writes:
Bruno Desthuilliers wrote:
It might be better to use newstyle classes if you can. Also, the
convention is to use CamelCase for classes names (unless you have
a strong reason to do
Martin v. Löwis [EMAIL PROTECTED] wrote:
In any case, somebody pointed you to the Unicode code blocks. I think
these are Asian scripts (I may have missed some):
0530..058F; Armenian
0590..05FF; Hebrew
...
This is a fabulously useful list, Martin. Did you get this from a web
page? Can you tell
Fraggle69 [EMAIL PROTECTED] wrote:
Does anyone have any idea of how I can use Python to get images from my
firewire camera??
I am using python under winXP pro
You can try http://videocapture.sourceforge.net. The web page focuses on
USB webcams, but if it's using a standard XP interface
Dan wrote:
Is this discouraged?:
for line in open(filename):
do something with line
That is, should I do this instead?:
fileptr = open(filename)
for line in fileptr:
do something with line
fileptr.close()
depends on the use case; in a small
Claudio Grondi wrote:
Sometimes it is known in advance, that the time spent in a loop will be
in order of minutes or even hours, so it makes sense to optimize each
element in the loop to make it run faster.
One of instructions which can sure be optimized away is the check for
the break
Tim Peters wrote:
OTOH, current versions of Python (and Perl)
just curious, but all this use of ( Perl) mean that the Perl folks have
implemented timsort ?
/F
--
http://mail.python.org/mailman/listinfo/python-list
Bugs item #1545696, was opened at 2006-08-24 00:07
Message generated for change (Comment added) made by rupole
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1545696group_id=5470
Please note that this message will contain a full copy of the comment
101 - 187 of 187 matches
Mail list logo