Re: win32service and Python

2008-08-13 Thread Aspersieman
David wrote: > I am collecting informations about win32 services for Python but, except for > few basic examples about Mark Hammond's win32serviceutil, I found nothing > useful. > > Any link is welcome. > > Thank you. > David > > This might also be useful: http://support.microsoft.com/kb/137

Re: os.system question

2008-08-13 Thread Fredrik Lundh
Kevin Walzer wrote: I'm also skeptical of the value of subprocess, at least as a complete replacement for os.popen (the original version): it currently provides no way to set a 'non-blocking' mode. I make heavy use of this kind of call in my code: self.file = os.popen('do stuff here'), 'r',

Re: Replace Several Items

2008-08-13 Thread Fredrik Lundh
John Machin wrote: Clue: The effbot was the original author of the modern (Python 1.6?) version of the re module. And the author of the "in" and "replace" implementations in Python 2.5. -- http://mail.python.org/mailman/listinfo/python-list

Re: Replace Several Items

2008-08-13 Thread Fredrik Lundh
Steven D'Aprano wrote: > While I'm gratified that my prediction was so close to the results I > found, I welcome any suggestions to better/faster/more efficient code. > more things to try: code tweaks: - Factor out the creation of the regular expression from the tests: "escape" and "compile" a

Re: Upgrading to DB-API (was Re: Corrupted images ...)

2008-08-13 Thread Jake Anderson
Aahz wrote: In article <[EMAIL PROTECTED]>, Fredrik Lundh <[EMAIL PROTECTED]> wrote: Ouch. Please use parameters instead of explicit escapes and string formatting; Python's not PHP. How would you recommend upgrading an application that is more than ten years old and contains somethin

Re: Using Timer or Scheduler in a Class

