Re: Trying to choose between python and java

2007-07-13 Thread James T. Dennis
Hamilton, William <[EMAIL PROTECTED]> wrote: >> From: Beliavsky > On May 15, 1:30 am, Anthony Irwin <[EMAIL PROTECTED]> wrote: >> >>> #5 someone said that they used to use python but stopped because the >>> language changed or made stuff depreciated (I can fully remember >>> which) and old code

Re: Subprocess with and without shell

2007-06-29 Thread James T. Dennis
George Sakkis <[EMAIL PROTECTED]> wrote: > On May 15, 5:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: >> George Sakkis <[EMAIL PROTECTED]> wrote: >>> I'm trying to figure out why Popen captures the stderr of a specific >>> command when it runs through the shell but not without it. IOW: >>>

Re: Re printing on same line.

2007-06-19 Thread James T. Dennis
Robert Bauck Hamar <[EMAIL PROTECTED]> wrote: > Jerry Hill wrote: >> On 6/15/07, HMS Surprise <[EMAIL PROTECTED]> wrote: >>> I want to print a count down timer on the same line. I tried >>> print '\r', timeLeft, >>> which just appends to the same line. >> Sounds to me like whatever you're p

Re: how to kill a process

2007-06-12 Thread James T. Dennis
Richard Rossel <[EMAIL PROTECTED]> wrote: > Hi Fellows, > I have a problem with process termination. I have a python code that > apache runs through a django interface. > The code is very simple, first, it creates a process with the > subprocess.Popen call, and afterwards, (using a web request) the

Re: Convert String to Int and Arithmetic

2007-06-12 Thread James T. Dennis
tereglow <[EMAIL PROTECTED]> wrote: > Hello, > I am a complete newbie to Python and am accustomed to coding in PHP/ > Perl/Shell. I am trying to do the following: > I have a string: > cpuSpeed = 'Speed: 10' > What I would like to do is extract the '10' from the string, > and di

Re: logging module and threading

