Re: Building python 2.4.2 on Cygwin

2006-02-20 Thread Jason Tishler
What version are you running? Jason -- PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6 -- http://mail.python.org/mailman/listinfo/python-list

Re: converting sqlite return values

2006-02-20 Thread Jason Drew
in general you should only do it when you really need to do it. When you do, there are various Python modules to help, though I haven't used this approach much myself. Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: Building python 2.4.2 on Cygwin

2006-02-21 Thread Jason Tishler
, but I cannot reproduce your problem under Cygwin 1.5.18. BTW, can you use the pre-built Python 2.4.1 that is part of the standard Cygwin distribution? Jason -- PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6 -- http://mail.python.org/mailman/listinfo/python-list

Re: Building python 2.4.2 on Cygwin

2006-02-21 Thread Jason Tishler
ling Cygwin 1.5.18 or upgrading to 1.5.19. Jason -- PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6 -- http://mail.python.org/mailman/listinfo/python-list

Re: How to move optparse from main to function?

2006-02-23 Thread Jason Drew
As pointed out, the module documentation is helpful. For your 'test' option, I don't think 'action="count"' is the best action. 'Test' is basically an on/off option, so why count it? I would use: parser.add_option("-t", "--test", action="store_true", dest="optparse_test", default=False, help="tes

Re: How to move optparse from main to function?

2006-02-24 Thread Jason Drew
You're welcome! As usual, each of us is free to write the code whichever way works best for the particular problem at hand. That's why the module documentation often avoids advocating here-is-the-one-best-way-to-do-it. I just like sticking all the option setup stuff in a single function because i

Re: Modify the local scope inside a function

2006-02-25 Thread Jason Mobarak
Sandra-24 wrote: > Is there a way in python to add the items of a dictionary to the local > function scope? i.e. var_foo = dict['var_foo']. I don't know how many > items are in this dictionary, or what they are until runtime. Why do you want to do this? Exec and eval should -not- be used for this

Re: Trying to write CGI script with python...

2005-04-30 Thread Jason Mobarak
M.E.Farmer wrote: > I found an excellent example that was posted by the F-bot. [...] > try: > import myscript > myscript.main() > except: > print "Content-Type:", "text/html" > print > file = StringIO.StringIO() Note: it's usually a very bad idea to name -anything- "file" unles

pyFLTK

2005-05-02 Thread Jason Manley
Hello I am very interested in the pyFLTK GUI widget set. Unfortunately the webpage and mailing lists are very quiet, does anyone here use it or know of a resource I can access to help me with some examples? Cheers JM -- http://mail.python.org/mailman/listinfo/python-list

Re: annonymous functions -- how to

2005-05-04 Thread Jason Mobarak
What's wrong with: def blah(): def _ (a, b, c): a = a + 2 print "stmt 2" return a+b/c return doSomethingWith(_) It's basically "anonymous", it just uses a name that you don't care about. AFAIK, it can be immediately clobbered later if need be. Otherwise, the function shouldn't be

Re: properties vs. eval()

2005-05-05 Thread Jason Mobarak
Why are you using eval in the first place? This isn't bash. Use setattr and getattr for dynamic attribute access. -- http://mail.python.org/mailman/listinfo/python-list

Re: properties vs. eval()

2005-05-07 Thread Jason Mobarak
Bob Rogers wrote: > So you're saying you don't know the answer? The question wasn't > "should I use setattr?" If what you're doing is wrong and backwards then it doesn't matter what the question is. Best practices are best practices for a reason. There's no reason to use eval to do what you want

Re: Python Pseudo-Switch