2008-08-13 Thread Steven D'Aprano
Hi Justin, Does Professor Battersea know you're using his gmail account? *wink* On Wed, 13 Aug 2008 23:16:12 -0400, Prof. William Battersea wrote: > I'd like a class method to fire every n seconds. > > I tried this: > > class Timed: > def.__init__(self): > self.t = Timer(3, self.d

Re: Why nested scope rules do not apply to inner Class?

2008-08-13 Thread Steven D'Aprano
On Wed, 13 Aug 2008 23:40:50 -0400, Calvin Spealman wrote: > I know every rule has its exceptions. I put "don't nest classes" in with > other similar rules I will claim, where I think its safest to say "Never > do this!", because only then will you know that, should you actually do > it at some po

Re: Using Timer or Scheduler in a Class

2008-08-13 Thread Rob Weir
On 14 Aug 2008, William Battersea wrote: > Both run once and end. I'm obviously missing something here. That's how both ('sched' and threading.Timer) of the them work. Depending on what you're doing, your toolkit/framework (Twisted, GTK, etc) might have a better solution. Or http://www.gossamer-t

Re: An FTP Client...My first real program!

2008-08-13 Thread Python Nutter
sorry cut off due to original email being sent not to the list due to gmail: A second for that suggestion--the ftp module in the python standard library is very low level and not very useful for beginners as a lot of the heavy lifting and management is still left up to you, the programmer. 2008/8

Re: An FTP Client...My first real program!

2008-08-13 Thread Python Nutter
ery low level and not very useful for beginners as a lot of the heavy lifting and management is still left up to you, the programmer. The module ftputil is a high-level interface to the ftplib module. The FTPHost objects generated from it allow many operations similar to those of os and os.path. A

Re: Replace Several Items

2008-08-13 Thread Steven D'Aprano
On Thu, 14 Aug 2008 01:54:55 +, Steven D'Aprano wrote: > In full knowledge that Python is relatively hard to guess what is fast > compared to what is slow, I'll make my guess of fastest to slowest: > > 1. repeated replace > 2. repeated use of the form >"if ch in my_string: my_string = my_

Re: Why nested scope rules do not apply to inner Class?

2008-08-13 Thread Calvin Spealman
On Wed, Aug 13, 2008 at 10:49 PM, Carl Banks <[EMAIL PROTECTED]> wrote: >> There is no point of nested classes because nested classes _are not_ >> supported by python. They are simply an artifact of not actively >> denying the syntax non-globally. I would fully support a change to the >> language t

Using Timer or Scheduler in a Class

2008-08-13 Thread Prof. William Battersea
I'd like a class method to fire every n seconds. I tried this: class Timed: def.__init__(self): self.t = Timer(3, self.dothing) def.start(self): self.t.start() def.dothing(self): print "Doing Thing" s = new Timed() s.start() And: class Scheduled: def._

Tkinter tab focus traversal causes listbox selection to clear,ie, lose the selected item

2008-08-13 Thread Gerardo ARnaez
Hi. I am writing a program to help determine coumadin regimens to look at the code: http://sourceforge.net/projects/coumadinregimen/ The issue is that I have a variable that I want the use to select if they don't like the default. I have made this as a listbox widget The rest of the gui is just e

Re: Why nested scope rules do not apply to inner Class?

2008-08-13 Thread Carl Banks
On Aug 13, 11:38 am, "Calvin Spealman" <[EMAIL PROTECTED]> wrote: > On Wed, Aug 13, 2008 at 11:32 AM, Cousson, Benoit <[EMAIL PROTECTED]> wrote: > >> Defining it as a nested class saves you one line > >> of code, but IMHO makes the result just a bit more cluttered, while > >> reducing the elegance

Re: Random Problems

2008-08-13 Thread Cousin Stanley
> list_songs = glob.glob( "'%s/%s'" % ( base_dir , this_dir ) Missed a closing paren list_songs = glob.glob( "'%s/%s'" % ( base_dir , this_dir ) ) Still NOT Tested -- Stanley C. Kitching Human Being Phoenix, Arizona -- http://mail.python.org/mailman/listinfo/python-list

Cannot download SendKeys module

2008-08-13 Thread pcslen
Hi All I wanted to try WATSUP module and it states that it needs the module SendKeys. I cannot get the the URL www.rutherfurd.net/python/sendkeys/. Does anyone have a copy of the install or what ever that I can install or tell me where I can find it. Thanks Len -- http://mail.python.org/mailman

RE: Random Problems

2008-08-13 Thread Edwin . Madari
use songs.extend( asongs ) #append is for single item - where ever it might be. >>> l1 = range(5) >>> l2 = range(5,10) >>> l1 [0, 1, 2, 3, 4] >>> l2 [5, 6, 7, 8, 9] >>> l1.extend(l2) >>> l1 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> good luck. Edwin -Original Message- From: [EMAIL PROT

Re: Random Problems

2008-08-13 Thread Cousin Stanley
> Well the othe day I was making a program to make a list > of all the songs in certian directorys but I got a problem, > only one of the directorys was added to the list. > > Here's some code that illustrates yours import glob songs = glob.glob( '/path/to/somewhere/*.mp3'

Re: Replace Several Items

2008-08-13 Thread Steven D'Aprano
On Wed, 13 Aug 2008 22:50:29 +, Wojtek Walczak wrote: > Dnia Thu, 14 Aug 2008 00:31:00 +0200, Fredrik Lundh napisa³(a): > if ch in my_string: my_string = my_string.replace(ch, "") on representative data. >>> >>> I don't have to, I can anticipate the results

Upgrading to DB-API (was Re: Corrupted images ...)

2008-08-13 Thread Aahz
In article <[EMAIL PROTECTED]>, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > >Ouch. Please use parameters instead of explicit escapes and string >formatting; Python's not PHP. How would you recommend upgrading an application that is more than ten years old and contains something like 100K lines o

Re: Suggestion for improved ImportError message

2008-08-13 Thread Kent Tenney
> > Then go for it You can prepare a patch and ask on python-dev > > if the developers are interested. hehe, I'll get a C level patch accepted right after I out-swim Mike Phelps. > > > > I was never hacking the import things on C level before, > > but a hint: you have to modify import_from func

Re: Python packages on the Mac

2008-08-13 Thread arunasunil
On Aug 5, 5:33 am, Jeff <[EMAIL PROTECTED]> wrote: > On Aug 4, 11:20 pm, [EMAIL PROTECTED] wrote: > > > Hi, > > > I would like to copy the contents of the PythonFramework.pkg folder > > and run python without having to run the installer on the Mac. On > > windows it's simple to copy the contents of

Re: An FTP Client...My first real program!

2008-08-13 Thread s0suk3
On Aug 13, 2:27 pm, tmallen <[EMAIL PROTECTED]> wrote: > Here's the code:http://pastebin.com/m21dfcc19 > > What could be improved? The script feels clumsy, and I have no > experience refactoring Python code. This will eventually be a GUI FTP > client. I'm mainly looking for design advice... Well o

Re: Python packages on the Mac

2008-08-13 Thread arunasunil
On Aug 5, 5:33 am, Jeff <[EMAIL PROTECTED]> wrote: > On Aug 4, 11:20 pm, [EMAIL PROTECTED] wrote: > > > Hi, > > > I would like to copy the contents of the PythonFramework.pkg folder > > and run python without having to run the installer on the Mac. On > > windows it's simple to copy the contents of

Re: Why nested scope rules do not apply to inner Class?

2008-08-13 Thread Maric Michaud
Calvin Spealman a écrit : On Wed, Aug 13, 2008 at 7:41 PM, Maric Michaud <[EMAIL PROTECTED]> wrote: I was not aware of any "nested classes are unsupported" before and didn't consider nested classes as bad practice till now, even with the pickle limitation (not every class are intended to be pick

Read from serial port

2008-08-13 Thread mmrasheed
Hi, I am newbie in python. I am working on Telit GM862 GPS/GPRS module which has python interpreter built in. But it seems this problem is pretty much related to general python structure. I need a promt/terminal when the device is connected to PC. If user enters a command by serial port and press

Re: any function to fill zeros to the right?? zfill??

2008-08-13 Thread Christian Heimes
Johnny wrote: if I want to fill zeros to the right, what function can help?? ex: '1.23'=>'1.2300' but '1.23'.zfill(6)=>'001.23' Use string formatting: >>> "%0.6f" % 1.5 '1.50' Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: any function to fill zeros to the right?? zfill??

2008-08-13 Thread s0suk3
On Aug 13, 7:48 pm, Johnny <[EMAIL PROTECTED]> wrote: > if I want to fill zeros to the right, what function can help?? > ex: > '1.23'=>'1.2300' > but '1.23'.zfill(6)=>'001.23' >>> '1.23'.ljust(6, '0') '1.2300' Sebastian -- http://mail.python.org/mailman/listinfo/python-list

RPM of a Python program

2008-08-13 Thread Clay Hobbs
I want to make an RPM (Redhat Package Manager) file to install a Python program (not a module). How is this done? Does it use Distutils, or something completely different? Thanks in advance. -- Ratfink -- http://mail.python.org/mailman/listinfo/python-list

any function to fill zeros to the right?? zfill??

2008-08-13 Thread Johnny
if I want to fill zeros to the right, what function can help?? ex: '1.23'=>'1.2300' but '1.23'.zfill(6)=>'001.23' -- http://mail.python.org/mailman/listinfo/python-list

Re: Replace Several Items

2008-08-13 Thread John Machin
On Aug 14, 8:50 am, Wojtek Walczak <[EMAIL PROTECTED]> wrote: > Dnia Thu, 14 Aug 2008 00:31:00 +0200, Fredrik Lundh napisa³(a): > > >>> if ch in my_string: > >>> my_string = my_string.replace(ch, "") > > >>> on representative data. > > >> I don't have to, I can anticipate the results

Re: os.system question

2008-08-13 Thread Kevin Walzer
Fredrik Lundh wrote: not talking for the 3.X developers here, but os.popen is a binding to the POSIX popen function, so I'm not sure it makes that much sense to actually deprecate it. the os.popen[234], popen2, and commands stuff are different -- they're a a series of attempts to provide m

Re: Fixed-length text file to database script

2008-08-13 Thread Michael Ströder
Larry Bates wrote: [EMAIL PROTECTED] wrote: I have a machine (PLC) that is dumping its test results into a fixed- length text file. I need to pull this data into a database (MySQL most likely) so that I can access it with Crystal Reports to create daily reports for my engineers. [..] I need to

Re: Why nested scope rules do not apply to inner Class?

2008-08-13 Thread Maric Michaud
Le Wednesday 13 August 2008 21:04:30 Rhamphoryncus, vous avez écrit : > class X(object): >     foo = 42 > >     def bar(self): >         print foo >         print self.foo > X.foo = 7 Yes this is a problem, function could not bind their free vars to the class namespace without introducing a subtl

Re: Why nested scope rules do not apply to inner Class?

2008-08-13 Thread Calvin Spealman
On Wed, Aug 13, 2008 at 7:41 PM, Maric Michaud <[EMAIL PROTECTED]> wrote: > I was not aware of any "nested classes are unsupported" before and didn't > consider nested classes as bad practice till now, even with the pickle > limitation (not every class are intended to be pickled), more you didn't g

Re: Why nested scope rules do not apply to inner Class?

2008-08-13 Thread Maric Michaud
Le Tuesday 12 August 2008 23:15:23 Calvin Spealman, vous avez écrit : > The issue has been brought up several times before. There have been > proposals to make nested classes better supported, but they are always > shut down. The vote is always against it. Your metaclass example is > one thing, bu

Re: Replace Several Items

2008-08-13 Thread Wojtek Walczak
Dnia Thu, 14 Aug 2008 00:31:00 +0200, Fredrik Lundh napisa�(a): >>> if ch in my_string: >>> my_string = my_string.replace(ch, "") >>> >>> on representative data. >> >> I don't have to, I can anticipate the results. > > Chances are that you're wrong. At the moment my average is abo

Re: Fixed-length text file to database script

2008-08-13 Thread Larry Bates
[EMAIL PROTECTED] wrote: Hi Guys, I'm new to Python (mostly) and I'm wanting to use it for a new project I'm faced with. I have a machine (PLC) that is dumping its test results into a fixed- length text file. I need to pull this data into a database (MySQL most likely) so that I can access it

Re: callbacks in python

2008-08-13 Thread Larry Bates
Alexandru Mosoi wrote: On Aug 14, 12:02 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: your use of the word "callback" is a bit unusual, and your example isn't valid Python code, but it looks as if functools.partial might be what you need: http://docs.python.org/lib/module-functools.html m

Re: Can't use DB name with dashes using pymssql ???

2008-08-13 Thread Fredrik Lundh
Fredrik Lundh wrote: reading the documentation might help: http://pymssql.sourceforge.net/troubleshooting.html#dbid also see the SQL server reference documentation (the section "Rules for Regular Identifiers" describes the valid syntax): http://msdn.microsoft.com/en-us/library/ms17

Re: Can't use DB name with dashes using pymssql ???

2008-08-13 Thread Fredrik Lundh
Samuel Morhaim wrote: I believe there is a bug in Python.. _mssql ...I am not too familiar with Python yet, but after adding several breakpoints and watching the variable, the last step of pymssql.py is # open the connection con = _mssql.connect(dbhost, dbuser, dbpasswd) con

Re: Can't use DB name with dashes using pymssql ???

2008-08-13 Thread Samuel Morhaim
And.. confirmed.. it has to be a bug in Python _mssql. #sample.py import _mssql dbhost = 'gmed-4-int' dbuser = 'myuser' dbpasswd = 'mypassword' dbbase = 'Gcare4UI-B6_3_dev' con = _mssql.connect(dbhost, dbuser, dbpasswd) con.select_db(dbbase) ... Could not locate entry in sysdatabases for databa

Re: Suggestion for improved ImportError message

2008-08-13 Thread Wojtek Walczak
Dnia Wed, 13 Aug 2008 22:15:48 + (UTC), Wojtek Walczak napisa�(a): > Then go for it :-) You can prepare a patch and ask on python-dev > if the developers are interested. > > I was never hacking the import things on C level before, > but a hint: you have to modify import_from function from > Py

Re: Replace Several Items

2008-08-13 Thread Fredrik Lundh
Wojtek Walczak wrote: suggested exercise: benchmark re.sub with literal replacement, re.sub with callback (lambda m: ""), repeated replace, and repeated use of the form if ch in my_string: my_string = my_string.replace(ch, "") on representative data. I don't have to, I can an

Re: Can't use DB name with dashes using pymssql ???

2008-08-13 Thread Samuel Morhaim
I believe there is a bug in Python.. _mssql ...I am not too familiar with Python yet, but after adding several breakpoints and watching the variable, the last step of pymssql.py is # open the connection con = _mssql.connect(dbhost, dbuser, dbpasswd) con.select_db(dbbase) At this

Re: Suggestion for improved ImportError message

2008-08-13 Thread Fredrik Lundh
Kent Tenney wrote: I was just bit by from image import annotate ImportError: cannot import name annotate I found the problem via import image print image.__file__ which made it clear that the wrong image module had been found. that's what "python -v" is all about, of course. -- http:

Re: Inquisitive computing

2008-08-13 Thread castironpi
On Aug 13, 4:29 pm, [EMAIL PROTECTED] wrote: > David C. Ullrich: > > > If you look at the end of the article you see the author > > agrees (I don't quite follow his complaint about not feeling > > at home with the interactive mode, but it's funny to read about > > how he uses Lisp but realizes he's

Re: Replace Several Items

2008-08-13 Thread Wojtek Walczak
Dnia Wed, 13 Aug 2008 23:31:42 +0200, Fredrik Lundh napisa�(a): >>> I wish to replace several characters in my string to only one. >>> Example, "-", "." and "/" to nothing "" >>> I did like that: >>> my_string = my_string.replace("-", "").replace(".", "").replace("/", >>> "").replace(")", "").repla

Re: Suggestion for improved ImportError message

2008-08-13 Thread Wojtek Walczak
Dnia Wed, 13 Aug 2008 20:55:38 + (UTC), Kent Tenney napisa�(a): > from image import annotate > > ImportError: cannot import name annotate > > I found the problem via > > import image > print image.__file__ > > which made it clear that the wrong image module had been found. > > It would be nic

Re: Replace Several Items

2008-08-13 Thread bearophileHUGS
Fredrik Lundh: > suggested exercise: benchmark re.sub with literal replacement, re.sub > with callback (lambda m: ""), repeated replace, and repeated use of the form ... > on representative data. Please, add the translate() solution too I have suggested :-) Bye, bearophile -- http://mail.python.o

Re: Replace Several Items

2008-08-13 Thread John Krukoff
On Wed, 2008-08-13 at 09:39 -0700, gjhames wrote: > I wish to replace several characters in my string to only one. > Example, "-", "." and "/" to nothing "" > I did like that: > my_string = my_string.replace("-", "").replace(".", "").replace("/", > "").replace(")", "").replace("(", "") > > But I t

Re: The python not starting under cmd.exe

2008-08-13 Thread nntpman68
[EMAIL PROTECTED] wrote: Hi! My problem is that: The "test.py" is working in every machine that I use except in my home machine. Formerly it worked but now not. I don't know what happened, I searching for some solution. The errormessage is this (after I tried to start test.py under cmd.exe):

Re: xlrd cell background color

2008-08-13 Thread John Machin
On Aug 14, 6:03 am, [EMAIL PROTECTED] wrote in news:comp.lang.python thusly: > Hi all, > > I am trying to figure out a way to read colors with xlrd, but I did > not understand the formatting.py module. It is complicated, because it is digging out complicated info which varies in somewhat arbitrary

Re: Replace Several Items

2008-08-13 Thread Fredrik Lundh
Wojtek Walczak wrote: I wish to replace several characters in my string to only one. Example, "-", "." and "/" to nothing "" I did like that: my_string = my_string.replace("-", "").replace(".", "").replace("/", "").replace(")", "").replace("(", "") But I think it's a ugly way. What's the bette

Re: Inquisitive computing

2008-08-13 Thread bearophileHUGS
David C. Ullrich: > If you look at the end of the article you see the author > agrees (I don't quite follow his complaint about not feeling > at home with the interactive mode, but it's funny to read about > how he uses Lisp but realizes he's not going to talk people > into that...) That well know

Re: callbacks in python

2008-08-13 Thread Alexandru Mosoi
On Aug 14, 12:02 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > your use of the word "callback" is a bit unusual, and your example isn't > valid Python code, but it looks as if functools.partial might be what > you need: > >      http://docs.python.org/lib/module-functools.html my current implemen

Re: How to execute commands in internal zones of solaris using python running from the global zone ?

2008-08-13 Thread nntpman68
> Hishaam wrote: >> How to execute commands in internal zones of solaris using python >> running from the global zone ? >> >> i tried -- >> 1> os.popen("zlogin ") >> 2> os.popen("zonename") >> >> the 2nd command executes back into the global zone and not into the >> internal zone >> can anyone hel

Fixed-length text file to database script

2008-08-13 Thread Stacey
Hi Guys, I'm new to Python (mostly) and I'm wanting to use it for a new project I'm faced with. I have a machine (PLC) that is dumping its test results into a fixed-length text file. I need to pull this data into a database (MySQL most likely) so that I can access it with Crystal Reports to crea

Re: os.system question

2008-08-13 Thread Wojtek Walczak
Dnia Wed, 13 Aug 2008 22:03:49 +0200, Fredrik Lundh napisa�(a): > not talking for the 3.X developers here, but os.popen is a binding to > the POSIX popen function, so I'm not sure it makes that much sense to > actually deprecate it. > > the os.popen[234], popen2, and commands stuff are different

Fixed-length text file to database script

2008-08-13 Thread ssharpjr
Hi Guys, I'm new to Python (mostly) and I'm wanting to use it for a new project I'm faced with. I have a machine (PLC) that is dumping its test results into a fixed- length text file. I need to pull this data into a database (MySQL most likely) so that I can access it with Crystal Reports to cre

Re: callbacks in python

2008-08-13 Thread Larry Bates
Alexandru Mosoi wrote: does anyone know a nice implementation of callbacks in python? i have issues mixing named & unamed parameters. i want build a callback over a function such that some parameters are passed when callback is created and the rest are passed when the function is called. example

Re: datetime from uuid1 timestamp

2008-08-13 Thread Kent Tenney
> I'm interested in the use case for this. > Why would you want to extract the exact timestamp from the uuid? Because I can :-] At this point it's primarily academic, but I'll be creating lots of files and naming them with uuid's. I like the capability of determining creation date solely from t

Re: win32service and Python

2008-08-13 Thread Larry Bates
David wrote: I am collecting informations about win32 services for Python but, except for few basic examples about Mark Hammond's win32serviceutil, I found nothing useful. Any link is welcome. Thank you. David Actually those examples in Python for Win32 book are quite good and basically all

Re: Replace Several Items

2008-08-13 Thread Wojtek Walczak
Dnia Wed, 13 Aug 2008 09:39:53 -0700 (PDT), gjhames napisa�(a): > I wish to replace several characters in my string to only one. > Example, "-", "." and "/" to nothing "" > I did like that: > my_string = my_string.replace("-", "").replace(".", "").replace("/", > "").replace(")", "").replace("(", ""

Re: You advice please

2008-08-13 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Ken Starks <[EMAIL PROTECTED]> wrote: > Hussein B wrote: >[...] > > And now it looks as if I shall wish to learn another little language, at > least to 'dabble-in' level: Lua, because it is going to srcipt a new > variation in the TeX world. That sounded interest

Re: Hi, Pythoners.

2008-08-13 Thread Terry Reedy
AON LAZIO wrote: I have come across this code and I tried to figure out what does it do First, I do not understand the sign @... above the class method, what does it do? Second, about the object in AnyWrapper(object), why do they declare "object" as the superclass? sometimes I saw (type) wha

Re: callbacks in python

2008-08-13 Thread Fredrik Lundh
Alexandru Mosoi wrote: does anyone know a nice implementation of callbacks in python? i have issues mixing named & unamed parameters. i want build a callback over a function such that some parameters are passed when callback is created and the rest are passed when the function is called. exampl

Can't use DB name with dashes using pymssql ???

2008-08-13 Thread Samuel Morhaim
I tried: import sys import pymssql db = 'Gcare4UI-B6_3_dev' conn = pymssql.connect (host = "localhost", user = "myname", password = "mypassword", database = db) And this returns an error saying Could not locate entry i

Suggestion for improved ImportError message

2008-08-13 Thread Kent Tenney
Howdy, I was just bit by from image import annotate ImportError: cannot import name annotate I found the problem via import image print image.__file__ which made it clear that the wrong image module had been found. It would be nice if ImportError announced this up front. cannot import name

callbacks in python

2008-08-13 Thread Alexandru Mosoi
does anyone know a nice implementation of callbacks in python? i have issues mixing named & unamed parameters. i want build a callback over a function such that some parameters are passed when callback is created and the rest are passed when the function is called. example: callback = Callback(fun

Re: Inquisitive computing

2008-08-13 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Python as a language almost fit for Inquisitive computing: Heh - language problem. At first I read "almost fit for" as "almost satisfactory for". Looking at the link and your next comment I think you meant "is almost a perfect fit for".

Re: ANN: P4D 1.2

2008-08-13 Thread Kay Schluehr
On 12 Aug., 12:54, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On 12 Aug., 10:50, Uwe Grauer <[EMAIL PROTECTED]> wrote: > > > > > Kay Schluehr wrote: > > > P4D = E4X style embedded DSL for Python but without E and X. > > > > The main feature of P4D 1.2 are *Bytelets*. While the primary purpose > > >

Re: os.system question

2008-08-13 Thread Mike Driscoll
On Aug 13, 3:03 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Mike Driscoll wrote: > >> I note 3.0 runs os.popen without complaint (and had thought to mention > >> that in my previous).  Right now I'm wondering whether I should > >> install the beta 2.6 to see whether Wotjek is pulling our leg or

Re: getting full exception information from an xmlrpc server

2008-08-13 Thread [EMAIL PROTECTED]
On Aug 13, 3:31 pm, Scott <[EMAIL PROTECTED]> wrote: > What I would like is the full stack trace of what went wrong on the > server (i.e. the junk python usually dumps to the console when an > exception occurs). I don't care which side I see the dump on (client > or server), but I need to see the

Hi, Pythoners.

2008-08-13 Thread AON LAZIO
I have come across this code and I tried to figure out what does it do First, I do not understand the sign @... above the class method, what does it do? Second, about the object in AnyWrapper(object), why do they declare "object" as the superclass? sometimes I saw (type) what the differences betwee

Re: Calling "def" functions from another file.

2008-08-13 Thread Terry Reedy
frankrentef wrote: Newbie here I'm writing a Python program that has "def" functionality growing in leaps and bounds. I'm a newbie to Python so be detailed. Is there a way to create a py file with all the "def's" listed and just call them from the "program" py file? How would I do this?

xlrd cell background color

2008-08-13 Thread patrick . waldo
Hi all, I am trying to figure out a way to read colors with xlrd, but I did not understand the formatting.py module. Basically, I want to sort rows that are red or green. My initial attempt discovered that >>>print cell text:u'test1.txt' (XF:22) text:u'test2.txt' (XF:15) text:u'test3.txt' (XF:15

Re: os.system question

2008-08-13 Thread Fredrik Lundh
Mike Driscoll wrote: I note 3.0 runs os.popen without complaint (and had thought to mention that in my previous). Right now I'm wondering whether I should install the beta 2.6 to see whether Wotjek is pulling our leg or not. :) That was the wording I was referring to. Now that I re-read it, I

Re: os.system question

2008-08-13 Thread Mike Driscoll
On Aug 13, 1:38 am, Asun Friere <[EMAIL PROTECTED]> wrote: > On Aug 13, 8:58 am, Steven D'Aprano <[EMAIL PROTECTED] > > cybersource.com.au> wrote: > > On Mon, 11 Aug 2008 19:28:13 -0700, Asun Friere wrote: > > > > but if I was in a hurry to find out who I was I would be tempted still > > > to use t

Re: An FTP Client...My first real program!

2008-08-13 Thread tmallen
On Aug 13, 3:27 pm, tmallen <[EMAIL PROTECTED]> wrote: > Here's the code:http://pastebin.com/m21dfcc19 > > What could be improved? The script feels clumsy, and I have no > experience refactoring Python code. This will eventually be a GUI FTP > client. I'm mainly looking for design advice... Note t

Re: getting full exception information from an xmlrpc server

2008-08-13 Thread Fredrik Lundh
Scott wrote: I'm debugging an xmlrpc client/server application. Often when an exception occurs in the server, I receive only a very short error message on the client. For example: xmlrpclib.Fault: :"> Presumably this is because xmlrpclib on the server is catching the exception, and only se

RE: Hide raw_input text?

2008-08-13 Thread Support Desk
-Original Message- From: tmallen [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2008 12:26 PM To: python-list@python.org Subject: Hide raw_input text? I'm working on a little FTP project to get comfortable with ftplib. It's all terminal-based right now, and one issue I'm having is

Re: passing a variable argument list to a function

2008-08-13 Thread Scott
> Yeah. It's so easy and obvious that you are going to bang your head > against the wall. :) The single star does not only collect all arguments > in a function definition. It also expands a sequence as arguments. Thanks Christian, that worked perfectly! Scott -- http://mail.python.org/mailman/l

getting full exception information from an xmlrpc server

2008-08-13 Thread Scott
I'm debugging an xmlrpc client/server application. Often when an exception occurs in the server, I receive only a very short error message on the client. For example: xmlrpclib.Fault: :"> Presumably this is because xmlrpclib on the server is catching the exception, and only sending the except

An FTP Client...My first real program!

2008-08-13 Thread tmallen
Here's the code: http://pastebin.com/m21dfcc19 What could be improved? The script feels clumsy, and I have no experience refactoring Python code. This will eventually be a GUI FTP client. I'm mainly looking for design advice... -- http://mail.python.org/mailman/listinfo/python-list

Re: datetime from uuid1 timestamp

2008-08-13 Thread Irmen de Jong
Kent Tenney wrote: Howdy, I have not found a routine to extract usable date/time information from the 60 bit uuid1 timestamp. Is there not a standard solution? I submitted an ASPN recipe to do it. http://code.activestate.com/recipes/576420/ I'm interested in the use case for this. Why wo

Re: datetime from uuid1 timestamp

2008-08-13 Thread Kent Tenney
> Howdy, > > I have not found a routine to extract usable > date/time information from the 60 bit uuid1 timestamp. > > Is there not a standard solution? I submitted an ASPN recipe to do it. http://code.activestate.com/recipes/576420/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Why nested scope rules do not apply to inner Class?

2008-08-13 Thread Rhamphoryncus
On Aug 13, 11:13 am, "Cousson, Benoit" <[EMAIL PROTECTED]> wrote: > > There is no point of nested classes because nested classes _are not_ > > supported by python. They are simply an artifact of not actively > > denying the syntax non-globally. I would fully support a change to the > > language to

Re: os.system question

2008-08-13 Thread Wojtek Walczak
Dnia Tue, 12 Aug 2008 23:38:56 -0700 (PDT), Asun Friere napisa�(a): > I note 3.0 runs os.popen without complaint (and had thought to mention > that in my previous). Right now I'm wondering whether I should > install the beta 2.6 to see whether Wotjek is pulling our leg or > not. :) :) Checked it

RPM Control from Python

2008-08-13 Thread shaneal
Hello, I'm trying to script some sysadmin stuff, that requires rpm manipulation (querying installed packages, removing packages, installing packages). Rather than manually parsing rpm's output, I noticed that someone had written python-bindings for the rpmlib library (called rpm-python). This see

Can't seem to build python against custom tcl/tk

2008-08-13 Thread Russell E. Owen
I'm trying to build a non-framework python on MacOS X 10.5 using a custom tcl/tk that lives in an arbitrary directory. (For complicated reasons we don't want the system tcl/tk). It is easy to build an X11 tcl/tk this way (and we are content with X11) so I did that. Unfortunately I can't seem to

Re: gasp

2008-08-13 Thread Simon Brunning
2008/8/13 Cyprian Kumwaka <[EMAIL PROTECTED]>: > No, it doesn't! I have even tried uninstalling and installing it but still > it doesn't not work. Any more ideas! What error message do you get when you try it? "Doesn't work" isn't anything like enough to go on. And please keep the conversation on

Re: Hide raw_input text?

2008-08-13 Thread Fredrik Lundh
tmallen wrote: I'm working on a little FTP project to get comfortable with ftplib. It's all terminal-based right now, and one issue I'm having is hiding password input text. I'd like one of two things to happen with this: Either don't show any characters while I'm typing (like $ su), or better,

Re: win32service and Python

2008-08-13 Thread David
Il Wed, 13 Aug 2008 10:58:20 -0700 (PDT), Mike Driscoll ha scritto: > On Aug 13, 12:31 pm, David <[EMAIL PROTECTED]> wrote: >> I am collecting informations about win32 services for Python but, except for >> few basic examples about Mark Hammond's win32serviceutil, I found nothing >> useful. >> >>

Re: Calling "def" functions from another file.

2008-08-13 Thread Bruno Desthuilliers
frankrentef a écrit : Newbie here I'm writing a Python program that has "def" functionality functions growing in leaps and bounds. I'm a newbie to Python so be detailed. Is there a way to create a py file with all the "def's" listed and just call them from the "program" py file? yes.

Re: Factory for Struct-like classes

2008-08-13 Thread Marc Christiansen
eliben <[EMAIL PROTECTED]> wrote: > Hello, > > I want to be able to do something like this: > > Employee = Struct(name, salary) > > And then: > > john = Employee('john doe', 34000) > print john.salary > > Basically, Employee = Struct(name, salary) should be equivalent to: > > class Employee(o

Re: win32service and Python

2008-08-13 Thread Mike Driscoll
On Aug 13, 12:31 pm, David <[EMAIL PROTECTED]> wrote: > I am collecting informations about win32 services for Python but, except for > few basic examples about Mark Hammond's win32serviceutil, I found nothing > useful. > > Any link is welcome. > > Thank you. > David This doesn't have one yet, but

Re: Hide raw_input text?

2008-08-13 Thread Bruno Desthuilliers
tmallen a écrit : I'm working on a little FTP project to get comfortable with ftplib. It's all terminal-based right now, and one issue I'm having is hiding password input text. I'd like one of two things to happen with this: Either don't show any characters while I'm typing (like $ su), or better

Re: Hide raw_input text?

2008-08-13 Thread Jerry Hill
On Wed, Aug 13, 2008 at 1:26 PM, tmallen <[EMAIL PROTECTED]> wrote: > I'm working on a little FTP project to get comfortable with ftplib. > It's all terminal-based right now, and one issue I'm having is hiding > password input text. I'd like one of two things to happen with this: > Either don't sho

  1   2   3   >