Re: Newbie Alert: subprocess.call

2010-05-19 Thread Patrick Maupin
On May 19, 10:28 pm, Ben Finney wrote: > Better is to use ‘shlex.split’ to split the string as a shell parser > would do http://docs.python.org/library/shlex#shlex.split>. Good point. I always forget about shlex.split because I'm usually passing (relatively) constant strings with no funny quoti

Re: Newbie Alert: subprocess.call

2010-05-19 Thread Chris Rebert
On Wed, May 19, 2010 at 7:27 PM, Carbon wrote: > I am new to Python and am trying to write a GUI wrapper script in python > 2.5 to get username and passwords from Linux users to send as options to > run an app on a 2X terminal server. I came across the easygui module and > its multpasswordbox func

Re: Newbie Alert: subprocess.call

2010-05-19 Thread Ben Finney
Patrick Maupin writes: > On May 19, 9:27 pm, Carbon wrote: > > subprocess.call(["/opt/2X/Client/bin/appserverclient", "-u > > fieldValues [0]", "-p fieldValues[1]", "-s ts.mycompany.org:80", "-d > > corp", "-S local", "-c 16", "-e 0xF", "-l 0x0409", "-a #1"]) As Patrick says, you need to give t

Re: Newbie Alert: subprocess.call

2010-05-19 Thread Patrick Maupin
On May 19, 9:27 pm, Carbon wrote: > I am new to Python and am trying to write a GUI wrapper script in python > 2.5 to get username and passwords from Linux users to send as options to > run an app on a 2X terminal server. I came across the easygui module and > its multpasswordbox function, which m

Newbie Alert: subprocess.call

2010-05-19 Thread Carbon
I am new to Python and am trying to write a GUI wrapper script in python 2.5 to get username and passwords from Linux users to send as options to run an app on a 2X terminal server. I came across the easygui module and its multpasswordbox function, which made popping a dialog box and storing th

Re: Newbie Alert: Help me store constants pythonically

2005-11-08 Thread Stefan Rank
on 08.11.2005 17:40 Brendan said the following: [snip config/properties file needs] > > I've checked out ConfigParser, ConfigObj, Pickle, PyYaml and > gnossis.xml.serialize, and none meet all the above criteria (though > they're all neat). > > So I've decide to use ...drumroll please plistlib

Re: Newbie Alert: Help me store constants pythonically

2005-11-08 Thread Brendan
Thanks for all the suggestions everyone. After a bit of googling on the c.l.p. group, I see that building config files is one of those 'Everyone has a favourite way of doing it' types of problems, with lots of reimplementations. I should change the thread topic to "Yet Another Config File Questio

Re: Newbie Alert: Help me store constants pythonically

2005-11-07 Thread Nicola Larosa
> Also my config files have (a tiny bit of) nested > structure, such as: > > Model1( >numBumps = 1 >sizeOfBumps = 2 >transversePlanes = [ > Plane(type=3, z=4), > Plane(type=5, z=6), > Plane(type=3, z=8) > ] > ) > > which I'm not sure the .ini format can eas

Re: Newbie Alert: Help me store constants pythonically

2005-11-07 Thread Steven D'Aprano
Brendan wrote: > Thanks for your reply Steve. I like this suggestion because it > separates my config data from the code, which could mean less headaches > editing the values later. It also lets me keep my constants > language-neutral, which is good because I haven't convinced my boss yet > that

Re: Newbie Alert: Help me store constants pythonically

2005-11-07 Thread Ron Adam
Brendan wrote: >>How many is LOOONG? Ten? Twenty? One hundred? > > > About 50 per Model > > >>If it is closer to 100 than to 10, I would suggest >>putting your constants into something like an INI file: >> >>[MODEL1] # or something more meaningful >>numBumps: 1 >>sizeOfBumps: 99 >> >>[MODEL2

Re: Newbie Alert: Help me store constants pythonically

