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

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

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 it

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 t

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 i

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

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 ge

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 sequen

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

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. Tha

Re: Py3 - converting bytes to ascii

2009-01-15 Thread Casey
On Jan 15, 9:54 am, "Anjanesh Lekshminarayanan" 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', 'w') f.write(

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 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 either cha

Re: printing bytes to stdout in Py3

2009-02-17 Thread Casey
On Feb 17, 12:33 pm, Christian Heimes 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: The standar

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

2009-01-01 Thread Casey
, 1, 1] >>> r = [q, q, q] >>> r [[1, 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
I use 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
x27; on one line and 'x += 1' on another makes 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 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 PEP and the 3

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 m

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 >>> B

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 to

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

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

Re: screencapture with PIL question

2008-07-14 Thread Casey
On Jul 14, 11:11 am, greg <[EMAIL PROTECTED]> wrote: > I am able to use the PIL module to capture a screen or specific > window.  My problem is when capturing a window (on windows XP) I can > only capture the "visible" portion of the window.  Is there any way to > capture the entire window?  specif

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 m

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 shoul

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 susceptibl

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. "C:\docum

PIL Question: Inverse of .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 tupl

Re: PIL Question: Inverse of .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 t

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 > ea

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()

Threading.py Class Syntax and Super

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

Re: BadValueError: Property title is required

2011-06-03 Thread Casey Dwyer
On May 31, 1:21 am, "michal.bulla" wrote: > Hello, > > I'm trying to create simple method to create category. I set the model > category: > > class Category(db.Model): >   title = db.StringProperty(required=True) >   clashes_count = db.IntegerProperty(default=0) > > And the class New Category as w

logging and PyQt4

2011-03-14 Thread Adrian Casey
eciated. Thank you. Adrian Casey. -- http://mail.python.org/mailman/listinfo/python-list

QCoreApplication will not quit

2011-04-01 Thread Adrian Casey
Can someone please explain why this simple PyQt4 application never exits? #!/usr/bin/env python from PyQt4 import QtCore import sys class foo(QtCore.QObject): def __init__(self, parent): QtCore.QObject.__init__(self, parent) self.parent = parent

Re: QCoreApplication will not quit

2011-04-02 Thread Adrian Casey
Dennis Lee Bieber wrote: > On Sat, 02 Apr 2011 14:12:38 +0930, Adrian Casey > declaimed the following in gmane.comp.python.general: > >> Can someone please explain why this simple PyQt4 application never exits? >> >> #!/usr/bin/env python >> from PyQt4 import

pexpect: TIMEOUT no longer clears child.before

2011-05-19 Thread Adrian Casey
The behaviour of pexpect has changed between version 2.1 and 2.3. In version 2.1, the following code would result in child.before being cleared -: >>>child.expect(pexpect.TIMEOUT,1) In version 2.3, this is no longer the case. No matter how many times the above code is run, child.before con

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

2005-09-26 Thread Casey Hawthorne
ern of multi-table inner joins, >which is one of the most common ad-hoc query 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
est into the actual stdout result. Can someone give me a brief code example 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
code optimization issues. -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs Ruby

2005-10-20 Thread Casey Hawthorne
r as many opinions as I can on this matter >> before I start studying either language 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: 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

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

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? >> >&

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 graphic

Re: python without OO

2005-01-26 Thread Casey Hawthorne
s" Peter H. Salus, editor 1998 page 63 Similarly, now, Java's generics! -- 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
time! -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking For Geodetic Python Software

2005-06-22 Thread Casey Hawthorne
r the straight-line >flying distance, 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
ot; % (flips - heads) "Devan 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

Re: What are __slots__ used for?

2005-07-04 Thread Casey Hawthorne
am trying to debug some >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
# expected > >>> os.path.exists('Lib/os.py.') >True# unexpected > >>> os.path.exists('Lib/os.py.') >True# unexpected > >>> > >Is there a reason 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
> > >THanks -- Regards, 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
til 2.5 alpha's out >so 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

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 favo

Passing arguments to python from URL

2005-03-22 Thread Casey Bralla
I've got a python cgi-bin application which produces an apache web page. I want to pass arguments to it on the URL line, but the parameters are not getting passed along to python properly. I've been using sys.argv to pick up command line arguments, and it works fine when I call the python program

Read from Serial Port

2006-01-20 Thread Casey Bralla
to get me started reading 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

Since there was talk of if-then-else not being allowed in lambda expressions, the following is from "Dive into Python"

2006-07-20 Thread Casey Hawthorne
quot;" >>> b = "second" >>> (1 and [a] or [b])[0] '' -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: Fastest Way To Loop Through Every Pixel

2006-07-27 Thread Casey Hawthorne
#Actions here for Pixel thisX, thisY > >But it takes 450-1000 milliseconds > >I want speeds less than 10 milliseconds > >I have tried using SWIG, and pypy but they all are unsuccessfull in >compiling my files. -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Can Your Programming Language Do This? Joel on functional programming and briefly on anonymous functions!

2006-08-02 Thread Casey Hawthorne
Can Your Programming Language Do This? Joel on functional programming and briefly on anonymous functions! http://www.joelonsoftware.com/items/2006/08/01.html -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Using signal.alarm to terminate a thread

2006-11-13 Thread Adrian Casey
y .bashrc and loops forever? Just one thread locking up like this holds up all the others. Any ideas or suggestions on how to handle such situations in a multi-threaded way would be appreciated. Cheers. Adrian Casey. Alice Springs Linux User Goup. http://www.aslug.org.au -- http://mail.python.org/mailman/listinfo/python-list

Re: Using signal.alarm to terminate a thread

2006-11-14 Thread Adrian Casey
Nick Craig-Wood wrote: > Adrian Casey <[EMAIL PROTECTED]> wrote: >> I have a multi-threaded python application which uses pexpect to connect >> to >> multiple systems concurrently. Each thread within my application is a >> connection to a remote system. The

Re: Using signal.alarm to terminate a thread

2006-11-15 Thread Adrian Casey
Nick Craig-Wood wrote: > Adrian Casey <[EMAIL PROTECTED]> wrote: >> > Adrian Casey <[EMAIL PROTECTED]> wrote: >> > import os, pexpect, threading >> > >> > def runyes(): >> > print "Running yes command..." >> &g

PyPy with a smaller PVM for the full Python?

2006-09-10 Thread Casey Hawthorne
se Python 2.5 in its entirety? -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

curses won't refresh screen

2006-01-28 Thread Casey Bralla
7;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/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://mai

Re: Too Many if Statements?

2006-02-07 Thread Casey Hawthorne
er 'if' >statements the new ones work so it appears that it has hit a limit on >the number of 'if' statements. This has 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
ame space, and that those changes aren't reflected >in the list in the original name space. > >I believe there are some ways around this, but I haven't found one that >would not require any special handling in either the code calling the >client stub or the original functions. I want to maintain transparency. > >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
_ >Express yourself instantly with MSN Messenger! Download today - it's FREE! >http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

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:

pexpect: TIMEOUT exception never raised

2005-05-12 Thread Adrian Casey
e, the child.expect statement will hang forever. I thought about using 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 u

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

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

Re: [ANN] Update to Python Quick Reference Card (for Python 2.4) (v0.67)

2007-05-02 Thread Casey Hawthorne
tal/python/pqrc/ > -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: a better solution for GUI in python

2007-03-11 Thread Casey Hawthorne
For a browser interface have you thought of Ajax and possibly WPF/E? http://en.wikipedia.org/wiki/AJAX http://en.wikipedia.org/wiki/Windows_Presentation_Foundation -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: which is better, string concatentation or substitution?

2006-05-08 Thread Casey Hawthorne
x27; > >We can say that "assignment is constant time", or "assignment is >O(1)". Constant time if converted to byte code or compiled? O(n) in string length if being interpreted? -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: New tail recursion decorator

2006-05-12 Thread Casey Hawthorne
== 1 or not even(n-1) > -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Tail Call Optimization Decorator?

2006-05-13 Thread Casey Hawthorne
Tail Call Optimization and Recursion are separate concepts! -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

For Large Dictionaries Could One Use Separate Dictionaries Where Each Dictionary Covers an Interval of the Input Range?

2006-05-16 Thread Casey Hawthorne
For Large Dictionaries Could One Use Separate Dictionaries Where Each Dictionary Covers an Interval of the Input Range? You would need to know something of the input range and its uniformity! Self-balancing between dictionaries for separate dictionaries? -- Regards, Casey -- http

Is the only way to connect Python and Lua through a C interface?

2006-05-16 Thread Casey Hawthorne
Is the only way to connect Python and Lua through a C interface? -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Extending the readline module?

2008-01-16 Thread Casey Rodarmor
branch. What is the best way to go about doing this? Best regards, Casey Rodarmor -- http://mail.python.org/mailman/listinfo/python-list

Re: Replace stop words (remove words from a string)

2008-01-17 Thread Casey Rodarmor
That's much better than what I was about to post: for s in stoplist: string.join(mystr.split(s, "")) Berlin: Why are you keen on avoiding split()? On 1/17/08, Karthik <[EMAIL PROTECTED]> wrote: > > How about - > > for s in stoplist: > string.replace(mystr, s, "") > > Hope this should

Stop tab-completing empty lines!

2008-01-17 Thread Casey Rodarmor
line and just want a tab, it tries to tab complete, which kind of a pain. -=SIMULATED PYTHON PROMPT=- >>> def mega_awesome_function(cool_stuff, **some_sweet_kwargs): ... X (The X is where I press tab and get super annoyed) I could just rebind the key, but i like tab ;-) Any suggestions?

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 f

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

Is there anyway Vpython and pyODE can be made to work with newer versions of Python 2.6.1 etc. without a lot of changes to source code?

2009-01-23 Thread Casey Hawthorne
Is there anyway Vpython and pyODE can be made to work with newer versions of Python 2.6.1 etc. without a lot of changes to source code? I suppose I'm thinking of an extra layer of indirection, which might slow things down to much. :) -- Regards, Casey -- http://mail.python.org/mailman/lis

Re: Google App Engine Code Challenge - write a tetris playing algorithm

2008-12-01 Thread Casey McGinty
On Sun, Nov 30, 2008 at 2:41 PM, russ.au <[EMAIL PROTECTED]> wrote: > I've got more features to add, depending on how > popular it is.. > Are you going to create a leader board to track the high scores? -- http://mail.python.org/mailman/listin

Re: Google App Engine Code Challenge - write a tetris playing algorithm

2008-12-01 Thread Casey McGinty
'j' or 'l', is there any way to fill in the two blocked squares, without removing the top portion first? - Casey -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >