Here is a shell command (MS-DOS):
debug\curve-fit input.txt output.txt
And here is a Python script that *should* do the same thing (and almost
does):
import os
inputfilename = 'input.txt'
outputfilename = 'output.txt'
inputfile = open(inputfilename,'r')
outputfile =
I'm having a problem with packages within packages. Here's an example:
foo/
foo/__init__.py: empty file
foo/sub/__init__.py:
from foo.sub.B import B
foo/sub/A.py:
class A:
pass
foo/sub/B.py
import foo.sub.A
class B(foo.sub.A):
pass
Some time ago I wrote a little program in Tcl/Tk that took the values
from 3 sliders and performed a calculation using these values. The
calculation was of course automatically repeated each time a slider was
moved.
It is proving most difficult in Python. How do I pass the .get() values
to my
Giovanni Bajo wrote:
I don't think I fully understand the reason why additional .pyd modules were
built into the .dll. OTOH, this does not help anyone, since:
The reason is simple: a single DLL is easier to maintain. You only need
to add the new files to the VC project, edit config.c, and be
Eric Huss wrote:
I'm having a problem with packages within packages. Here's an example:
foo/
foo/__init__.py: empty file
foo/sub/__init__.py:
from foo.sub.B import B
foo/sub/A.py:
class A:
pass
foo/sub/B.py
import foo.sub.A
class B(foo.sub.A):
On Fri, 05 Aug 2005 01:02:48 -0500, Andy Leszczynski
leszczynscyATnospam.yahoo.com.nospam wrote:
Robert Kern wrote:
Andy Leszczynski wrote:
Python 2.2/Unix
time.strftime(%T)
'22:12:15'
time.strftime(%X)
'22:12:17'
Python 2.3/Windows
time.strftime(%X)
'22:12:47'
Martin v. Löwis wrote:
I don't think I fully understand the reason why additional .pyd
modules were built into the .dll. OTOH, this does not help anyone,
since:
The reason is simple: a single DLL is easier to maintain. You only
need
to add the new files to the VC project, edit config.c,
Steven Bethard wrote:
The slice of s from i to j with step k is defined as the sequence of
items with index x = i + n*k such that 0 = n (j-i)/k.
This seems to contradict list behavior though.
range(10)[9:-1:-2] == []
No, both is correct. But we don't have to interpret the second slice
On Tue, 16 Aug 2005 08:03:58 -0400, Peter Hansen [EMAIL PROTECTED] wrote:
Tom Anderson wrote:
On Mon, 15 Aug 2005, Peter Hansen wrote:
Using '' instead of 'localhost' means bind to *all* interfaces, not
just the loopback one.
Doesn't '' mean 'bind to the *default* interface'?
What does
Bryan Olson wrote:
Steven Bethard wrote:
Well, I couldn't find where the general semantics of a negative stride
index are defined, but for sequences at least[1]:
The slice of s from i to j with step k is defined as the sequence of
items with index x = i + n*k such that 0 = n
On Sat, 20 Aug 2005 15:19:55 -0400, Roy Smith [EMAIL PROTECTED] wrote:
In article [EMAIL PROTECTED],
[diegueus9] Diego Andrés Sanabria [EMAIL PROTECTED] wrote:
Hello!!!
I want know if python have binary trees and more?
Python does not come with a tree data structure. The basic data
Thanks man, I'll definately take a look into this and hopefully port it
over and publish it.
Have a GREAT day
-Wes
--
http://mail.python.org/mailman/listinfo/python-list
Heh, so long as it works. Sorry for the delay, I've been away for a bit
;P Hope it's all owrking out
-Wes
--
http://mail.python.org/mailman/listinfo/python-list
Giovanni Bajo wrote:
FWIW, this just highlights how ineffecient your build system is. Everything
you
currently do by hand could be automated, including MSI generation.
I'm sure Martin would be happy to consider a patch to make the build
system more efficient. :)
I'm willing to write up
What is the difference between the two? Which on is better to use and why?
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Yoav wrote:
What is the difference between the two? Which on is better to use and why?
In Python 2.4, this is what's in re.py:
'''
Minimal re compatibility wrapper. See sre for documentation.
engine = sre # Some apps might use this undocumented variable
from sre import *
from sre import
Bryan Olson [EMAIL PROTECTED] writes:
seq[3 : -4]
we write:
seq[3 ; $ - 4]
+1
When square-brackets appear within other square-brackets, the
inner-most bracket-pair determines which sequence '$' describes.
(Perhaps '$$' should be the length of the next containing
bracket
John Machin wrote:
... AND it's about time that list is updated to include False explicitly
-- save nitpicking arguments about whether False is covered by
numeric zero of all types :-)
Done.
If I try:
f = open(blah.txt, r)
while (c = f.read(1)) != '':
# ... work on c
I
Reinhold Birkenfeld [EMAIL PROTECTED] writes:
Don't forget
for line in f:
for c in line:
# do stuff
As mentioned before, that's careless programming, since it can read
the whole file into memory if the file contains no newlines.
--
Steve M wrote:
I agree with you in part and disagree in part.
I don't see the point to making the distribution any smaller. 10MB for
the installer from python.org, 16MB for ActiveState .exe installer. How
is 5MB lightweight while 10MB isn't? The Windows XP version of Java
at java.com is 16+
I've tried embedding Python in a C app so that Threading is done in the
Python side.
In the simple example below, unless I uncomment the ALLOW_THREADS macros,
the Python thread does nothing until the C for-loop finishes.
My real-world example is a large C/Motif application - apart from
Thanks to all for the help.
--
http://mail.python.org/mailman/listinfo/python-list
Reinhold Birkenfeld wrote:
John Machin wrote:
... AND it's about time that list is updated to include False explicitly
-- save nitpicking arguments about whether False is covered by
numeric zero of all types :-)
Done.
Thanks -- those of us who actually read manuals salute you.
w
Michael Hoffman wrote:
FWIW, this just highlights how ineffecient your build system is.
Everything you currently do by hand could be automated, including
MSI generation.
I'm sure Martin would be happy to consider a patch to make the build
system more efficient. :)
Out of curiosity, was
I've been trying to use happydoc to document a source
tree that I'm working on. It does pretty much what I want,
except:
Version 2.1:
Creates a weird directory structure for the HTML pages
it generates -- they embed the full path to the working
copy of the sources, which,
Hello All,
I have a windows app (wxPython) that uses a C DLL (via SWIG).
The C DLL emits a lot of information using printf and I'd like to catch
this output and show it in the GUI.
How can I do this? (OS is winXP).
(The only option I see now is to do a -Dprintf=my_log_function
which I don't
and, in which case, the following case will happen:
if __name__!='__main__':
do_sth()
any help would be appreciated.
--
http://mail.python.org/mailman/listinfo/python-list
[Jorgen Grahn]
Neither C++ nor Python has tree structures in their standard
libraries. I assume that's because there is no single interface that
is proven to suit everybody's needs.
It is already easy writing tree constants using recursive tuples or
lists. To process simple trees in Python,
Miki Tebeka wrote:
Hello All,
I have a windows app (wxPython) that uses a C DLL (via SWIG).
The C DLL emits a lot of information using printf and I'd like to catch
this output and show it in the GUI.
How can I do this? (OS is winXP).
(The only option I see now is to do a
On 20 Aug 2005 22:53:42 -0700, Eric Lavigne [EMAIL PROTECTED] wrote:
Here is a shell command (MS-DOS):
debug\curve-fit input.txt output.txt
And here is a Python script that *should* do the same thing (and almost
does):
import os
inputfilename = 'input.txt'
outputfilename = 'output.txt'
http://www.python.org/doc/faq/programming.html#how-do-i-find-the-current-module-name
--
http://mail.python.org/mailman/listinfo/python-list
wen wrote:
and, in which case, the following case will happen:
if __name__!='__main__':
do_sth()
any help would be appreciated.
Sorry, but your question is rather difficult to interpret.
For a start, you don't need/want to import __main__.
On import, __name__ is set to the name of
Giovanni Bajo wrote:
FWIW, this just highlights how ineffecient your build system is. Everything
you
currently do by hand could be automated, including MSI generation. Also, you
describe the Windows procedure, which I suppose it does not take into account
what needs to be done for other OS.
Giovanni Bajo wrote:
I'm sure Martin would be happy to consider a patch to make the build
system more efficient. :)
Out of curiosity, was this ever discussed among Python developers? Would
something like scons qualify for this? OTOH, scons opens nasty
self-bootstrapping issues (being written
On Sunday 21 August 2005 07:37 am, Terry Hancock wrote:
I've been trying to use happydoc to document a source
tree that I'm working on.
[...]
Any suggestions on getting pydoc, happydoc, or yet another
documentation generator to do this, would be greatly appreciated.
Ah, well, it looks like
Martin v. Löwis wrote:
Out of curiosity, was this ever discussed among Python developers?
Would something like scons qualify for this? OTOH, scons opens nasty
self-bootstrapping issues (being written itself in Python).
No. The Windows build system must be integrated with Visual Studio.
Hello, everyone. I just began school, and they
already assigned us science fair. Since I'm in 8th
grade, I get to do demonstrations for our projects.
I'm probably going to demonstrate Python's networking
capabilities by writing a simple instant messenger
program. I only have a few problems:
Python lets me access module level variables from *anywhere*. All I
have
to do is add module name in front.
e.g.
mymodule.myvariable
Is this considered a 'global'? Or, does a 'global variable' have to be
accessible anywhere *without* a namespace in front?
(I'm not sure what proper academic
I could've sworn python had such a command, but now I can't find it...
I'm looking for an easy way to perform a UNIX-style touch, to
update the modification time of a file without actually modifying it.
I could do something (I imagine) like opening the file for appending
and then
On Unix, 'touch' is basically a wrapper around utime(2), available in python as
os.utime.
Jeff
pgpZb4MBupMDt.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
A shorter python program would be:
os.command(debug\\curve-fit input.txt output.txt)
I tried this program:
import os
os.command(debug\\curve-fit input.txt output.txt)
My error message is:
AttributeError: 'module' object has no attribute 'command'
I also could not find os.command in
How can I execute a program in windows on a remote pc, from both linux
and windows, using python (more-or-less) alone?
Any help would be GREATLY appreciated!
Bob
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 21 Aug 2005 13:41:14 -0400, Eric Lavigne [EMAIL PROTECTED]
wrote:
A shorter python program would be:
os.command(debug\\curve-fit input.txt output.txt)
I tried this program:
import os
os.command(debug\\curve-fit input.txt output.txt)
My error message is:
AttributeError:
rafi wrote:
William Gill wrote:
The tkinter text widget uses indexes to identify row:column offsets
within the text, but it seems counter intuitive to have to convert row
and column integers to a string like 0.1'. It's great that index can
take a string, but what about looping through
Martin v. Löwis wrote:
Can we at least undo this unfortunate move in time for 2.5? I would be
grateful
if *at least* the CJK codecs (which are like 1Mb big) are splitted out of
python25.dll. IMHO, I would prefer having *more* granularity, rather than
*less*.
If somebody would formulate a
The tkinter text widget uses indexes to identify row:column offsets
within the text, but it seems counter intuitive to have to convert row
and column integers to a string like 0.1'. It's great that index can
take a string, but what about looping through rows and columns? Am I
missing a way
import os
os.command(debug\\curve-fit input.txt output.txt)
I imagine thats was a typo for:
os.system(debug\\curve-fit input.txt output.txt)
Alan
That fixes it. Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
It's pretty hard to know what the problem is with the vague description
you've provided. Why not post your problem code or, if there's a lot
of it, create a small sample that has the problematic behaviour.
Better yet, post your message to [EMAIL PROTECTED]
cheers
S
--
or: (for long-running Win32 processes)
os.startfile(r'/relative/path/to/app')
http://docs.python.org/lib/os-process.html
under linux/BSD/solaris, i've run into situations where PATH and other
environmental var s aren't what you expect (they're from the
/etc/profile system defaults, not from
If i had started in 8th grade, I'd be Guido MartelliPeters by now!
Anyway, these people claim to have 125 tutorials, it'll take at least a
couple hours to work thru
http://www.awaretek.com/tutorials.html
--
http://mail.python.org/mailman/listinfo/python-list
Salve,
qualcuno sa se è ancora in fase di sviluppo e qual'è il sito di
riferimento?
Grazie
Danilo
--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
http://mail.python.org/mailman/listinfo/python-list
William Gill wrote:
The tkinter text widget uses indexes to identify row:column offsets
within the text, but it seems counter intuitive to have to convert row
and column integers to a string like 0.1'. It's great that index can
take a string, but what about looping through rows and
Thanks to everyone for pointing out my bone-headed errors :) I don't
*usually* make that sort of mistake...
What I'm attempting to do is create an implentation of the unification
algorithm. Now, its fairly straightforward to do unification on my own
custom types, all I have to do is define a
Eric Lavigne wrote:
Here is a shell command (MS-DOS):
debug\curve-fit input.txt output.txt
And here is a Python script that *should* do the same thing (and almost
does):
Python equivalent is roughly:
import os
import subprocess
danilo wrote:
Salve,
qualcuno sa se è ancora in fase di sviluppo e qual'è il sito di
riferimento?
Grazie
Danilo
Gesundheit.
--
http://mail.python.org/mailman/listinfo/python-list
Jorgen Grahn wrote:
On Sat, 20 Aug 2005 15:19:55 -0400, Roy Smith [EMAIL PROTECTED] wrote:
In article [EMAIL PROTECTED],
[diegueus9] Diego Andrés Sanabria [EMAIL PROTECTED] wrote:
Hello!!!
I want know if python have binary trees and more?
Python does not come with a tree data structure.
Giovanni Bajo wrote:
You seem to ignore the fact that scons can easily generate VS.NET projects.
I'm not ignoring it - I'm not aware of it. And also, I don't quite
believe it until I see it.
But there is no technical reason why it has to be so. I work on several
portable projects, and they
Why not? Because the regex isn't compiled?
Don't tell me not to do something, tell me why i should'nt do it.
--
http://mail.python.org/mailman/listinfo/python-list
Ron Adam wrote:
I would put the starting minimum boundary as:
1. The minimum required to start the python interpreter with no
additional required files.
Currently python 2.4 (on windows) does not yet meet that guideline, so
it seems some modules still need to be added while other
Hello!
Im newbie in Linux, I have instaled Ubuntu 5.04, but I couldt install
the wxPython 2.6.1, anybody help me??
For this reason I dont do my Job , because I use SpeIde and Boa
Constructor, and both dont run with the old v wxPython 2.5.3
Thanks in advance!!
--
Saludos / Best regards
Mario
On 21 Aug 2005 09:45:26 -0700
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Python lets me access module level variables from *anywhere*. All I
have
to do is add module name in front.
e.g.
mymodule.myvariable
Is this considered a 'global'? Or, does a 'global variable' have to
be
Sorry i am late getting back on this.
ord() is finally what is giving me what i wanted.
the vendor told me that what was comming in was an ascii string
representing hex characters. So i expected when i used the serial
module
that what i would be getting was something along the lines of 4A, 3D,
Talin a écrit :
(snip)
2) Is there an easy way to determine if a given object has a callable
method named unify?
if callable(getattr(obj, 'unify', None)):
# obj.unify exists and is callable
Br
--
http://mail.python.org/mailman/listinfo/python-list
Steve M wrote:
I agree with you in part and disagree in part.
I don't see the point to making the distribution any smaller. 10MB for
the installer from python.org, 16MB for ActiveState .exe installer. How
is 5MB lightweight while 10MB isn't? The Windows XP version of Java
at java.com is 16+
Paul Rubin wrote:
Reinhold Birkenfeld [EMAIL PROTECTED] writes:
Don't forget
for line in f:
for c in line:
# do stuff
As mentioned before, that's careless programming, since it can read
the whole file into memory if the file contains no newlines.
I agree that there may be
Sidd wrote:
Hello,
I want to write a thread in python which can be invoked for say 5
sec, within that the threads function would be to take input,is it
possible because i tried it and found that raw_input() is blocking
threads.
There isn't really a convenient solution to this problem,
Mark I have another question, and as of yet, have not found another
Mark discussion group for moinmoin, so sorry, but here goes:
Have you tried the mailing list [EMAIL PROTECTED] If you
are determined to read it via Usenet, try gmane:
http://dir.gmane.org/search.php?match=moin
Paul Rubin http://[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Chris Tavares [EMAIL PROTECTED] writes:
Is this normal behavior for urllib? Is there a way to force that initial
socket closed earlier? Is there something else I need to do?
I'd say open a sourceforge bug. There
Chris Tavares [EMAIL PROTECTED] writes:
Is there a way to do HTTP 1.1 with urllib? The docs say 0.9 and 1.0 only.
I'm not sure. Try urllib2, but I'm still not sure.
--
http://mail.python.org/mailman/listinfo/python-list
John Walton wrote:
Hello, everyone. I just began school, and they
already assigned us science fair. Since I'm in 8th
grade, I get to do demonstrations for our projects.
I'm probably going to demonstrate Python's networking
capabilities by writing a simple instant messenger
program. I
Martin v. Löwis wrote:
Ron Adam wrote:
I would put the starting minimum boundary as:
1. The minimum required to start the python interpreter with no
additional required files.
Currently python 2.4 (on windows) does not yet meet that guideline, so
it seems some modules still need to be
Ramza The goal, build python(mainly for win32) so that the ENTIRE
Ramza install is maybe less than 5MBs and includes possibly a GUI
Ramza library, possibly TwistedMatrix, possibly install from just
Ramza unzipping an archive like applications such as Eclipse.
...
Ramza
[EMAIL PROTECTED] wrote:
Sorry i am late getting back on this.
ord() is finally what is giving me what i wanted.
the vendor told me that what was comming in was an ascii string
representing hex characters. So i expected when i used the serial
module
that what i would be getting was something
hi,
Do you have a python lesson book in dutch version on your site?
greetz erik =)
--
http://mail.python.org/mailman/listinfo/python-list
42 wrote:
Thoughts? Still gaping holes?
Certainly. And rather than rehash them all here, I'm going to suggest
you check the comp.lang.python archives for any of the many past
discussions about this before you spend too much time thinking
(repeatedly) that you've nailed that one last hole
Does anyone know of any good documentation on these topics, doesn't look
like the official python tutorial covers them. Thanks in advance.
--
A wise man knows he knows nothing.
--
http://mail.python.org/mailman/listinfo/python-list
Kenneth McDonald wrote:
I could've sworn python had such a command, but now I can't find it...
I'm looking for an easy way to perform a UNIX-style touch, to update
the modification time of a file without actually modifying it. I could
do something (I imagine) like opening the file for
Amusingly, I was just perusing these links earlier today. Go go Firefox
history search!
http://www.python.org/2.2/descrintro.html
http://users.rcn.com/python/download/Descriptor.htm
--
http://mail.python.org/mailman/listinfo/python-list
danilo [EMAIL PROTECTED] writes:
Salve,
qualcuno sa se è ancora in fase di sviluppo e qual'è il sito di
riferimento?
Beh, tutto e' sempre in fase di sviluppo, non e' vero?
An Internet search turns up:
http://www.jamesh.id.au/software/pygimp
but the site was not responding when I tried
Dragonfly [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
hi,
Do you have a python lesson book in dutch version on your site?
Did you try to look? Either by using the search bar at the top of each
page or going to the documentation page http://www.python.org/doc/ where
there is a
On Sun, 21 Aug 2005 17:01:13 -0700, Jeffrey E. Forcier wrote:
Amusingly, I was just perusing these links earlier today. Go go Firefox
history search!
http://www.python.org/2.2/descrintro.html
http://users.rcn.com/python/download/Descriptor.htm
Are descriptors the same thing as decorators?
sysfault wrote:
Does anyone know of any good documentation on these topics, doesn't look
like the official python tutorial covers them. Thanks in advance.
PyCon 2005, PyCon 2004 and PyGTA November 2004 presentations here are
all on these topics:
http://www.vrplumber.com/programming/
sysfault wrote:
On Sun, 21 Aug 2005 17:01:13 -0700, Jeffrey E. Forcier wrote:
Amusingly, I was just perusing these links earlier today. Go go Firefox
history search!
http://www.python.org/2.2/descrintro.html
http://users.rcn.com/python/download/Descriptor.htm
Are descriptors the same
Christoph Rackwitz wrote:
Why not? Because the regex isn't compiled?
Don't tell me not to do something, tell me why i should'nt do it.
No it's not the regex, it's because you just spoiled the challenge for
everybody who hasn't solved level 10 yet...
--
can you explain about your problem ?
--- Mario Lacunza [EMAIL PROTECTED] menulis:
Hello!
Im newbie in Linux, I have instaled Ubuntu 5.04,
but
I couldt install
the wxPython 2.6.1, anybody help me??
For this reason I dont do my Job , because I use
SpeIde and Boa
phil hunt enlightened us with:
I thought it was the whole point of XMLRPC that the server can be
written in one language and the client in another. Am I wrong?
It is, but not all SOAP libs really support the standard.
Sybren
--
The problem with the world is stupidity. Not saying there should
Dragonfly enlightened us with:
Do you have a python lesson book in dutch version on your site?
I'd suggest learning English. The programming language is based on
English anyway. Besides, everybody in The Netherlands learns English
at school.
Sybren
--
The problem with the world is stupidity.
Sorry about that, I misread the original question. However, the
python.org link is still valid as it concerns metaclasses as well as a
handful of other topics.
--
http://mail.python.org/mailman/listinfo/python-list
km wrote:
is true parallelism possible in python ? or atleast in the coming versions ?
is global interpreter lock a bane in this context ?
I've had absolutely zero problems implementing truly parallel programs
in python. All of my parallel programs have been multiprocess
architectures,
Jorgen Grahn wrote:
More importantly, I think: it's not polite for a programming language to
make it hard to communicate with the rest of your environment.
Java pissed me off when I looked at it back in the 1990s, because I was on
Unix, and the language would barely give me access to the
Hello. It's me again. Thanks for all the help with
the Python Networking Resources, but does anyone know
what I'll need to know to write a paper on Network
Programming and Python. Like terminology and all
that. Maybe I'll have a section on socketets, TCP,
Clients (half of the stuff I don't even
In article [EMAIL PROTECTED], [EMAIL PROTECTED]
says...
42 wrote:
Thoughts? Still gaping holes?
Certainly. And rather than rehash them all here, I'm going to suggest
you check the comp.lang.python archives for any of the many past
discussions about this before you spend too much time
Hello!
I'm trying to associate a file extension to my wxPython script so that
all I have to do is double click on the file and my python script will
load up with the path of that file.
For instance, I've associated all .py files to be opened up with
emacs.exe. If I double click on a .py file,
Hello,
I'm trying to upload images to http://imageshac.us via a Python script.
I have looked at the POST request with HTTPLiveHeaders Firefox
extension when I upload an image, but I can't figure what's wrong. (if
I disable the cookies in the browser, it still works, so it's not
that).
When I
I forgot to add that I'm behind a proxy, but I think that is
irrelevant.
If you are not behind a proxy replace this line:
print post_multipart('proxy-a.mains.nitech.ac.jp', 8080,
'http://imageshack.us/index.php', params, files)
with
print post_multipart('imageshack.us', 80, '/index.php',
Clearly, Pyton does not directly offer any kind of useful security sandbox
capability, but since Java does, I suppose JPython is an option. I know there
are a lot of downsides to JPython, but it should be a genuine solution to the
sandbox problem.
On Sat, 20 Aug 2005 10:21:06 GMT, 42 [EMAIL
Bugs item #1242657, was opened at 2005-07-21 17:22
Message generated for change (Comment added) made by rhettinger
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1242657group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1191043, was opened at 2005-04-27 16:34
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1191043group_id=5470
Please note that this message will contain a full copy of the comment
98 matches
Mail list logo