2007-06-12 Thread James T. Dennis
Ross Boylan <[EMAIL PROTECTED]> wrote: > I would like my different threads to log without stepping on each > other. > Past advice on this list (that I've found) mostly says to send the > messages to a Queue. That would work, but bypasses the logging > module's facilities. > The logging module it

Re: Dynamic subclassing ?

2007-06-10 Thread James T. Dennis
Karlo Lozovina <[EMAIL PROTECTED]> wrote: > manatlan wrote: >> I can't find the trick, but i'm pretty sure it's possible in an easy >> way. > It's somewhat easy, boot looks ugly to me. Maybe someone has a more > elegant solution: > In [6]: import new > In [13]: class Button: >: def

Re: need help with python

2007-06-10 Thread James T. Dennis
[EMAIL PROTECTED] wrote: > On May 11, 10:16 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: >> On May 11, 9:41 pm, [EMAIL PROTECTED] wrote: [... much ellided ...] ["ellided" is a fancy word for "left out" or "replaced with ellipses."] > I was looking around in my Python folder and

Re: PyGTK : a NEW simple way to code an app

2007-06-09 Thread James T. Dennis
manatlan <[EMAIL PROTECTED]> wrote: > I was a fan of "SimpleGladeApp/tepache way" to build a pygtk app. > I've build a new efficient/dynamic way to build a pygtk app ... > Here is an example : > = > class Fen(GladeApp): >""" >Window win >

Re: 4 byte integer

2007-06-09 Thread James T. Dennis
Paul D Ainsworth <[EMAIL PROTECTED]> wrote: > Greetings everyone. I'm a relative newcomer to python and I have a technical > problem. > I want to split a 32 bit / 4 byte unsigned integer into 4 separate byte > variables according to the following logic: - > bit numbers 0..7 byte 1 > bit numbers

Re: How Can I Increase the Speed of a Large Number of Date Conversions

2007-06-07 Thread James T. Dennis
Some Other Guy <[EMAIL PROTECTED]> wrote: > vdicarlo wrote: >> I am a programming amateur and a Python newbie who needs to convert >> about 100,000,000 strings of the form "1999-12-30" into ordinal dates >> for sorting, comparison, and calculations. Though my script does a ton >> of heavy calculati

Re: Newbie question about string(passing by ref)

2007-05-30 Thread James T. Dennis
Duncan Booth <[EMAIL PROTECTED]> wrote: > lazy <[EMAIL PROTECTED]> wrote: >> I want to pass a string by reference. I understand that strings are >> immutable, but Im not >> going to change the string in the function, just to aviod the overhead >> of copying(when pass-by-value) because the >> strin

Re: Newbie question about string(passing by ref)

2007-05-30 Thread James T. Dennis
Steven D'Aprano <[EMAIL PROTECTED]> wrote: ... > Python does NOT support pass by reference. Nor does it do pass by value. > Both of those models might describe what other languages do, but they > don't describe what Python does. > Python's passing model is different from both pass by reference

Re: append

2007-05-25 Thread James T. Dennis
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > HMS Surprise a ?crit : >> Trying not to be a whiner but I sure have trouble finding syntax in >> the reference material. I want to know about list operations such as >> append. > The only thing you have to know is that it doesn't exists. Python >

Re: python shell

2007-05-16 Thread James T. Dennis
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On May 16, 12:38 pm, Krypto <[EMAIL PROTECTED]> wrote: >> I have been using python shell to test small parts of the big program. >> What other ways can I use the shell effectively. My mentor told me >> that you can virtually do anything from testing yo

Re: How to do basic CRUD apps with Python

2007-05-14 Thread James T. Dennis
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > walterbyrd a ?crit : >> With PHP, libraries, apps, etc. to do basic CRUD are everywhere. Ajax >> and non-Ajax solutions abound. >> With Python, finding such library, or apps. seems to be much more >> difficult to find. >> I thought django might be

Re: Hello gettext

2007-05-14 Thread James T. Dennis
James T. Dennis <[EMAIL PROTECTED]> wrote: ... just to follow-up my own posting --- as gauche as that is: > You'd think that using things like gettext would be easy. Superficially > it seems well documented in the Library Reference(*). However, it can > be surprisingly

Hello gettext

2007-05-14 Thread James T. Dennis
You'd think that using things like gettext would be easy. Superficially it seems well documented in the Library Reference(*). However, it can be surprisingly difficult to get the external details right. * http://docs.python.org/lib/node738.html Here's what I finally came up with a

Re: file uploader

2007-05-14 Thread James T. Dennis
Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Sun, 13 May 2007 18:41:16 -0300, Sick Monkey <[EMAIL PROTECTED]> > escribi?: >> If anyone has a simpler way of checking to see if >> a file already exists (prior to uploading to a server) and renaming it, >> please let me know. > I will ignore t

Re: track cpu usage of linux application

2007-05-14 Thread James T. Dennis
Fabian Braennstroem <[EMAIL PROTECTED]> wrote: > Hi, >I would like to track the cpu usage of a couple of >programs using python. Maybe it works somehow with >piping 'top' to python read the cpu load for a greped >application and clocking the the first and last >appearence. Is t

Re: Change serial timeout per read

2007-05-13 Thread James T. Dennis
[EMAIL PROTECTED] wrote: > I'm writing a driver in Python for an old fashioned piece of serial > equipment. Currently I'm using the USPP serial module. From what I can > see all the serial modules seem to set the timeout when you open a > serial port. This is not what I want to do. I need to change

Re: Simple Python REGEX Question

2007-05-12 Thread James T. Dennis
johnny <[EMAIL PROTECTED]> wrote: > I need to get the content inside the bracket. > eg. some characters before bracket (3.12345). > I need to get whatever inside the (), in this case 3.12345. > How do you do this with python regular expression? I'm going to presume that you mean something like:

mmap thoughts

2007-05-11 Thread James T. Dennis
I've been thinking about the Python mmap module quite a bit during the last couple of days. Sadly most of it has just been thinking ... and reading pages from Google searches ... and very little of it as been coding. Mostly it's just academic curiosity (I might be teaching an "overview of

Re: Minor bug in tempfile module (possibly __doc__ error)

2007-05-10 Thread James T. Dennis
Marc Christiansen <[EMAIL PROTECTED]> wrote: > James T. Dennis <[EMAIL PROTECTED]> scribis: >> In fact I realized, after reading through tempfile.py in /usr/lib/... >> that the following also doesn't "work" like I'd expect: >># foo.py

Re: Minor bug in tempfile module (possibly __doc__ error)

2007-05-09 Thread James T. Dennis
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, James T. Dennis wrote: >> Tonight I discovered something odd in the __doc__ for tempfile >> as shipped with Python 2.4.4 and 2.5: it says: >> >> This

Re: Minor bug in tempfile module (possibly __doc__ error)

2007-05-09 Thread James T. Dennis
Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Wed, 09 May 2007 06:50:38 -0000, "James T. Dennis" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: >> In fact I realized, after reading through tempfile.py in /usr/lib/... >> that th

Minor bug in tempfile module (possibly __doc__ error)

2007-05-08 Thread James T. Dennis
Tonight I discovered something odd in the __doc__ for tempfile as shipped with Python 2.4.4 and 2.5: it says: This module also provides some data items to the user: TMP_MAX - maximum number of names that will be tried before giving up. templat