2005-11-07 Thread Jorge Godoy
"Brendan" <[EMAIL PROTECTED]> writes: > seems risky. Also my config files have (a tiny bit of) nested > structure, such as: > > Model1( >numBumps = 1 >sizeOfBumps = 2 >transversePlanes = [ > Plane(type=3, z=4), > Plane(type=5, z=6), > Plane(type=3, z=8) >

Re: Newbie Alert: Help me store constants pythonically

2005-11-07 Thread Brendan
> How many is LOOONG? Ten? Twenty? One hundred? About 50 per Model > If it is closer to 100 than to 10, I would suggest > putting your constants into something like an INI file: > > [MODEL1] # or something more meaningful > numBumps: 1 > sizeOfBumps: 99 > > [MODEL2] > numBumps: 57 > sizeOfBumps

Re: Newbie Alert: Help me store constants pythonically

2005-11-06 Thread Steven D'Aprano
Brendan wrote: > Hi all > > I'm new to Python (and programming in general), and I can't decide what > is the most 'pythonic' way to approach a problem. Your advice would be > appreciated. > > I have a bunch of 'scans', containing the data measured from one of > several types of 'model'. Each 'm

Re: Newbie Alert: Help me store constants pythonically

2005-11-06 Thread Brendan
Thanks for the vote FB. The reason I'm using that method for assigning instance attributes is that the argument list for __init__ is LOOONG. (There are many constants, I only gave two for the examples). I wanted to avoid typing them out twice. -- http://mail.python.org/mailman/listinfo/python-l

Re: Newbie Alert: Help me store constants pythonically

2005-11-06 Thread Francesco Bochicchio
Il Sun, 06 Nov 2005 08:33:17 -0800, Brendan ha scritto: > Hi all > > I'm new to Python (and programming in general), and I can't decide what > is the most 'pythonic' way to approach a problem. Your advice would be > appreciated. > > I have a bunch of 'scans', containing the data measured from o

Newbie Alert: Help me store constants pythonically

2005-11-06 Thread Brendan
Hi all I'm new to Python (and programming in general), and I can't decide what is the most 'pythonic' way to approach a problem. Your advice would be appreciated. I have a bunch of 'scans', containing the data measured from one of several types of 'model'. Each 'model' has different values for a

Re: Newbie Alert! Upgrading Python?

2005-07-10 Thread Peter Hansen
Thorsten Kampe wrote: > * El (2005-07-10 11:56 +0100) >>Python 1.5.1 (final) and Python Win32 Extensions are installed on my 4 year > > If you don't use it: uninstall Python. If something else uses it: keep > it as it is as your app might break with the new Python - even though > 2.4 is backwards

Re: Newbie Alert! Upgrading Python?

2005-07-10 Thread Thorsten Kampe
* El (2005-07-10 11:56 +0100) > Sorry to bother you folks with a real newbie question, but I am sure that > this is the place for me to ask. > > Python 1.5.1 (final) and Python Win32 Extensions are installed on my 4 year > old computer. My computer has always been upgraded to include the latest

Newbie Alert! Upgrading Python?

2005-07-10 Thread El
Hi, Sorry to bother you folks with a real newbie question, but I am sure that this is the place for me to ask. Python 1.5.1 (final) and Python Win32 Extensions are installed on my 4 year old computer. My computer has always been upgraded to include the latest programs and Windows updates. Ho

Re: Newbie alert

2005-02-02 Thread Timo Virkkala
Valone, Toren W. wrote: Traceback (most recent call last): File "C:/Python24/dialog1.py", line 29, in -toplevel- d = MyDialog(root) NameError: name 'MyDialog' is not defined Suggestion: Read the place in your code where MyDialog is defined and compare it with where it is used. Check case. Yo

Re: Newbie alert

2005-02-02 Thread Steve Holden
Valone, Toren W. wrote: Ok, new to Python and Tkinter.. Following along examples in book, got to dialog windows example coded this # dialog1.py from Tkinter import * class Mydialog: [...] d = MyDialog(root) root.wait_window(d.top) When I run it IDLE

Newbie alert

2005-02-02 Thread Valone, Toren W.
Ok, new to Python and Tkinter.. Following along examples in book, got to dialog windows example coded this # dialog1.py from Tkinter import * class Mydialog: def _int_(self,parent): top = self.top = Toplevel(parent) Label(top, text="Value").pack() self.e = Entry(top

Re: [Python-au] Processes and pipes; newbie alert

2004-12-29 Thread Nick Coghlan
Jon wrote: Obviously I don't need PeekNamedPipe here but I know the pipe has something in it and wanted to try it out. The code all works fine if I comment out PeekNamedPipe. The pipes returned by the win32pipe.popen calls are standard file-like objects, rather than win32 Named Pipes. The only way

Re: Newbie alert !

2004-12-03 Thread Jean Montambeault
Jean Montambeault wrote: I am not only learning Python but programming itself ; reading your posts makes me believe that nobody is that much of a beginner here. Is there a newgroup or list for my type somewhere I can't find it ? To illustrate my case this script : # function to draw rings for a

Re: Newbie alert !

2004-12-03 Thread Lonnie Princehouse
> bou_asia=Button(fen1, text='Asia',\ >command=rings(size=41, offsetX=50,offsetY=22, > coul='yellow')) You're calling the rings function when you create the button. What you really want is for "command" to be a callable object that the button will invoke when it's clicked, e.

Re: Newbie alert !

2004-12-03 Thread Adam DePrince
> > > bou_europe=Button(fen1, text='Europe',\ > >command=rings(41, 100, -22, 'blue')) Silly me. I misunderstood what you wanted first time around. In Python functions are "first class objects" that are treated no differently than anything else. When you setup your button

Re: Newbie alert !

2004-12-03 Thread Adam DePrince
On Fri, 2004-12-03 at 06:38, Jean Montambeault wrote: > I am not only learning Python but programming itself ; reading your > posts makes me believe that nobody is that much of a beginner here. Is > there a newgroup or list for my type somewhere I can't find it ? > > To illustrate my case this s

Re: Newbie alert !

2004-12-03 Thread Eric Brunel
Jean Montambeault wrote: I am not only learning Python but programming itself ; reading your posts makes me believe that nobody is that much of a beginner here. Is there a newgroup or list for my type somewhere I can't find it ? To illustrate my case this script : # function to draw rings for a

Re: Newbie alert !

2004-12-03 Thread Simon Brunning
On Fri, 03 Dec 2004 06:38:54 -0500, Jean Montambeault <[EMAIL PROTECTED]> wrote: > I am not only learning Python but programming itself ; reading your > posts makes me believe that nobody is that much of a beginner here. Is > there a newgroup or list for my type somewhere I can't find it ? The tut

Newbie alert !

2004-12-03 Thread Jean Montambeault
I am not only learning Python but programming itself ; reading your posts makes me believe that nobody is that much of a beginner here. Is there a newgroup or list for my type somewhere I can't find it ? To illustrate my case this script : # function to draw rings for an Olympic flag def rings(