Problem with help() in python/ipython interpreters

2008-05-09 Thread Casey
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.

Making Variable Text Output More Pythonic?

2008-05-15 Thread Casey
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

Winsound Problems on Vista 64

2009-03-06 Thread Casey
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

Re: Favorite Python System Administration Examples

2008-10-06 Thread Casey
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

Re: Python and Harry Potter?

2008-06-05 Thread Casey
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

Re: Anyone happen to have optimization hints for this loop?

2008-07-09 Thread Casey
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

Re: Perfect hashing for Py

2008-07-11 Thread Casey
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

Re: Where is the correct round() method?

2008-07-28 Thread Casey
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 +

Re: paretovariate

2008-08-11 Thread Casey
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

Re: for x,y in word1, word2 ?

2008-08-11 Thread Casey
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

PIL Question: Inverse of image.load()?

2008-08-15 Thread Casey
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

Re: PIL Question: Inverse of image.load()?

2008-08-16 Thread Casey
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

Re: Usual practice: running/testing modules in a package

2008-08-27 Thread Casey
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

Re: Usual practice: running/testing modules in a package

2008-09-03 Thread Casey
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

Re: True of False

2007-09-27 Thread Casey
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,

Re: True of False

2007-09-27 Thread Casey
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

getopt with negative numbers?

2007-09-27 Thread Casey
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

Re: getopt with negative numbers?

2007-09-27 Thread Casey
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

Re: getopt with negative numbers?

2007-09-27 Thread Casey
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

Re: getopt with negative numbers?

2007-09-27 Thread Casey
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

Re: getopt with negative numbers?

2007-09-27 Thread Casey
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

Re: getopt with negative numbers?

2007-09-28 Thread Casey
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

What does the syntax [::-1] really mean?

2007-10-04 Thread Casey
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

Re: What does the syntax [::-1] really mean?

2007-10-04 Thread Casey
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

Re: What does the syntax [::-1] really mean?

2007-10-04 Thread Casey
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)

Re: What does the syntax [::-1] really mean?

2007-10-04 Thread Casey
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

Re: Is there a nicer way to do this?

2007-10-04 Thread Casey
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

Re: Is there a nicer way to do this?

2007-10-04 Thread Casey
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

Re: Is this a bug in Python or something I do not understand.

2009-01-01 Thread Casey
, 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

Python 3.0 nonlocal statement

2009-01-06 Thread Casey
nested functions where it does make the code seem a little cleaner. Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.0 nonlocal statement

2009-01-06 Thread Casey
it a little less clear. But I do appreciate the reply! Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.0 nonlocal statement

2009-01-06 Thread Casey
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

Re: Py3 - converting bytes to ascii

2009-01-15 Thread Casey
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',

Re: Regular expression that skips single line comments?

2009-01-19 Thread Casey
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 =

Re: printing bytes to stdout in Py3

2009-02-17 Thread Casey
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

Re: printing bytes to stdout in Py3

2009-02-17 Thread Casey
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:

Threading.py Class Syntax and Super

2009-09-16 Thread Casey
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

[issue37777] imap breaks on OpenSSL 1.1.1 when SNI is enforced

2019-08-06 Thread Casey
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

[issue37777] imap breaks on OpenSSL 1.1.1 when SNI is enforced

2019-08-06 Thread Casey
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

EPD Py2.5 v4.1.30101 Released

2008-12-22 Thread Chris Casey
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

Lepton particle engine 0.7a released

2008-12-29 Thread Casey Duncan
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

Lepton particle engine 0.8a released

2009-01-07 Thread Casey Duncan
-users Enjoy. -Casey -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations.html

Lepton particle engine 0.9a released

2009-03-16 Thread Casey Duncan
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

Grease 0.2 Released

2010-04-07 Thread Casey Duncan
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

planar 0.3 released

2011-02-27 Thread Casey Duncan
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

Re: Command line and GUI tools : need a single threading solution

2005-01-11 Thread Adrian Casey
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.

Re: Command line and GUI tools : need a single threading solution

2005-01-11 Thread Adrian Casey
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

Re: Command line and GUI tools : need a single threading solution

2005-01-12 Thread Adrian Casey
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

Re: short programming projects for kids

2005-01-24 Thread Adrian Casey
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?

Re: python without OO

2005-01-26 Thread Casey Hawthorne
Similarly, now, Java's generics! -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: Kill GIL

2005-02-15 Thread Adrian Casey
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

Re: Python vs Ruby

2005-10-20 Thread Casey Hawthorne
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

Re: What can I do with Python ??

