Lonnie Princehouse wrote:
So far, we've been using the key parameter of list.sort. If you want
sort criteria more complicated than a single attribute, you can sort
based on a custom comparison function.
Actually, the key= parameter can do anything the cmp= parameter can:
class Key(object):
Skip Montanaro wrote:
...
I'm not sure why the mmap() solution is so much slower for you. Perhaps on
some systems files opened for reading are mmap'd under the covers. I'm sure
it's highly platform-dependent. (My results on MacOSX - see below - are
somewhat better.)
Let me return to your
Thanks Larry and Diez. I figured that doing
'GUIs over the web' would probably not work.
Where I work, we have a bunch of numerical
weather-prediction-type models that take
several hours to run. By having a cron job
copy over the output, I think I can still
implement a type of progress bar using
On Thu, 28 Apr 2005 10:34:44 -0700, demon_slayer2839 wrote:
Hey yall,
I'm new to Python and I love it. Now I can get most of the topics
covered with the Python tutorials I've read but the one thats just
stumping me is Object Orientation. I can't get the grasp of it. Does
anyone know of a
Jeremy Bowers wrote:
As you try to understand mmap, make sure your mental model can take into
account the fact that it is easy and quite common to mmap a file several
times larger than your physical memory, and it does not even *try* to read
the whole thing in at any given time. You may
Matt wrote:
Interesting - this displays correctly when I run the above code from
a
python shell. However, when I run it as a superkaramba theme (which
is
a wrapper interface to some kde functions, but allegedly passes
straight python functions direct to the python interpreter), it shows
up
Hi there,
I am new to this so I apologize in advance if I am not following the
right etiquette or something...
I am working on a project for school. My partner has written a
short program in Python which takes 2 arguments - the name of a .mov
file and a number which represents the number of
Donald L McDaniel wrote:
3) Since Lucifer is an angel, he does not engage in sexual relations.
(Christ tells us that angels don't engage in sexual relations by His Own
Words.)
Maybe you should take time to stop posting this inane drivel and do some
studying pertaining to the Nephilim.or
If you use ssh, then you must to learn 'scp'. Or buy books about
programming ;)
--
http://mail.python.org/mailman/listinfo/python-list
Robin Becker wrote:
Skip Montanaro wrote:
..
I'm not sure why the mmap() solution is so much slower for you.
Perhaps on
some systems files opened for reading are mmap'd under the covers.
I'm sure
it's highly platform-dependent. (My results on MacOSX - see below - are
somewhat better.)
Jeremy Bowers wrote:
.
As you try to understand mmap, make sure your mental model can take into
account the fact that it is easy and quite common to mmap a file several
times larger than your physical memory, and it does not even *try* to read
the whole thing in at any given time. You may
Skip Montanaro wrote:
.
Let me return to your original problem though, doing regex operations on
files. I modified your two scripts slightly:
.
Skip
I'm sure my results are dependent on something other than the coding style
I suspect file/disk cache and paging operates here. Note that we
safetyChecker = re.compile(r^[-\[\]0-9,. ]*$)
..doesn't the dot (.) in your character class mean that you are allowing
EVERYTHING (except newline?)
(you would probably want \. instead)
/Simon
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I'm currently using python 2.3.4 and I'm having problem with the logging module.
Occasionally when logging something with exc_info=True it just hangs, nothing is
logged, and software cannot continue executing.
By drilling down into logging package and adding rather many print statements
Paul Miller wrote:
I note the documentation for InteractiveConsole, which is implemented in
Python. Is there any example code for using this from within C/C++ code
to emulate the command-line interpreter inside a GUI app?
I've gotten my text edit widget to send InteractiveConsole strings to
run
I'm pleased to announce the twenty-fourth development release of PythonCAD,
a CAD package for open-source software users. As the name implies,
PythonCAD is written entirely in Python. The goal of this project is
to create a fully scriptable drafting program that will match and eventually
exceed
Hi,
The following are differences of solar declinations
from one day to the next, (never mind the unit). Considering the inertia of a
planet, any progress of (apparent) celestial motion over regular time intervals
has to be highly regular too, meaning that a plot cannot be jagged. The data
Every time I think I understand unicode, I prove I don't.
I created a variable in interactive mode like this:
s = u'ä'
where this character is the a-umlaut
that worked alright. Then I encoded it like this:
s.encode( 'latin1')
and it printed out a sigma (totally wrong)
then I typed this:
The Great 'monkey' uttered these words on 4/28/2005 2:09 PM:
I just learn to make a blank windows frame with python and wxpython. I found
the statment import wx cannot work as the original from wxPython.wx
import *. I see in the readme file of wxpython that if I install it as the
default one, I
Likewise, the above is basically just an inefficient way of writing:
def date_key(book):
return book.data
def author_and_date_key(book):
return (author_key(book), date_key(book))
It's certainly more elegant, but I wanted to talk about the mechanics
of comparison functions =)
I
The Great '[EMAIL PROTECTED]' uttered these words on 4/28/2005
1:34 PM:
Hey yall,
I'm new to Python and I love it. Now I can get most of the topics
covered with the Python tutorials I've read but the one thats just
stumping me is Object Orientation. I can't get the grasp of it. Does
anyone know
On 27 Apr 2005 23:32:15 -0700, poisondart [EMAIL PROTECTED] wrote:
Is there a way to dynamically generate temporary files (such as an
html, xml or text file) in Python?
I'm not sure if I'm explaining myself clearly as I've no clue how to
describe this mechanism. I've seen it on certain
steve.leach wrote:
python -o foo.exe foo.py
at the command line, and get an executable, without any further effort.
Hence making the resulting program useless to users of most operating
systems.
In close sourced development, which most corporates may prefer, yes, the
resulting program is
[EMAIL PROTECTED] wrote:
So how do I tell what encoding my unicode string is in, and how do I
retrieve that when I read it from a file?
In interactive mode, you best avoid non-ASCII characters in a Unicode
literal.
In theory, Python should look at sys.stdin.encoding when processing
the
Which version of wxPython are you running? What do you mean by does not
work...does the import fail or is your code giving errors?
It is the current new version 2.6. The error message said that the class
wxApp is not defined...
But when using the default from wxPython.wx import *, it works.
python -o foo.exe foo.py
Is that a real command that can be use?
--
http://mail.python.org/mailman/listinfo/python-list
The Great 'monkey' uttered these words on 4/28/2005 5:30 PM:
It is the current version of wxPython(2.6). But follow you instruction it
still can't work...
But if using the default from wxPython.wx import *, it work, don't know
what is the problem. May be this is an old example that cannot work
The Great 'monkey' uttered these words on 4/28/2005 5:50 PM:
Which version of wxPython are you running? What do you mean by does not
work...does the import fail or is your code giving errors?
It is the current new version 2.6. The error message said that the class
wxApp is not defined...
But when
Is it possible to specify anonymous functions, something like:
f = {print hello world}
f()
hello world
in Pyton?
Lambda expressions don't work here.
Thanks,
Uwe
--
http://mail.python.org/mailman/listinfo/python-list
Friday 29 April 2005 00:06 am Paul Rubin wrote:
Closest you can come is:
f = lambda: sys.stdout.write(hello world\n)
Ah. :))
Why does the print statement return a syntax error here?
lambda: print(hallo)
File stdin, line 1
lambda: print(hallo)
^
SyntaxError: invalid
I'm trying to write a python service, with an executable in
/usr/local/bin, but modules that are kept in a sub-directory of
/usr/lib/python/site-packages.
Using apt-proxy as my template, I've put the modules in
/usr/lib/python/site-packages/mymodules and tried to import them with
import
U¿ytkownik monkey [EMAIL PROTECTED] napisa³ w wiadomo¶ci
news:[EMAIL PROTECTED]
Which version of wxPython are you running? What do you mean by
does not
work...does the import fail or is your code giving errors?
It is the current new version 2.6. The error message said that the
class
I've got a file that seems to come across more like a dictionary from what I can
tell. Something like the following format:
###,1,val_1,2,val_2,3,val_3,5,val_5,10,val_10
###,1,val_1,2,val_2,3,val_3,5,val_5,11,val_11,25,val_25,967,val_967
In other words, different layouts (defined mostly by what
Uwe Mayer ha scritto:
Friday 29 April 2005 00:06 am Paul Rubin wrote:
Closest you can come is:
f = lambda: sys.stdout.write(hello world\n)
Ah. :))
Why does the print statement return a syntax error here?
^
this is the reason :)
You can't have statements into an
Peter Saffrey wrote:
I'm trying to write a python service, with an executable in
/usr/local/bin, but modules that are kept in a sub-directory of
/usr/lib/python/site-packages.
Using apt-proxy as my template, I've put the modules in
/usr/lib/python/site-packages/mymodules and tried to import them
import tempfile
works under windows and linux
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 28 Apr 2005 17:58:47 GMT, Charles Krug
[EMAIL PROTECTED] wrote:
On 28 Apr 2005 10:34:44 -0700, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Hey yall,
I'm new to Python and I love it. Now I can get most of the topics
covered with the Python tutorials I've read but the one thats just
On 2005-04-28, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I'm new to Python and I love it. Now I can get most of the topics
covered with the Python tutorials I've read but the one thats just
stumping me is Object Orientation. I can't get the grasp of it. Does
anyone know of a good resource
Simon Dahlbacka wrote:
print sys.modules[traceback]
import traceback
print Hello World
sys.stdout.flush()
just renders: module 'traceback' from 'C:\Python23\lib\traceback.pyc' in the
console, and no Hello World
Works fine on Python 2.4 for Windows.
I'm running out of ideas what to try next, so
On Thu, 28 Apr 2005 23:34:31 GMT, Peter A. Schott
[EMAIL PROTECTED] wrote:
I've got a file that seems to come across more like a dictionary from what I
can
tell. Something like the following format:
###,1,val_1,2,val_2,3,val_3,5,val_5,10,val_10
Peter A. Schott wrote:
I've got a file that seems to come across more like a dictionary from what I can
tell. Something like the following format:
###,1,val_1,2,val_2,3,val_3,5,val_5,10,val_10
###,1,val_1,2,val_2,3,val_3,5,val_5,11,val_11,25,val_25,967,val_967
Peter, I'm not sure exactly what you
http://www.pycode.com
I was kinda suprised when I could not find any good sites with 3rd
party modules (other than the Vaults of Parnassus, where you must host
files elsewhere), so I decided to write one myself :)
It is brand new and might still be buggy, but hopefully it will be
usefull to some
Simon Dahlbacka wrote:
safetyChecker = re.compile(r^[-\[\]0-9,. ]*$)
..doesn't the dot (.) in your character class mean that you are allowing
EVERYTHING (except newline?)
The re docs clearly say this is not the case:
'''
[]
Used to indicate a set of characters. Characters can be listed
On Thu, 28 Apr 2005 12:34:33 + (UTC), Operation Latte Thunder [EMAIL PROTECTED] wrote:
Jason Mobarak [EMAIL PROTECTED] wrote:
Why do you want to do this in a thread? What's wrong with
reactor.callLater?
import time
from twisted.internet import reactor
def shutdown():
time.sleep(3)
print
Uwe Mayer wrote:
Unfortunately I want to assign a handler function to an object and something
like this does not work:
class Foobar(object): pass
...
a = Foobar()
def a.handler():
File stdin, line 1
def a.handler():
^
SyntaxError: invalid syntax
But this does work, or something
On Thu, 28 Apr 2005 20:35:43 +, Robin Becker [EMAIL PROTECTED] wrote:
Jeremy Bowers wrote:
As you try to understand mmap, make sure your mental model can take into
account the fact that it is easy and quite common to mmap a file several
times larger than your physical memory, and
Lonnie Princehouse wrote:
Likewise, the above is basically just an inefficient way of writing:
def date_key(book):
return book.data
def author_and_date_key(book):
return (author_key(book), date_key(book))
It's certainly more elegant, but I wanted to talk about the mechanics
of comparison
Dr. Peer Griebel wrote:
Why has [].__str__ a different type than object.__str__?
Why is object.__str__ a routine while object().__str__ not?
Well, I don't know why inspect.isroutine does what it does, but if you
really need to detect these, can you do something like:
py MethodWrapperType =
First, my problem doesn't make much practical sense so I hope you're up
for a challenge.
What I have (in concept) is a standalone web client that connects
different 'players' to a central host and distributes game files
between them. A user claims certain files, plays them, and then
automatically
On 28 Apr 2005 17:45:02 -0700, lpe [EMAIL PROTECTED] wrote:
http://www.pycode.com
I was kinda suprised when I could not find any good sites with 3rd
party modules (other than the Vaults of Parnassus, where you must host
files elsewhere), so I decided to write one myself :)
It is brand new
lpe wrote:
http://www.pycode.com
I was kinda suprised when I could not find any good sites with 3rd
party modules (other than the Vaults of Parnassus, where you must host
files elsewhere), so I decided to write one myself :)
It is brand new and might still be buggy, but hopefully it will be
poisondart wrote:
Is there a way to dynamically generate temporary files (such as an
html, xml or text file) in Python?
I'm not sure if I'm explaining myself clearly as I've no clue how to
describe this mechanism. I've seen it on certain websites that will
generate a file under certain parameters
On 28 Apr 2005 12:42:34 -0700, runes [EMAIL PROTECTED] wrote:
Hi Duncan, sorry, I was unprecise. I'm thinking of a script, called
t.py that can be used in the console like an ordinary command. Som if
I change directory from S:\scripts to d:\projects and execute the
script the title changes to
On Thu, 28 Apr 2005 20:53:14 -0400, Peter Hansen wrote:
The re docs clearly say this is not the case:
'''
[]
Used to indicate a set of characters. Characters can be listed
individually, or a range of characters can be indicated by giving two
characters and separating them by a -.
Michael Soulier wrote:
On 28 Apr 2005 17:45:02 -0700, lpe [EMAIL PROTECTED] wrote:
http://www.pycode.com
I was kinda suprised when I could not find any good sites with 3rd
party modules (other than the Vaults of Parnassus, where you must host
files elsewhere), so I decided to write one myself :)
It is the current version of wxPython(2.6). But follow you instruction it
still can't work...
But if using the default from wxPython.wx import *, it work, don't know
what is the problem. May be this is an old example that cannot work with
import wx. Because I get another example and it is ok.
Probably going to need more information about how mplayer is not being
accessed correctly.
CGI uses the shell environment to pass web information to a program...
so maybe this is messing up mplayer. You'll need to augment or wrap
your partners program in order to give you more information about
William Park [EMAIL PROTECTED] typed:
Russell E. Owen [EMAIL PROTECTED] wrote:
Can anyone recommend a fast cross-platform plotting package for 2-D
plots?
Our situation:
We are driving an instrument that outputs data at 20Hz. Control is
via an existing Tkinter application (which is being
Uwe Mayer:
Why does the print statement return a syntax error here?
Google for Python regrets where Guido admits that
'print' should have been a function.
Michele Simionato
--
http://mail.python.org/mailman/listinfo/python-list
Thanks to Thomas Wouters for quickly getting mail.python.org back up
once he was notified. The mail backlog seems to be mostly finished.
--
Aahz ([EMAIL PROTECTED]) * http://www.pythoncraft.com/
It's 106 miles to Chicago. We have a full tank of gas, a half-pack of
cigarettes,
Hi I am getting the following error when uploading large
files
Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit
(Intel)] on win32
Type help, copyright,
credits or license for more information.
## working on region in file
You might not need threads to get user input from the console. Jp
posted this in response to a similar query on the twisted-python
mailing list:
http://article.gmane.org/gmane.comp.python.twisted/9019
--
http://mail.python.org/mailman/listinfo/python-list
MsKitty schrieb:
Neil -
Interesting theory, but I installed brand new versions of Python
(2.4.1) and the win32 extensions on a machine that had no Python and
got the the same 4 minute response time, so that does not seem a likely
explanation, although its possible.
- Kitty
Standalone machine or
I had an idea for passing functions as arguments:
Allow a block syntax (like with class definition)
for keyword arguments, attached to a statement
that includes a function call but doesn't need
the block for something else (like loops and ifs).
Apologies for the contrived examples.
squares =
Feature Requests item #1190033, was opened at 2005-04-25 23:59
Message generated for change (Comment added) made by josiahcarlson
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=355470aid=1190033group_id=5470
Category: Python Library
Group: None
Status: Open
Feature Requests item #1190701, was opened at 2005-04-26 20:35
Message generated for change (Comment added) made by cxdunn
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=355470aid=1190701group_id=5470
Category: Python Library
Group: None
Status: Open
Resolution:
Feature Requests item #1190701, was opened at 2005-04-26 20:35
Message generated for change (Comment added) made by cxdunn
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=355470aid=1190701group_id=5470
Category: Python Library
Group: None
Status: Open
Resolution:
Feature Requests item #1190701, was opened at 2005-04-26 20:35
Message generated for change (Comment added) made by cxdunn
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=355470aid=1190701group_id=5470
Category: Python Library
Group: None
Status: Open
Resolution:
Bugs item #1191043, was opened at 2005-04-27 09:34
Message generated for change (Comment added) made by rhettinger
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1191043group_id=5470
Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Feature Requests item #1190689, was opened at 2005-04-27 01:19
Message generated for change (Comment added) made by vsajip
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=355470aid=1190689group_id=5470
Category: Python Library
Group: None
Status: Closed
Resolution:
Bugs item #1191043, was opened at 2005-04-27 10:34
Message generated for change (Comment added) made by catlee
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1191043group_id=5470
Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Feature Requests item #1190689, was opened at 2005-04-26 20:19
Message generated for change (Comment added) made by cxdunn
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=355470aid=1190689group_id=5470
Category: Python Library
Group: None
Status: Closed
Resolution:
Bugs item #1190596, was opened at 2005-04-26 17:10
Message generated for change (Comment added) made by rhettinger
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1190596group_id=5470
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Feature Requests item #1191697, was opened at 2005-04-28 13:42
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=355470aid=1191697group_id=5470
Category: Python Interpreter Core
Group: None
Bugs item #1190596, was opened at 2005-04-26 18:10
Message generated for change (Comment added) made by tseaver
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1190596group_id=5470
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Feature Requests item #1191964, was opened at 2005-04-28 13:40
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=355470aid=1191964group_id=5470
Category: None
Group: None
Status: Open
Bugs item #1190596, was opened at 2005-04-26 18:10
Message generated for change (Comment added) made by tseaver
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1190596group_id=5470
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Bugs item #1190596, was opened at 2005-04-26 17:10
Message generated for change (Comment added) made by rhettinger
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1190596group_id=5470
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Feature Requests item #1190596, was opened at 2005-04-26 17:10
Message generated for change (Comment added) made by rhettinger
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=355470aid=1190596group_id=5470
Category: Python Library
Group: None
Status: Open
Feature Requests item #1191697, was opened at 2005-04-28 08:42
Message generated for change (Comment added) made by cxdunn
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=355470aid=1191697group_id=5470
Category: Python Interpreter Core
Group: None
Status: Open
101 - 180 of 180 matches
Mail list logo