I'm running python 2.5.2 on WinXP. I've always used a GUI for
interactive development, but I wanted to try out ipython which better
supports matplotlib in this mode. Unfortunately, whenever I try to
use help() I get the following error:
(Sys) The system cannot find the file specified.
Hi,
I have some classes that print variable outputs depending on their
internal state, like so:
def __str__(self):
out = []
if self.opt1: out += ['option 1 is %s' % self.opt1']
if self.opt2: out += ['option 2 is %s' % self.opt2']
return '\n'.join(out)
Is there any way
I have a new laptop that came with Vista 64 and I'm having problems
with some of my older code that I use for multimedia processing. I
narrowed the problem down to the winsound library; any attempt to play
sounds results in a fatal error. The simplest case is:
from winsound import Beep
On Oct 6, 3:05 pm, Steve Holden [EMAIL PROTECTED] wrote:
I'm giving a talk at LISA this year, and while the slides are ready I
would like to go armed with as many examples of good system
administration code as possible.
If you have a favorite administration tool that you wouldn't mind me
Python fan??? Harry speaks Python fluently. We should all be so
lucky!
I'm told Harry is looking forward to Py3K and getting rid of all the
old (hog)warts
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 9, 12:04 pm, dp_pearce [EMAIL PROTECTED] wrote:
I have some code that takes data from an Access database and processes
it into text files for another application. At the moment, I am using
a number of loops that are pretty slow. I am not a hugely experienced
python user so I would like
On Jul 11, 8:01 am, [EMAIL PROTECTED] wrote:
Following links from this
thread:http://groups.google.com/group/comp.lang.python/browse_thread/thread/...
I have found this perfect hash (minimal too)
implementation:http://burtleburtle.net/bob/hash/perfect.html
I have already translated part
On Jul 28, 12:34 am, Gary Herron [EMAIL PROTECTED] wrote:
This will work as you wish:
math.floor(x+0.5)
This works fine for positive x but what about negative:
round(2.5)
3.0
floor(2.5 + 0.5)
3.0
round(-2.5)
-3.0
floor(-2.5 + 0.5)
-2.0
Maybe:
def round2(x):
return math.floor(x +
On Aug 11, 3:14 am, zhjchen [EMAIL PROTECTED] wrote:
I want to realize a list of numbers. They follow pareto distribution.
For instance, the average value is 10 and alpha is 1.0
I do not know how to use the function of paretovariate(alpha). It only
provides
alpha parameter. How should I set
My first thought is that you should be looking at implementations of
Hamming Distance. If you are actually looking for something like
SOUNDEX you might also want to look at the double metaphor algorithm,
which is significantly harder to implement but provides better
matching and is less
I'm doing some image processing that requires accessing the individual
pixels of the image. I'm using PIL 1.1.6 and creating a 2D array of
pixel RGB tuples using the Image class instance load() method.
Unfortunately, I can't seem to find a reciprocal function that
converts the 2D array of RGB
On Aug 16, 3:53 am, Fredrik Lundh [EMAIL PROTECTED] wrote:
Casey wrote:
I'm doing some image processing that requires accessing the individual
pixels of the image. I'm using PIL 1.1.6 and creating a 2D array of
pixel RGB tuples using the Image class instance load() method.
load returns
On Aug 12, 9:57 pm, alito [EMAIL PROTECTED] wrote:
A wrapper on the level up works:
~/python$ cat importercaller.py
from testpackage import config
config.hello()
~/python$ python importercaller.py
hello
So, how do I run these modules without writing a wrapper script for
each one?
I
On Aug 26, 10:21 pm, Casey [EMAIL PROTECTED] wrote:
On Aug 12, 9:57 pm, alito [EMAIL PROTECTED] wrote:
A wrapper on the level up works:
~/python$ cat importercaller.py
from testpackage import config
config.hello()
~/python$ python importercaller.py
hello
So, how do I run
On Sep 27, 12:48 pm, Simon Brunning [EMAIL PROTECTED]
wrote:
On 9/27/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I tried writing a true and false If statement and didn't get
anything? I read some previous posts, but I must be missing
something. I just tried something easy:
a = [a,
On Sep 27, 1:12 pm, Richard Thomas [EMAIL PROTECTED] wrote:
On 27/09/2007, Casey [EMAIL PROTECTED] wrote:
On Sep 27, 12:48 pm, Simon Brunning [EMAIL PROTECTED]
wrote:
On 9/27/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I tried writing a true and false If statement and didn't get
Is there an easy way to use getopt and still allow negative numbers as
args? I can easily write a workaround (pre-process the tail end of
the arguments, stripping off any non-options including negative
numbers into a separate sequence and ignore the (now empty) args list
returned by getopt, but
On Sep 27, 1:34 pm, Peter Otten [EMAIL PROTECTED] wrote:
optparse can handle options with a negative int value; -- can be used to
signal that no more options will follow:
Thanks, Peter. getopt supports the POSIX -- end of options
indicator as well, but that seems a little less elegant than
On Sep 27, 2:21 pm, J. Clifford Dyer [EMAIL PROTECTED] wrote:
If you can access the argument list manually, you could scan it for a
negative integer,
and then insert a '--' argument before that, if needed, before passing it to
getopt/optparse.
Then you wouldn't have to worry about it on the
On Sep 27, 2:21 pm, J. Clifford Dyer [EMAIL PROTECTED] wrote:
If you can access the argument list manually, you could scan it for a
negative integer, and then insert a '--' argument before that,
if needed, before passing it to getopt/optparse. Then you wouldn't have to
worry about it on the
On Sep 27, 7:57 pm, Neal Becker [EMAIL PROTECTED] wrote:
One person's brilliant is another's kludge.
Well, it is a hack and certainly not as clean as having getopt or
optparse handle this natively (which I believe they should). But I
think it is a simple and clever hack and still allows getopt
On Sep 27, 10:47 pm, Ben Finney [EMAIL PROTECTED]
wrote:
I believe they shouldn't because the established interface is that a
hyphen always introduced an option unless (for those programs that
support it) a '--' option is used, as discussed.
Not THE established interface; AN established
I've used [::-1] as a shorthand for reverse on several occasions, but
it occurred to me yesterday I never really thought about why it
works. First, I checked out the documentation.
From section 3.6 of the Python Library Reference:
The slice of s from i to j with step k is defined as the
On Oct 4, 1:41 pm, Kurt Smith [EMAIL PROTECTED] wrote:
'abc'[None:None:-1]
'cba'
Kurt
Thanks!
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 4, 4:32 pm, Duncan Booth [EMAIL PROTECTED] wrote:
Duncan Booth [EMAIL PROTECTED] wrote:
the invariant that you are looking for is that for all non-negative a, b:
x[a:b:1] reversed is x[-len(x)+b-1:-len(x)+a-1:-1]
I should of course have said all a, b in the range 0 = a = len(x)
On Oct 4, 4:58 pm, Casey [EMAIL PROTECTED] wrote:
Thanks, again! I figured it out from Fred's and your initial posts.
Oops - I meant Kurt, not Fred. Sorry for the mis-attribution!
--
http://mail.python.org/mailman/listinfo/python-list
Not sure if this is really better or even more pythonic, but if you
like one-liners that exercise the language:
attributeNames = dict( [(AttributeName.%d % (n+1), attribute) for
n,attribute in enumerate(attributes)] )
What this does is create a list (using a list comprehension and the
enumerate
On Oct 4, 5:42 pm, Casey [EMAIL PROTECTED] wrote:
Not sure if this is really better or even more pythonic, but if you
like one-liners that exercise the language:
Hmm, I guess it WAS more pythonic, since three of us gave essentially
identical responses in a 10-minute period. That being said
, 1, 1], [1, 1, 1], [1, 1, 1]]
r[0][0] = 999
r
[[999, 1, 1], [999, 1, 1], [999, 1, 1]]
Regards, Casey
--
http://mail.python.org/mailman/listinfo/python-list
nested
functions where it does make the code seem a little cleaner.
Regards, Casey
--
http://mail.python.org/mailman/listinfo/python-list
it a little less clear.
But I do appreciate the reply!
Casey
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 6, 11:46 am, Rob Williscroft r...@freenet.co.uk wrote:
Matimus wrote in news:2a3d6700-85f0-4861-84c9-9f269791f044
Searching (AKA googling) for: nonlocal site:bugs.python.org
leads to:http://bugs.python.org/issue4199
Rob.
--http://www.victim-prime.dsl.pipex.com/
Doh. I looked at the
On Jan 15, 9:54 am, Anjanesh Lekshminarayanan m...@anjanesh.net
wrote:
Using Python 3.0
So how do I to convert res.read() to ascii on opening the file in
ascii mode f = open('file.txt', 'w')?
I think this is what you are looking for:
res = urllib.request.urlopen(url)
f = open('file.txt',
Another option (I cheated a little and turned sInput into a sequence
of lines, similar to what you would get reading a text file):
sInput = [
'; $1 test1',
'; test2 $2',
'test3 ; $3 $3 $3',
'test4',
'$5 test5',
' $6',
' test7 $7 test7',
]
import re
re_exp =
On Feb 17, 7:28 am, Christian Heimes li...@cheimes.de wrote:
Peter Billam schrieb:
Greetings. (Newbie warning as usual) In Python3, sys.stdout is a
io.TextIOWrapper object; but I want to output bytes
(e.g. muscript -midi t t.mid )
and they're coming out stringified :-( How can I
On Feb 17, 12:33 pm, Christian Heimes li...@cheimes.de wrote:
Yes, it's really the official way. You can google up the discussion
between me and Guido on the python-dev list if you don't trust me. ;)
The docs concur with me, too.
http://docs.python.org/3.0/library/sys.html#sys.stdin
Note:
if the class __init__ method does not make a call to super?
[1] http://svn.python.org/view/python/trunk/Lib/threading.py?view=markup
Thanks,
- Casey
--
http://mail.python.org/mailman/listinfo/python-list
New submission from Casey :
OpenSSL 1.1.1 is an LTS release that will see long maintenance, and Ubuntu
18.04 LTS has now upgraded from 1.1.0 to 1.1.1. However, with this upgrade, TLS
1.3 allows email clients to require an SNI for the handshake to succeed.
Because the 2.7 imap module does
Casey added the comment:
Update: After digging further (and enabling the "Less secure app access"
setting on the test Google account) it looks like Python 2.7 caps TLS at 1.2
rather than using 1.3 when OpenSSL is upgraded. This prevents breakage, and it
looks like the SSLSo
Greetings,
Enthought, Inc. is very pleased to announce the newest release of the
Enthought Python Distribution (EPD) Py2.5 v4.1.30101:
http://www.enthought.com/epd
The size of the installer has be reduced by about half. Also, this is
the first release to include a 3.1.0 version of the
at:
http://groups.google.com/group/py-lepton-users
Enjoy.
-Casey
--
http://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software Foundation:
http://www.python.org/psf/donations.html
-users
Enjoy.
-Casey
--
http://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software Foundation:
http://www.python.org/psf/donations.html
are
provided using pyglet and pygame.
If you have questions or comments or would like to contribute, you can
join the google group at:
http://groups.google.com/group/py-lepton-users
Enjoy.
-Casey
--
http://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software
the Python package index (pypi):
* http://pypi.python.org/pypi/grease/
Documentation
-
You can browse the documentation online at:
* http://pygamesf.org/~casey/grease/doc/
The documentation is also available for offline viewing in the
``doc/build/html`` subdirectory for the source
in both Python and C, available under a
liberal license.
You can check out the docs and grab it from pypi here:
http://pypi.python.org/pypi/planar/0.3
Enjoy.
-Casey
--
http://mail.python.org/mailman/listinfo/python-announce-list
Support the Python Software Foundation:
http
Diez B. Roggisch wrote:
I'm thinking it may be possible to modify the command line tools to use
qt
threads instead of native python threads. Is this the way to go? Are
there other options?
Why don't you use python threads in qt - I do so and so far it didn't make
any troubles for me.
Phil Thompson wrote:
I have a collection of multi-threaded command line tools which I want
wrap a
PyQt gui around. I'm using queues to route messages from the command
line tools to the PyQt gui. The command line tools use python threads to
do
their work. The gui uses a QThread object to
Adrian Casey wrote:
Diez B. Roggisch wrote:
I'm thinking it may be possible to modify the command line tools to use
qt
threads instead of native python threads. Is this the way to go? Are
there other options?
Why don't you use python threads in qt - I do so and so far it didn't
make
André Roberge wrote:
bobdc wrote:
I will be teaching an Introduction to Programming class to some
middle school aged children and will be using Python, obviously. Does
anyone have suggestions for simple little programs to create and
analyze with them after I get past turtle graphics?
Similarly, now, Java's generics!
--
Regards,
Casey
--
http://mail.python.org/mailman/listinfo/python-list
Aahz wrote:
In article [EMAIL PROTECTED],
Frans Englich [EMAIL PROTECTED] wrote:
Personally I need a solution which touches this discussion. I need to run
multiple processes, which I communicate with via stdin/out,
simultaneously, and my plan was to do this with threads. Any favorite
document
in depth. Any help/comments are
greatly appreciated. Thanks in advance for your help.
Of all the common scripting languages, Ruby has the highest vowel to
consonant ratio.
--
Regards,
Casey
--
http://mail.python.org/mailman/listinfo/python-list
Aren't games using full screen mode to address only 320 by 240
resolution for faster screen painting?
If one used only 320 by 240 in a window, then that would be 1/4 of the
screen or less!
--
Regards,
Casey
--
http://mail.python.org/mailman/listinfo/python-list
I have a collection of multi-threaded command line tools which I want wrap a
PyQt gui around. I'm using queues to route messages from the command line
tools to the PyQt gui. The command line tools use python threads to do
their work. The gui uses a QThread object to read incoming messages.
This
types)
For more information see our website: http://www.vanpyz.org
Mailing list: http://www.agmweb.ca/cgi-bin/mailman/listinfo/list
--
Regards,
Casey
--
http://mail.python.org/mailman/listinfo/python-list
of how to get the actual text
result from the linux command into a Python variable? Thanks!
--
Casey Bralla
Chief Nerd in Residence
The NerdWorld Organisation
http://www.NerdWorld.org
--
http://mail.python.org/mailman/listinfo/python-list
optimization issues.
--
Regards,
Casey
--
http://mail.python.org/mailman/listinfo/python-list
The slightly slower startup time makes no difference for apps running
24 hours a day, except when reloading changed source modules!
I imagine reloading modules is also slower -- but I could be
mis t
ak
en!
--
Regards,
Casey
--
http://mail.python.org/mailman/listinfo/python-list
!
--
Regards,
Casey
--
http://mail.python.org/mailman/listinfo/python-list
, or the actual over-ground distance that accounts for
the earth's curvature.
Do your planes fly over the earth's surface or through the ground?
--
Regards,
Casey
--
http://mail.python.org/mailman/listinfo/python-list
L [EMAIL PROTECTED] wrote:
import random
flips = 100
results = [random.randint(0,1) for i in range(flips)]
heads = results.count(0)
tails = results.count(1)
print Heads:%s % heads
print Tails:%s % tails
I think this is more compact.
--
Regards,
Casey
--
http://mail.python.org/mailman/listinfo
code which uses this feature. Can anyone elaborate on what it is and how it
is used?
Regards,
Ric
--
Regards,
Casey
--
http://mail.python.org/mailman/listinfo/python-list
It is easier to write code a computer can understand than others can
understand!
It is harder to read code than to write code!
--
Regards,
Casey
--
http://mail.python.org/mailman/listinfo/python-list
How about the following:
- making Jython mostly work up to Python 2.4?
- making a PVM (Python Virtual Machine) for the Palm?
--
Regards,
Casey
--
http://mail.python.org/mailman/listinfo/python-list
for this ? Is there a test that returns True only for
the really existing path ?
Pierre
--
Regards,
Casey
--
http://mail.python.org/mailman/listinfo/python-list
Is there a way to determine -- when parsing -- if a word contains a
builtin name or other imported system module name?
Like iskeyword determines if a word is a keyword!
--
Regards,
Casey
--
http://mail.python.org/mailman/listinfo/python-list
,
Casey
--
http://mail.python.org/mailman/listinfo/python-list
It's hard to make complete permutation generators, Knuth has a whole
fascicle on it - The Art of Computer Programming - Volume 4 Fascicle
2 - Generating All Tuples and Permutations - 2005
--
Regards,
Casey
--
http://mail.python.org/mailman/listinfo/python-list
I can mention _its_ feechurz in a mostly-2.4 book... meaning the 2nd
ed of the Nutshell may be almost a year away...
Alex
--
Regards,
Casey
--
http://mail.python.org/mailman/listinfo/python-list
contained in the range [start, end)
Does range(start, end) generate negative integers in Python if start
= 0 and end = start?
--
Regards,
Casey
--
http://mail.python.org/mailman/listinfo/python-list
from a
serial port?
Thanks!
--
Casey Bralla
Chief Nerd in Residence
The NerdWorld Organisation
http://www.NerdWorld.org
--
http://mail.python.org/mailman/listinfo/python-list
matter.
Any ideas to suggest?
--
Casey Bralla
Chief Nerd in Residence
The NerdWorld Organisation
http://www.NerdWorld.org
--
http://mail.python.org/mailman/listinfo/python-list
.
Why isn't the screen.refresh() command refreshing the display?
I'm running a terminal session from within KDE, but I didn't think this
would matter.
Any ideas to suggest?
--
Casey Bralla
Chief Nerd in Residence
The NerdWorld Organisation
http://www.NerdWorld.org
--
http://mail.python.org
stunted any further checks for
the script to make on the text files.
Hs anyone ever run into this sort of thing?
--
Regards,
Casey
--
http://mail.python.org/mailman/listinfo/python-list
.
etv
--
Regards,
Casey
--
http://mail.python.org/mailman/listinfo/python-list
mailto:[EMAIL PROTECTED]
Tel : 021-65407754
MP: 13916928084
_
Express yourself instantly with MSN Messenger! Download today - it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
--
Regards,
Casey
--
http
Cannot one subclass the builtin types?
I have heard, that one should always use objects when programming and
avoid the builtin types!
Then one is prepared to change objects at will and not rely on any
special properties of the builtin types!
Robert Kern [EMAIL PROTECTED] wrote:
Casey
signal.signal to set an alarm that fires a few seconds
after timeout and explicitly closes the session. However, my application
is multi-threaded (i.e. each thread respresents a connection to a remote
host) and signals can not be used outside the main thread :-(
Any ideas?
Cheers.
Adrian Casey
Is there a better way to delete the image from a Tkinter button other
than the following:
- reconstructing the button
- image=blank.gif
--
Regards,
Casey
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I'm new to Python and I'm having some problems with getting different
results from my script when I run it from IDLE versus just double-
clicking the .py file and having it run through the command line.
Basically, my script reads some CSV files, assembles a text files,
then uploads that test
On Mar 12, 5:28 pm, Chris [EMAIL PROTECTED] wrote:
On Mar 12, 8:10 pm, Casey T [EMAIL PROTECTED] wrote:
Hi,
I'm new to Python and I'm having some problems with getting different
results from my script when I run it from IDLE versus just double-
clicking the .py file and having it run
Hopefully this is an easy question for someone to answer. I have a directory
structure like so:
alltest.py
prog.py
../package
__init__.py
mod1.py
test_mod1.py
modn. py
(and so on...)
Each test_mod*.py file contains some PyUnit test cases. I am using the
following code in
= __import__(name)
components = name.split('.')
for comp in components[1:]:
print comp
mod = getattr(mod,comp)
alltests.addTest(unittest.findTestCases(mod))
return alltest
On Tue, Apr 22, 2008 at 12:12 AM, Casey McGinty [EMAIL PROTECTED]
wrote:
Hopefully
Hi,
I have some classes that print variable outputs depending on their internal
state, like so:
def __str__(self):
out = []
if self.opt1: out += ['option 1 is %s' % self.opt1']
if self.opt2: out += ['option 2 is %s' % self.opt2']
return '\n'.join(out)
Is there any way
method is to subscribe to the list using an e-mail program that can do
spam filtering. Gmail gets rid of about 98% of the spam for me right now and
I mark any spam that gets by. Also, I would put a filter on the python
emails so they don't show up directly in your Inbox. Good luck.
- Casey
--
http
test
--
http://mail.python.org/mailman/listinfo/python-list
How about:
from datetime import date, timedelta
# Define the weekday mnemonics to match the date.weekday function
(MON, TUE, WED, THU, FRI, SAT, SUN) = range(7)
def workdays(start_date, end_date, whichdays=(MON,TUE,WED,THU,FRI)):
'''
Calculate the number of working days between two
On Mar 15, 2:00 pm, tinn...@isbd.co.uk wrote:
No, it's perfectly possible applying simple logic. My reminder
program manages it perfectly well. I have, for example, two sets of
three monthly reminders.
One starts on Jan 19th and repeats three monthly, that means Jan
19th, April
On Mar 18, 1:30 pm, Kottiyath n.kottiy...@gmail.com wrote:
When we say readability counts over complexity, how do we define what
level of complexity is ok?
For example:
Say I have dict a = {'a': 2, 'c': 4, 'b': 3}
I want to increment the values by 1 for all keys in the dictionary.
So, should
:)
--
Regards,
Casey
--
http://mail.python.org/mailman/listinfo/python-list
it not to bind the foo instance to the self
argument.
Can anybody shed some light on what's happening here?
Also, I really do like using classes as decorators. Are there any
workarounds to get it to work with methods?
Thanks a bunch!
Best regards,
Casey Rodarmor
--
http://mail.python.org/mailman/listinfo
for reading,
- Casey
--
http://mail.python.org/mailman/listinfo/python-list
Seriously, 10 hours of testing for code developed in 10 hours? What
kind of environment do you write code for? This may be practical for
large companies with hordes of full-time testing QA staff, but not
for small companies with just a handful of developers (and where you
need to borrow
http://art.gnome.org/
http://www.gnome-look.org/
--
http://mail.python.org/mailman/listinfo/python-list
) inside of the package. The
'_' should indicate that any other modules using your package should import
that module.
- Casey
--
http://mail.python.org/mailman/listinfo/python-list
self.event[] = Event() *# Seems this is not allowed ?? *
self.event = [Event()]
- Casey
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, May 29, 2008 at 2:43 PM, Eric Wertman [EMAIL PROTECTED] wrote:
So I'm working on some file parsing and building up a stack of regular
expressions that I need to use. I was thinking of dropping them in an
external module. I was wondering.. if I put them in a file called
regex.py like
work and the other one fail?
Casey
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Jun 5, 2008 at 11:39 AM, Terry Reedy [EMAIL PROTECTED] wrote:
If you want to access the attribute of a particular class, to read or
write, use that class.
SomeClass.attr
Note that no instance is required or relevant.
If you want to read the attrubute of the class of an instance
.
- Casey
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 164 matches
Mail list logo