2005-05-07 Thread Jason Mobarak
James Stroud wrote: > Hello All, > > Because of my poorly designing a database, I have recently found it necessary > to explore the wonders of the Python pseudo-switch: > > do_case = { "A" : lambda x: x["bob"], > "B" : lambda x: x["carol"], > "C" : lambda x: "Ted", >

Re: Python Pseudo-Switch

2005-05-09 Thread Jason Mobarak
# -*- python -*- import sys def switchFor (target): sw = '__switch_table__' # please pretend the frame hack is not here, # it happens to work for classes and messing with # frame stack in a try/except is probably okay try: raise Exception() except: defs =

Re: Safe eval, or how to get list from string

2005-05-13 Thread Jason Mobarak
[EMAIL PROTECTED] wrote: > if there is list1 = "[ 'filea', 'fileb', ]", I can get at list by > doing: > reallist = eval(list1) > is there an easier/simpler method of doing the same thing as realstring > and reallist lines above? http://twistedmatrix.com/users/moshez/unrepr.py Example: >>> from u

Re: CGI on Windows

2005-05-16 Thread Jason Drew
I believe you're experiencing a bug that I also encountered, and for which there is a patch. See: http://sourceforge.net/tracker/?group_id=5470&atid=105470&func=detail&aid=1110478 Fixing os.py as described in the patch fixed all my CGI-related problems. Hope it does for you too!

Re: CGI on Windows

2005-05-16 Thread Jason Drew
Rainer Mansfeld wrote: > Jason Drew wrote: > > I believe you're experiencing a bug that I also encountered, and for > > which there is a patch. See: > > http://sourceforge.net/tracker/?group_id=5470&atid=105470&func=detail&aid=1110478 > > > > F

Re: Convert from numbers to letters

2005-05-19 Thread Jason Drew
It seems strange to want to set the values in actual variables: a, b, c, ..., aa, ab, ..., aaa, ..., ... Where do you draw the line? A function seems more reasonable. "In terms of lines of code" here is my terse way of doing it: nrFromDg = lambda dg: sum(((ord(dg[x])-ord('a')+1) * (26 ** (len(dg

Re: Convert from numbers to letters

2005-05-19 Thread Jason Drew
We weren't really backwards; just gave a full solution to a half-stated problem. Bill, you've forgotten the least-lines-of-code requirement :-) Mine's still a one-liner (chopped up so line breaks don't break it): z = lambda cp: (int(cp[min([i for \ i in xrange(0, len(cp)) if \ cp[i].isdi

Re: Convert from numbers to letters

2005-05-19 Thread Jason Drew
Oh yeah, oops, thanks. (I mean the line continuations, not the alleged sin against man and nature, an accusation which I can only assume is motivated by jealousy :-) Or fear? They threw sticks at Frankenstein's monster too. And he turned out alright. My elegant "line" of code started out without t

Re: Convert from numbers to letters

2005-05-20 Thread Jason Drew
Er, yes! It's REALLY ugly! I was joking (though it works)! I retract it from the code universe. (But patent pending nr. 4040404.) Here's how I really would convert your (row_from_zero, col_from_zero) tuple to spreadsheet "A1" coords, in very simple and easy to read code. ##def tuple2coord(tupl):

Re: Convert from numbers to letters

2005-05-20 Thread Jason Drew
Sorry, scratch that "P.S."! The act of hitting Send seems to be a great way of realising one's mistakes. Of course you need colnr - m for those times when m is set to 26. Remembered that when I wrote it, forgot it 2 paragraphs later! -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert from numbers to letters

2005-05-20 Thread Jason Drew
Hey, that's good. Thanks Steve. Hadn't seen it before. One to use. Funny that Pythonwin's argument-prompter (or whatever that feature is called) doesn't seem to like it. E.g. if I have def f(tupl): print tupl Then at the Pythonwin prompt when I type f( I correctly get "(tupl)" in the argumen

Re: Intellisense and the psychology of typing

2005-05-26 Thread Jason Gurtz
ssion in this very NG about this WRT vim et al. Cheers, ~Jason -- Posted Via Usenet.com Premium Usenet Newsgroup Services -- ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY ** ---

creating lists based on parsed items

2007-06-06 Thread Jason White
Name + ' = []') print 'created ' + varName + 'as list' cmd2 = varName + '.append("' + items[0] + '")' print eval(cmd2) What I get back is: Traceback (most recent call last): File "./dict_2_slex.py&q

RE: creating lists based on parsed items

2007-06-07 Thread Jason White
Sorry ... one minor detail lacking. I'm saddled with Python 2.3.4 Jason -Original Message- From: [EMAIL PROTECTED] on behalf of Basilisk96 Sent: Wed 6/6/2007 6:49 PM To: python-list@python.org Subject: Re: creating lists based on parsed items > If you are using Python 2.

RE: creating lists based on parsed items

2007-06-07 Thread Jason White
x27;coulda had a V-8' moment. Wrapped it in a shell script that makes sure the files are removed at the outset. Many thanks, Jason -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gabriel Genellina Sent: Wednesday, June 06, 2007 5:38 PM To: pytho

Re: socket on cygwin python

2007-06-25 Thread Jason Tishler
I do if I want to use IPv6? > > I don't think Cygwin supports IPv6. That was my impression too and seems to be substantiated by the following: http://win6.jp/Cygwin/index.html Jason -- PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers Fingerprint: 7A73 1405 7F2

os.wait() losing child?

2007-07-10 Thread Jason Zheng
This may be a silly question but is possible for os.wait() to lose track of child processes? I'm running Python 2.4.4 on Linux kernel 2.6.20 (i686), gcc4.1.1, and glibc-2.5. Here's what happened in my situation. I first created a few child processes with Popen, then in a while(True) loop wait o

Re: os.wait() losing child?

2007-07-10 Thread Jason Zheng
Hate to reply to my own thread, but this is the working program that can demonstrate what I posted earlier: import os from subprocess import Popen pids = {} counts = [0,0,0] for i in xrange(3): p = Popen('sleep 1', shell=True, cwd='/home', stdout=file(os.devnull,'w')) pids[p.pid] = i

Re: os.wait() losing child?

2007-07-10 Thread Jason Zheng
greg wrote: > Jason Zheng wrote: >> while (True): >> pid = os.wait() >> ... >> if (someCondition): >> break > > ... > > Are you sure that someCondition() always becomes true > when the list of pids is empty? If not, you may end >

Re: os.wait() losing child?

2007-07-11 Thread Jason Zheng
Greg, That explains it! Thanks a lot for your help. I guess this is something they do to prevent zombie threads? ~Jason greg wrote: > Jason Zheng wrote: >> Hate to reply to my own thread, but this is the working program that >> can demonstrate what I posted earlier: >

Re: os.wait() losing child?

2007-07-11 Thread Jason Zheng
greg wrote: > Jason Zheng wrote: >> Hate to reply to my own thread, but this is the working program that >> can demonstrate what I posted earlier: > > I've figured out what's going on. The Popen class has a > __del__ method which does a non-blocking wait of

Re: os.wait() losing child?

2007-07-11 Thread Jason Zheng
Matthew Woodcraft wrote: > greg <[EMAIL PROTECTED]> wrote: >> I've figured out what's going on. The Popen class has a >> __del__ method which does a non-blocking wait of its own. >> So you need to keep the Popen instance for each subprocess >> alive until your wait call has cleaned it up. > > I d

Re: os.wait() losing child?

2007-07-11 Thread Jason Zheng
nyway to see if your children > exceed their time limits etc. I think your polling way works; it seems there no other way around this problem other than polling or extending Popen class. thanks, Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: os.wait() losing child?

2007-07-12 Thread Jason Zheng
Hrvoje Niksic wrote: >> greg wrote: > > Actually, it's not that bad. _cleanup only polls the instances that > are no longer referenced by user code, but still running. If you hang > on to Popen instances, they won't be added to _active, and __init__ > won't reap them (_active is only populated f

Re: Lists in classes

2007-07-12 Thread Jason Drew
://docs.python.org/tut/tut.html In particular see the section on classes: http://docs.python.org/tut/node11.html Note however that the tutorial doesn't show the current best practice of subclassing your classes from "object", i.e. class MyClass(object): #...etc... -Jason On Jul 12, 11:

Re: os.wait() losing child?

2007-07-12 Thread Jason Zheng
never > get called, causing a deadlock in that bit of code. > Are you talking about something like os.waitpid(os.getpid())? If the process has completed and de-zombified by another os.wait() call, I thought it would just throw an exception; it won't cause a deadlock by hanging th

Re: os.wait() losing child?

2007-07-13 Thread Jason Zheng
Hrvoje Niksic wrote: > Jason Zheng <[EMAIL PROTECTED]> writes: > >> Hrvoje Niksic wrote: >>>> greg wrote: >>> Actually, it's not that bad. _cleanup only polls the instances that >>> are no longer referenced by user code, but still running.

Re: os.wait() losing child?

2007-07-13 Thread Jason Zheng
Hrvoje Niksic wrote: > Jason Zheng <[EMAIL PROTECTED]> writes: >> I'm concerned about portability of my code. It will be run on >> multiple machines with mixed Python 2.4 and 2.5 environments. > > I don't think there is a really clean way to handle this.

Nasm_with_C++_with_Python

2007-07-31 Thread Jason Ward
I am wanting to write a library in nasm and call it from python. Because python can call c++ libraries. And nasm can be used in c++. So I was wondering how I would go about using nasm in python? -- http://mail.python.org/mailman/listinfo/python-list

Nasm_with_C++_With_Python

2007-07-31 Thread Jason Ward
I am interested in writing a library in Nasm and calling it from python. Python can call C++ libraries. Nasm can be made into an inc file and can be included in C++. So I was wondering if this combination is possible or if there is a better way. If it can be done please explain how I can do this.

Re: Parser Generator?

2007-08-22 Thread Jason Evans
gt; In Java, there are JavaCC, Antlr, etc. I wonder what people use > in Python? Antlr also has Python support but I'm not sure how good > it is. Comments/hints are welcome. I use Parsing.py. I like it a lot, probably because I wrote it. http://www.canonware.com/Parsing/ Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: Parser Generator?

2007-08-26 Thread Jason Evans
On Aug 24, 1:21 pm, "Jack" <[EMAIL PROTECTED]> wrote: > "Jason Evans" <[EMAIL PROTECTED]> wrote in message > >http://www.canonware.com/Parsing/ > > Thanks Jason. Does Parsing.py support Unicode characters (especially CJK)? > I'll take

Re: Python Eggs on Cygwin

2007-03-16 Thread Jason Tishler
. Does the MySQL Python module contain shared extension modules (i.e., DLLs)? If so, are they executable? If not, then make them so (i.e., chmod +x). Jason -- PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6 -- http://mail.python.org/mailman/listinfo/python-list

16bit RGB with Image module

2007-03-27 Thread Jason B
Hi all, I'm still new to all of this, but I'm trying to do something here that *seems* like it should be pretty simple. All I want to do is take an array of pixel data from a file (no header data or anything, just pixel data) in RGB565 format and save it off to a bitmap file - or display it, i

Re: 16bit RGB with Image module

2007-03-27 Thread Jason B
raw", "BGR;16") im.show() Although I have no idea *why* it works, other than the fact that I'm now using the correct number of bits per pixel. :) Anyone have thoughts on this? Thanks! J "Jason B" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROT

Re: simple regular expression problem

2007-09-17 Thread Jason Drew
grabbing everything between the first opening tag and the last closing tag. The question mark says, don't be greedy, and you get the behaviour you need. This is covered in the documentation for the re module. http://docs.python.org/lib/module-re.html Jason On Sep 17, 9:00 am, duikboot

Re: simple regular expression problem

2007-09-17 Thread Jason Drew
You're welcome! Also, of course, parsing XML is a very common task and you might be interested in using one of the standard modules for that, e.g. http://docs.python.org/lib/module-xml.parsers.expat.html Then all the tricky parsing work has been done for you. Jason On Sep 17, 9:

Re: greatest and least of these...

2007-10-23 Thread Jason Drew
for a bit more inspection. Speaking of which, you should probably be using something like "int(raw_input())" instead of just "input()" - if you read the help on the two functions you should see why. Hope this helps. Jason On Oct 23, 11:56 am, Shawn Minisall <[EMAIL PROTECTED]&

Re: sys.path issue in cygwin

2007-01-24 Thread Jason Tishler
is > that when you run a program python can't find the module. So what I > really want to know is where these path came from and how to fix it. Why not use the Python that is part of the standard Cygwin distribution? Jason -- PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or k

Re: sys.path issue in cygwin

2007-01-24 Thread Jason Tishler
x27;] > But finally I found the solution, the PYTHONHOME environment variable > controls the content of initial sys.path. Thanks anyway. > export PYTHONHOME=/usr/localWang Shuhao IMO, the above is just a workaround, not a solution. Jason -- PGP/GPG Key: http://www.tishler.net/jason/pub

python-list@python.org

2007-01-30 Thread Jason Persampieri
Sadly, the group is tied to Python 2.3 for now. Actually, I got around this problem by using an intermediate process that happens to handle output on its own (bsub). On 1/30/07, Chris Lambacher <[EMAIL PROTECTED]> wrote: The subprocess module is probably a good starting point: http://docs.pyth

Dlls

2007-02-18 Thread Jason Ward
Hi. I am interested to know why python can't access DLL files directly. It seems to me that because python can't access DLL's directly we have to waste our time and write wrappers around libraries that have already been written. So if the python developers were to implement say this. import MYDL

Pixel Array => Bitmap File

2007-02-27 Thread Jason B
Hi all, I'm somewhat new to Python and I'm trying to figure out the best way to accomplish the following: >From an array of pixel data in an XML file (given the format, width and height of the image as attributes) I must read in the data and save it off as a bmp file. I've gotten the PIL and

Re: Pixel Array => Bitmap File

2007-02-27 Thread Jason B
Thanks, Roel... The Image.frombuffer() method looks promising, but the "mode" parameter seems a bit too limited for my needs. I must be able to specify not only the order of the bits (RGB in any order) but also whether the format is 565, 555, etc. Maybe I need to work outside the bounds of PI

Re: Pixel Array => Bitmap File

2007-02-27 Thread Jason B
My mistake, I see the section now about "Writing Your Own File Decoder..." Thanks again for your help! - J "Jason B" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thanks, Roel... > > The Image.frombuffer() method looks promising, but the

Re: Problem building extension under Cygwin (ImportError: Bad address)

2006-05-04 Thread Jason Tishler
hello.dll Hello, 0 Hello, 1 Hello, 2 Note I had to apply the attached patch to get hello.c to compile. Jason -- PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6 --- hello.c.orig2006-05-04 0

Re: Problem building extension under Cygwin (ImportError: Bad address)

2006-05-04 Thread Jason Tishler
Hello, 1 Hello, 2 BTW, if you use Distutils, then it will just work... Jason -- PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6 -- http://mail.python.org/mailman/listinfo/python-list

monkeypatching NamedTemporaryFile

2006-05-25 Thread Jason Lunz
) def quiet_del(): try: tf.close() except OSError: pass tf.__del__ = quiet_del return tf Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: monkeypatching NamedTemporaryFile

2006-05-27 Thread Jason Lunz
cation. If any error occurs prior to the rename, NamedTemporaryFile takes care of deleting the tempfile on the error path. But in the success case, NamedTemporaryFile causes an unsightly "ignored exception" message on stderr when it fails to unlink the now-nonexistent tempfile.

Re: standalone python web server

2007-12-27 Thread Jason Earl
tails like processing image file, different file type(like FLV) .. > etc. Any recommendation or tools suggested for me? CherryPy has a built in web server that can be installed without admin rights (it is pure Python), and can easily be configured to serve up static files. Just someth

Klik2 Project, Python apps on linux

2008-01-26 Thread Jason Taylor
o fix this in a clean way with out resorting to nasty hacks involving $PYTHON_PATH. If any one has any suggestions please email me or drop by #klik on freenode Issue http://code.google.com/p/klikclient/issues/detail?id=144 Cheers Jason Taylor -- "Why isn't my life like a situation c

Re: Klik2 Project, Python apps on linux

2008-01-27 Thread Jason Taylor
Perhaps this would help, heres a list of our error reports http://klik.atekon.de/feedback/details.php?e=ImportError On 27/01/2008, Jason Taylor <[EMAIL PROTECTED]> wrote: > > Hi > > We've been working on klik2, http://code.google.com/p/klikclient/, which > implements OSX

Re: multiplication of lists of strings

2008-03-04 Thread Jason Galyon
Gabriel Genellina wrote: > En Tue, 04 Mar 2008 23:50:49 -0200, Jason <[EMAIL PROTECTED]> escribió: > >> How could I return a list or tuple of each unique combination of a given >> set of lists (perhaps from a dict or a list). This means the number of >> lists are

Re: Pystemmer 1.0.1 installation problem in Linux

2008-03-27 Thread Jason Scheirer
On Mar 27, 8:40 am, mungkol <[EMAIL PROTECTED]> wrote: > Dear all, > > I am a newbie to Python community. For my project, I tried to install > Pystemmer 1.0.1 (http://snowball.tartarus.org/wrappers/ > PyStemmer-1.0.1.tar.gz) on my linux ubuntu 7.10 machine but > unsuccessful. It produced the follow

Re: Time problem (again)

2008-03-27 Thread Jason Scheirer
On Mar 27, 12:17 pm, "Fabio Durieux Lopes" <[EMAIL PROTECTED]> wrote: >Hi, > >I'm recreating a date-time based on a string and I have a problem > when daylight savings time is set (I'm off by 1). So today I forced > my computer into daylight savings time and debugged it again, but > this ti

How do I reconnect a disconnected socket?

2008-03-28 Thread Jason Kristoff
I'm trying to make something that once it is disconnected will automatically try to reconnect. I'll add some more features in later so it doesn't hammer the server but right now I just want to keep it simple and get that part working. The problem is that when I use sock.close I get an error m

Re: spawning pyhon apps...

2009-01-09 Thread Jason Scheirer
On Jan 9, 3:43 pm, "bruce" wrote: > hi jason > > forgive me... but in your sample: >         my_popenobjects = [subprocess.Popen("foo.py", "--filename=file >         %i.txt"%x) for x in xrange(10)] > are you spawning 'foo.py' 10 times

Re: spawning pyhon apps...

2009-01-09 Thread Jason Scheirer
On Jan 9, 4:07 pm, "bruce" wrote: > thanks jason > > or i could also, simply iterate through a loop of the names of the "child > processes" i want to spawn, using the names in the subprocess.popen, and > then proceeding with the rest of your example.. >

Re: the name of a method

2009-01-15 Thread Jason Scheirer
On Jan 15, 8:37 am, "Diez B. Roggisch" wrote: > thomas.steffe...@googlemail.com wrote: > > Hello, > > > I have a Class: > > > class myClass: > >     def __init__(self): > >         # do something > >         print "name of class = " +  self.__class__.__name__ > > >     def myMethod(self): > >    

Re: is None vs. == None

2009-01-23 Thread Jason Scheirer
On Jan 23, 12:48 pm, Roger wrote: > > And, just for completeness, the "is" test is canonical precisely because > > the interpreter guarantees there is only ever one object of type None, > > so an identity test is always appropriate. Even the copy module doesn't > > create copies ... > > Does the i

Re: What is wrong in my list comprehension?

2009-02-02 Thread Jason Scheirer
On Feb 1, 3:37 am, Peter Otten <__pete...@web.de> wrote: > Hussein B wrote: > > Hey, > > I have a log file that doesn't contain the word "Haskell" at all, I'm > > just trying to do a little performance comparison: > > ++ > > from datetime import time, timedelta, datetime > > start = dat

Re: Flattening lists

2009-02-05 Thread jason-sage
follow this documentation) The implementation: http://www.sagemath.org/hg/sage-main/file/b0aa7ef45b3c/sage/misc/flatten.py Jason -- http://mail.python.org/mailman/listinfo/python-list

Running all unit tests

2009-02-06 Thread Jason Voegele
ograms? I'm sure I could write a shell script (or a Python script even) that scans my "test" directory for test cases and runs them, but I'm wondering if there's something already built in that could do this for me. -- Jason Voegele Only fools are quoted. -- Anonymous -- http://mail.python.org/mailman/listinfo/python-list

Re: Running all unit tests

2009-02-07 Thread Jason Voegele
Ben Finney wrote: > Jason Voegele writes: > >> What's the recommended approach for Python programs? I'm sure I >> could write a shell script (or a Python script even) that scans my >> "test" directory for test cases and runs them, but I'm wonder

Re: A little bit else I would like to discuss

2009-02-12 Thread Jason Scheirer
On Feb 12, 12:04 pm, azrael wrote: > Sometimes I really get confused when looking out for a modul for some > kind of need. Sometimes I get frightened when I get the resaults. 8 > wraper for this, 7 wrapers for that, 10 modules for anything. Between > them are maybe some kind of small differences,

Re: Upgrading standard library module

2009-02-13 Thread Jason Scheirer
On Feb 13, 12:42 pm, Bryan wrote: > I have a Python v2.5.2 server running and I found some undesirable > behavior in the xmlrpclib module that is included with that version of > Python.  The xmlrpclib version that is included with Python 2.6 > changes the behavior for the better.  I nervous about

Re: error while importing os

2009-02-15 Thread Jason Scheirer
On Feb 15, 12:38 pm, karan wrote: > Hi, > > Iam new to python i see the following when iam in the python shell and > i try to import os,though i can import the sys and sys.path does > contain the path to the python binary or the folder where the python > binaries reside: > > Traceback (most recent

Re: flexible find and replace ?

2009-02-16 Thread Jason Scheirer
On Feb 16, 12:10 pm, OdarR wrote: > Hi guys, > > how would you do a clever find and replace, where the value replacing > the tag > is changing on each occurence ? > > "...TAGTAGTAG..TAG." > > is replaced by this : > > "...REPL01REPL02

Re: wxPython and Croatian characters

2009-02-16 Thread Jason Scheirer
On Feb 16, 10:58 am, vedrandeko...@gmail.com wrote: > Hello, > > I have problem with configuring my wxPython script to work with > Croatian characters like:  ð,¹,¾,è,æ. > Here is my simple script without wxPython (this script works): > >       # -*- coding: utf-8 -*- >       s = "hello normal strin

Re: initialized list: strange behavior

2008-11-24 Thread Jason Scheirer
On Nov 24, 10:34 pm, [EMAIL PROTECTED] wrote: > Hi Python experts! Please explain this behavior: > > >>> nn=3*[[]] > >>> nn > [[], [], []] > >>> mm=[[],[],[]] > >>> mm > > [[], [], []] > > Up till now, 'mm' and 'nn' look the same, right? Nope! > > >>> mm[1].append(17) > >>> mm > [[], [17], []] > >>

Re: Is it possible (and wise) to extend the None-type ?

2008-11-26 Thread Jason Scheirer
On Nov 26, 11:40 am, Terry Reedy <[EMAIL PROTECTED]> wrote: > Stef Mientki wrote: > > hello, > > > I've the idea that I always have a lot of useless code in my programs, > > like the next example. > > >  def _On_Menu_File_Open ( self, event = None ): > >    if event : > >     event.Skip () > > > in

Re: Multiple Versions of Python on Windows XP

2008-12-02 Thread Jason Scheirer
On Dec 1, 4:49 pm, "Colin J. Williams" <[EMAIL PROTECTED]> wrote: > Could anyone please point me to > documentation on the way the msi > installer handles multiple versions eg. > Python 2.5, 2.6 and 3.0? > > What changes are made to the registry? > > Is there some way to specify a default > version

Re: Mathematica 7 compares to other languages

2008-12-03 Thread jason-sage
s a little old, but it gives you an idea of how things compare. Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: Overriding a method at the instance level on a subclass of a builtin type

2008-12-03 Thread Jason Scheirer
On Dec 2, 6:13 pm, Aaron Brady <[EMAIL PROTECTED]> wrote: > On Dec 2, 6:58 pm, "Zac Burns" <[EMAIL PROTECTED]> wrote: > > > > > Sorry for the long subject. > > > I'm trying to create a subclass dictionary that runs extra init code > > on the first __getitem__ call. However, the performance of __get

Re: Mathematica 7 compares to other languages

2008-12-04 Thread jason-sage
Xah Lee wrote: alright, here's my improved code, pasted near the bottom. let me say a few things about Jon's code. If we rate that piece of mathematica code on the level of: Beginner Mathematica programer, Intermediate, Advanced, where Beginner is someone who just learned tried to program Mathe

Re: Python is slow

2008-12-10 Thread Jason Scheirer
On Dec 10, 10:42 am, cm_gui <[EMAIL PROTECTED]> wrote: > http://blog.kowalczyk.info/blog/2008/07/05/why-google-should-sponsor-... > > I fully agree with Krzysztof Kowalczyk . > Can't they build a faster VM for Python since they love the language > so much? > > Python is SLOW.    And I am not compar

Re: newbie question: if var1 == var2:

2008-12-11 Thread Jason Scheirer
On Dec 11, 3:49 pm, John Machin wrote: > On Dec 12, 10:31 am, "Rhodri James" > wrote: > > > > > On Thu, 11 Dec 2008 19:49:23 -, Steve Holden   > > wrote: > > > > Kirk Strauser wrote: > > >> At 2008-11-29T04:02:11Z, Mel writes: > > > >>> You could try > > > >>> for item in fname: > > >>>    

Re: AIM client code for Python?

2008-12-16 Thread Jason Scheirer
On Dec 16, 9:54 am, Joe Strout wrote: > I'd like to write an AIM bot in Python.  I found and tried > , but it doesn't work for me: > > Connecting... > Traceback (most recent call last): >    File "aimbot-1.py", line 17, in >      bot.go() >    File "/Users/jstrout/Do

Re: WinMerge--B/W Shading of Printed Copy to Show Differences?

2008-12-16 Thread Jason Scheirer
On Dec 16, 3:56 pm, "W. eWatson" wrote: > Is there a way to highlight differences between the two files when printing > in b/w? Help suggests there may be some texturing, but all I see is color > choices. > -- >                                 W. eWatson > >               (121.015 Deg. W, 39.262 D

Re: Is this pythonic?

2008-12-18 Thread Jason Scheirer
On Dec 18, 8:45 am, prueba...@latinmail.com wrote: > On Dec 18, 11:08 am, ipyt...@gmail.com wrote: > > > x.validate_output(x.find_text(x.match_filename > > (x.determine_filename_pattern(datetime.datetime.now() > > > Is it even good programming form? > > Lisp and Scheme programmers love that sty

Re: [Haskell-cafe] Initializing GHC from Python

2008-12-23 Thread Jason Dusek
I upmodded this on Reddit. Thank you for your work. -- Jason Dusek -- http://mail.python.org/mailman/listinfo/python-list

Re: Why not Ruby?

2009-01-01 Thread Jason Rumney
On Jan 1, 3:12 pm, r wrote: > The man lives in a world driven by common sense "Common" sense suggests that his views are shared among the general populace. I don't see much evidence of that in the sometimes never- ending threads that frequently follow his postings. But it is good to start debate

Re: #python IRC help - my internet provider is banned!

2009-01-08 Thread Jason Ribeiro
I am not a #python operator, but do note that #python is +r so you must be registered and identified to join the channel, see http://freenode.net/faq.shtml#userregistration . Otherwise, giving the exact ban that is affecting you or your hostmask would probably be helpful to the operators. On Wed

Re: spawning pyhon apps...

2009-01-09 Thread Jason Scheirer
On Jan 9, 2:47 pm, "bruce" wrote: > hi... > > toying with an idea.. trying to figure out a good/best way to spawn multiple > python scripts from a parent python app. i'm trying to figure out how to > determine when all child apps have completed, or to possibly determine if > any of the child proce

Re: how can we send keys to keyboard

2008-10-07 Thread Jason Scheirer
On Oct 7, 9:28 am, mhangman <[EMAIL PROTECTED]> wrote: > On 7 Ekim, 18:57, Mike Driscoll <[EMAIL PROTECTED]> wrote: > > > > > On Oct 7, 10:42 am, mhangman <[EMAIL PROTECTED]> wrote: > > > > On 7 Ekim, 18:34, Mike Driscoll <[EMAIL PROTECTED]> wrote: > > > > > On Oct 7, 10:13 am, mhangman <[EMAIL PRO

Re: Safe eval of insecure strings containing Python data structures?

2008-10-09 Thread Jason Scheirer
On Oct 9, 9:01 am, Paul Rubin wrote: > Lie Ryan <[EMAIL PROTECTED]> writes: > > in python 2.6, ast.literal_eval may be used to replace eval() for > > literals. > > What happens on literal_eval('[1]*9') ? The documentation clearly states that it will fail to evalu

Re: replace mothod for only one object but not for a class

2008-10-14 Thread Jason Scheirer
On Oct 14, 11:20 am, George Sakkis <[EMAIL PROTECTED]> wrote: > On Oct 14, 1:50 pm, hofer <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > I have multiple objects all belonging to the same class > >  (which I didn't implement and whose code I don't want to modify) > > > Now I'd like to change one met

Re: Does python is suitable for enterprise cluster management?

2008-11-17 Thread Jason Scheirer
On Nov 16, 8:56 am, Asaf Hayman <[EMAIL PROTECTED]> wrote: > Is anyone familiar or aware of a successful enterprise class project > in Python to control and monitor a cluster of computers? > > As a part of a bigger project my company needs to build a cluster > management system. The aim of the syst

<    3   4   5   6   7   8   9   10   11   >