2005-01-02 Thread Casey Hawthorne
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

Command line and GUI tools : need a single threading solution

2005-01-10 Thread Adrian Casey
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

Re: Vancouver Python and Zope: Next Meeting Oct 2nd

2005-09-26 Thread Casey Hawthorne
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

Return Text from popen

2005-10-15 Thread Casey Bralla
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

The value of Big-O notation is for scale ability and the value of the constant of proportionality!

2005-10-16 Thread Casey Hawthorne
optimization issues. -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: Information about Python Codyng Projects Ideas

2005-06-01 Thread Casey Hawthorne
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

What platforms have Python Virtual Machines and what version(s) of Python do they support?

2005-06-18 Thread Casey Hawthorne
! -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking For Geodetic Python Software

2005-06-22 Thread Casey Hawthorne
, 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

Re: Newbie: Help Figger Out My Problem

2005-06-28 Thread Casey Hawthorne
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

Re: What are __slots__ used for?

2005-07-04 Thread Casey Hawthorne
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

Re: What is Expresiveness in a Computer Language?

2005-07-10 Thread Casey Hawthorne
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

Re: IDLE in Jython

2005-07-15 Thread Casey Hawthorne
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

Re: Strange os.path.exists() behaviour

2005-07-20 Thread Casey Hawthorne
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?

2005-08-03 Thread Casey Hawthorne
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

Re: Creating Palm OS programs with python?

2005-08-10 Thread Casey Hawthorne
, Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: Permutation Generator

2005-08-14 Thread Casey Hawthorne
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

Re: up to date books?

2005-08-22 Thread Casey Hawthorne
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

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing, was Re: Bug in slice type

2005-08-24 Thread Casey Hawthorne
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

Read from Serial Port

2006-01-20 Thread Casey Bralla
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

curses won't refresh screen

2006-01-28 Thread Casey Bralla
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

Curses won't update screen - Solved!

2006-01-28 Thread Casey Bralla
. 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

Re: Too Many if Statements?

2006-02-07 Thread Casey Hawthorne
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

Re: a question regarding call-by-reference

2006-02-08 Thread Casey Hawthorne
. etv -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: May i customize basic operator (such as 1==3)?

2006-02-21 Thread Casey Hawthorne
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

Re: May i customize basic operator (such as 1==3)?

2006-02-22 Thread Casey Hawthorne
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

pexpect: TIMEOUT exception never raised

2005-05-12 Thread Adrian 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:

2005-05-12 Thread Casey Hawthorne
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

Different results when running script from IDLE versus Command Line

2008-03-12 Thread Casey T
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

Re: Different results when running script from IDLE versus Command Line

2008-03-13 Thread Casey T
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

Getting PyUnit to run Package Test Modules

2008-04-22 Thread Casey McGinty
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

Re: Getting PyUnit to run Package Test Modules

2008-04-22 Thread Casey McGinty
= __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

Making Variable Text Output More Pythonic?

2008-05-15 Thread Casey McGinty
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

Re: Sanitised Newsgroup Feeds?

2008-05-15 Thread Casey McGinty
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

2008-05-15 Thread Casey McGinty
test -- http://mail.python.org/mailman/listinfo/python-list

Re: Compute working days

2009-03-14 Thread Casey Webster
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

Re: How to add months to a date (datetime object)?

2009-03-15 Thread Casey Webster
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

Re: How complex is complex?

2009-03-18 Thread Casey Webster
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

Can't one collect twitts and twits in any language?

2009-04-04 Thread Casey Hawthorne
:) -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Dot operator magic has me stymied...

2008-10-29 Thread Casey Rodarmor
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

Re: Organizing a Python project

2008-05-21 Thread Casey McGinty
for reading, - Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: Code correctness, and testing strategies

2008-05-24 Thread Casey McGinty
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

Re: finding icons for Apps

2008-05-25 Thread Casey McGinty
http://art.gnome.org/ http://www.gnome-look.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Organizing a Python project

2008-05-25 Thread Casey McGinty
) 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

Re: Struct usages in Python

2008-05-27 Thread Casey McGinty
self.event[] = Event() *# Seems this is not allowed ?? * self.event = [Event()] - Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: Code execution in imported modules

2008-05-30 Thread Casey McGinty
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

Re: ClassName.attribute vs self.__class__.attribute

2008-06-05 Thread Casey McGinty
work and the other one fail? Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: ClassName.attribute vs self.__class__.attribute

2008-06-06 Thread Casey McGinty
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

Re: Guide to organizing modules?

2008-06-06 Thread Casey McGinty
. - Casey -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >