Re: [Tutor] Shebang (#!) in the first line of a python script

2009-10-13 Thread Dave Angel
Scott Markwell wrote: On Tue, Oct 13, 2009 at 1:54 PM, Dave Angel wrote: Katt wrote: You were right. I did not have .PY/.PYW in my PATHEXT. I have put it in as suggested. I do have python.exe in my path so that should take care of things. Messing around with the windows registry

Re: [Tutor] Shebang (#!) in the first line of a python script

2009-10-13 Thread Scott Markwell
On Tue, Oct 13, 2009 at 1:54 PM, Dave Angel wrote: > Katt wrote: > >> >> You were right. I did not have .PY/.PYW in my PATHEXT. I have put it in >> as >> suggested. I do have python.exe in my path so that should take care of >> things. >> >> Messing around with the windows registry isn't some

Re: [Tutor] Recursive user input collection problem

2009-10-13 Thread Alan Gauld
"William Witteman" wrote I want to make sure that I actually get integers. num_of_articles = 0 num_of_reviewers = 0 def getinput(variable,prompt): """ Get the input by prompting the user and collecting the response - if it is a non-integer, try again. """ variable = 0 variable = ra

Re: [Tutor] writing sample program that zips files and saves in a backup directory

2009-10-13 Thread David Eric
On Tue, Oct 13, 2009 at 5:17 PM, Kent Johnson wrote: > On Tue, Oct 13, 2009 at 4:38 PM, David Eric wrote: > > > as far as print zip_command, i would add that to the program however, > doesnt > > just declaring it actually trigger it..thus it would executed and the > > command line would get prin

Re: [Tutor] writing sample program that zips files and saves in a backup directory

2009-10-13 Thread Kent Johnson
On Tue, Oct 13, 2009 at 4:38 PM, David Eric wrote: > as far as print zip_command, i would add that to the program however, doesnt > just declaring it actually trigger it..thus it would executed and the > command line would get printed as well? I'm not sure what you mean by "declaring", but assig

Re: [Tutor] Recursive user input collection problem

2009-10-13 Thread Dave Angel
William Witteman wrote: I need to collect a couple of integers from a user, but I want to make sure that I actually get integers. I tried this, but subsequent calls to the function don't update variable. I'm not sure this is terribly clear - here's the code: num_of_articles = 0 num_of_reviewer

Re: [Tutor] Shebang (#!) in the first line of a python script

2009-10-13 Thread Dave Angel
Katt wrote: You were right. I did not have .PY/.PYW in my PATHEXT. I have put it in as suggested. I do have python.exe in my path so that should take care of things. Messing around with the windows registry isn't something I want to tackle just yet so I will save that for later. Thank

Re: [Tutor] Recursive user input collection problem

2009-10-13 Thread christopher . henk
> I need to collect a couple of integers from a user, but I want to make > sure that I actually get integers. I tried this, but subsequent calls > to the function don't update variable. I'm not sure this is terribly > clear - here's the code: > > num_of_articles = 0 > num_of_reviewers = 0 > > d

Re: [Tutor] Recursive user input collection problem

2009-10-13 Thread Weidner, Ronald
I didn't test this but shouldn't you have a line like this... return getinput(variable,prompt) -- Ronald Weidner -Original Message- From: tutor-bounces+rweidner=ea@python.org [mailto:tutor-bounces+rweidner=ea@python.org] On Behalf Of William Witteman Sent: Tuesday, October 13, 2

Re: [Tutor] writing sample program that zips files and saves in a backup directory

2009-10-13 Thread Eike Welk
Hello David! This is meant as an addition to Kent's remarks that 'gzip' is inappropriate, and you should use tar to create the archive. The 'tar' program can additionally use 'gzip' to compress the archive. A useful command would be: tar cvzf archive_name.tgz file_or_dir_1 file_or_dir_2 and_so

Re: [Tutor] writing sample program that zips files and saves in a backup directory

2009-10-13 Thread David Eric
On Tue, Oct 13, 2009 at 4:02 PM, Kent Johnson wrote: > On Tue, Oct 13, 2009 at 2:58 PM, David Eric wrote: > > printing the command line, > > would it be > > print('gzip {0} {1}'.format(target, ' '.join(source))? > > Yes, or just > print zip_command > > > and as far as using the tar command, >

Re: [Tutor] writing sample program that zips files and saves in a backup directory

2009-10-13 Thread Kent Johnson
On Tue, Oct 13, 2009 at 2:58 PM, David Eric wrote: > printing the command line, > would it be >  print('gzip {0} {1}'.format(target, ' '.join(source))? Yes, or just print zip_command > and as far as using the tar command, > i have three files, > file1,file2,file3 > i wanted to preserve that st

[Tutor] Recursive user input collection problem

2009-10-13 Thread William Witteman
I need to collect a couple of integers from a user, but I want to make sure that I actually get integers. I tried this, but subsequent calls to the function don't update variable. I'm not sure this is terribly clear - here's the code: num_of_articles = 0 num_of_reviewers = 0 def getinput(variab

[Tutor] Dialogs

2009-10-13 Thread kreglet
I am having a problem with GtkDialogs. Ref: http://faq.pygtk.org/index.py?req=show&file=faq10.011.htp http://faq.pygtk.org/index.py?req=show&file=faq10.011.htp I want to add a treeview to the dialog. The first time btnDialog is pressed the dialog shows with the treeview in it. If I press b

Re: [Tutor] writing sample program that zips files and saves in a backup directory

2009-10-13 Thread David Eric
On Tue, Oct 13, 2009 at 4:14 PM, Dave Angel wrote: > (You top-posted, instead of adding your part to the end. That's frowned > upon in a mailing list, at least in this one.) > (You replied privately, and forgot to CC the tutor list. I'm forwarding it > there with my response) > > > David Eric w

Re: [Tutor] writing sample program that zips files and saves in a backup directory

2009-10-13 Thread Dave Angel
(You top-posted, instead of adding your part to the end. That's frowned upon in a mailing list, at least in this one.) (You replied privately, and forgot to CC the tutor list. I'm forwarding it there with my response) David Eric wrote: wow thank you yes...youre right i did want to pass a lis

Re: [Tutor] Changing colors using WinXP py2.6.2

2009-10-13 Thread Katt
Message: 3 Date: Tue, 13 Oct 2009 11:34:15 +0100 From: Tim Golden Cc: tutor@python.org Subject: Re: [Tutor] Changing text colors on WinXP py2.6.2 Message-ID: <4ad457a7.5030...@timgolden.me.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Katt wrote: Is it possible to change text

Re: [Tutor] writing sample program that zips files and saves in a backup directory

2009-10-13 Thread Dave Angel
David Eric wrote: doing a python tutorial and one of the assignments says to develop a program that backsup files to zip files into a backup directory im using Darwin 10.0.0 unix version: this is what i came up with thus far, i did copy the sample program given but made changes for my unix OS:

Re: [Tutor] Shebang (#!) in the first line of a python script

2009-10-13 Thread Katt
Message: 2 Date: Tue, 13 Oct 2009 06:24:42 -0400 From: Dave Angel To: Alan Gauld Cc: tutor@python.org, Katt Subject: Re: [Tutor] Shebang (#!) in the first line of a python script Message-ID: <4ad4556a.2020...@ieee.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Alan Gauld wrot

Re: [Tutor] writing sample program that zips files and saves in a backup directory

2009-10-13 Thread Kent Johnson
On Tue, Oct 13, 2009 at 2:01 PM, David Eric wrote: > doing a python tutorial and one of the assignments says to develop a program > that backsup files to zip files into a backup directory > > im using Darwin 10.0.0 unix version: > > this is what i came up with thus far, i did copy the sample progr

Re: [Tutor] [OT] Secure coding guidelines

2009-10-13 Thread Kent Johnson
On Tue, Oct 13, 2009 at 11:49 AM, Serdar Tumgoren wrote: >> In reference to this tip,  my question is why? > >> - don't use string formatting to create SQL statements - use the >> two-argument form of execute() to pass args as a sequence >> > > SQL injection is the primary reason: > > http://en.wi

[Tutor] writing sample program that zips files and saves in a backup directory

2009-10-13 Thread David Eric
doing a python tutorial and one of the assignments says to develop a program that backsup files to zip files into a backup directory im using Darwin 10.0.0 unix version: this is what i came up with thus far, i did copy the sample program given but made changes for my unix OS: #!/usr/bin/env pyth

Re: [Tutor] Changing text colors on WinXP py2.6.2

2009-10-13 Thread Alan Gauld
"Dave Angel" wrote Other things to consider: cygwin curses works on cygwin too so a much wider set of choices there. Alan G ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/l

Re: [Tutor] Changing text colors on WinXP py2.6.2

2009-10-13 Thread Dave Angel
Tim Golden wrote: Alan Gauld wrote: "Tim Golden" wrote No. ANSI escapes don't work on Windows. Wouldn't the ANSI codes work if ANSI.SYS were loaded? I thought you could still load ANSI.SYS it just wasn't normally there? The help system says you should load it in config.nt with: device=c

Re: [Tutor] [OT] Secure coding guidelines

2009-10-13 Thread Serdar Tumgoren
> In reference to this tip,  my question is why? > - don't use string formatting to create SQL statements - use the > two-argument form of execute() to pass args as a sequence > SQL injection is the primary reason: http://en.wikipedia.org/wiki/SQL_injection If you are going to "manually" hit a

Re: [Tutor] [OT] Secure coding guidelines

2009-10-13 Thread Weidner, Ronald
In reference to this tip, my question is why? - don't use string formatting to create SQL statements - use the two-argument form of execute() to pass args as a sequence -- Ronald Weidner -Original Message- From: tutor-bounces+rweidner=ea@python.org [mailto:tutor-bounces+rweidner=e

Re: [Tutor] Changing text colors on WinXP py2.6.2

2009-10-13 Thread Tim Golden
Mark Tolonen wrote: "Tim Golden" wrote in message news:4ad471e6.7050...@timgolden.me.uk... Alan Gauld wrote: "Tim Golden" wrote No. ANSI escapes don't work on Windows. Wouldn't the ANSI codes work if ANSI.SYS were loaded? I thought you could still load ANSI.SYS it just wasn't normally there

Re: [Tutor] Changing text colors on WinXP py2.6.2

2009-10-13 Thread Mark Tolonen
"Tim Golden" wrote in message news:4ad471e6.7050...@timgolden.me.uk... Alan Gauld wrote: "Tim Golden" wrote No. ANSI escapes don't work on Windows. Wouldn't the ANSI codes work if ANSI.SYS were loaded? I thought you could still load ANSI.SYS it just wasn't normally there? The help system

Re: [Tutor] New to python: some advises for image processing tool

2009-10-13 Thread Nicola De Quattro
> You currently think about > user interface stuff and not about the real problem, analyzing > spectra of stars. Well, I think is exactly as you say. I've never developed entirely a tool, so I started with the container rather then the content. Thanks for the very useful (however simple) observati

Re: [Tutor] Changing text colors on WinXP py2.6.2

2009-10-13 Thread Tim Golden
Alan Gauld wrote: "Tim Golden" wrote No. ANSI escapes don't work on Windows. Wouldn't the ANSI codes work if ANSI.SYS were loaded? I thought you could still load ANSI.SYS it just wasn't normally there? The help system says you should load it in config.nt with: device=c:\winnt\system32\an

Re: [Tutor] Changing text colors on WinXP py2.6.2

2009-10-13 Thread Alan Gauld
"Tim Golden" wrote No. ANSI escapes don't work on Windows. Wouldn't the ANSI codes work if ANSI.SYS were loaded? I thought you could still load ANSI.SYS it just wasn't normally there? The help system says you should load it in config.nt with: device=c:\winnt\system32\ansi.sys But I admi

Re: [Tutor] New to python: some advises for image processing tool

2009-10-13 Thread Eike Welk
On Monday 12 October 2009, Nicola De Quattro wrote: > I've started to write something about input image loading and > rotation. My goal is that, from graphical interface, the user will > be able to rotate an image at steps (perhaps using two buttons) or > by entering the amount of degree the image

Re: [Tutor] (no subject)

2009-10-13 Thread Kent Johnson
On Tue, Oct 13, 2009 at 3:29 AM, Albert-Jan Roskam wrote: > Hi, > > I'm using Tkinter to program my very frist GUI. Each button grays out after > it has been used so the user knows what next steps to take. > Now I want to define a Reset button to 'ungray' all buttons (state='normal'). > How can

Re: [Tutor] Changing text colors on WinXP py2.6.2

2009-10-13 Thread Tim Golden
Katt wrote: Is it possible to change text color on a WinXP system by just using the Ansi escape codes. I have tried, but it just shows the start and end text of the code, but it doesn't change the color. No. ANSI escapes don't work on Windows. Depending on where you want to go, you can look a

Re: [Tutor] Shebang (#!) in the first line of a python script

2009-10-13 Thread Dave Angel
Alan Gauld wrote: "Katt" wrote Okay. So if I were to place the following in my Windows XP py v.2.6.2 : $ (name of python script) Then as long as python was in my path I would be able to type the name of the script like a Dos batch file (ex: lowertoupper.py or lowertoupper) instead of havi

Re: [Tutor] Changing text colors on WinXP py2.6.2

2009-10-13 Thread Katt
Hello All, Is it possible to change text color on a WinXP system by just using the Ansi escape codes. I have tried, but it just shows the start and end text of the code, but it doesn't change the color. I have tried placing the following before and aft the variable I wish to change: print

[Tutor] GUI Buttons

2009-10-13 Thread Alan Gauld
Please provide a subject when sending mail to the list. And please create a new message so it doesn't get lost in an old thread... "Albert-Jan Roskam" wrote in message I'm using Tkinter to program my very frist GUI. Each button grays out after it has been used so the user knows what next step

Re: [Tutor] Shebang (#!) in the first line of a python script

2009-10-13 Thread Alan Gauld
"Katt" wrote Okay. So if I were to place the following in my Windows XP py v.2.6.2 : $ (name of python script) Then as long as python was in my path I would be able to type the name of the script like a Dos batch file (ex: lowertoupper.py or lowertoupper) instead of having to type python l

Re: [Tutor] Curses - What does it do and why is it called this?

2009-10-13 Thread Alan Gauld
"Katt" wrote Now I understand. Makes sense. If "Curses" is for UNIX what would I use on a Windows XP system using Python 2.6.2? It does exist for DOS too but the Python bindings don;t sem to work well. However for most simple terminal handling you can use the msvcrt module (msvcrt = Micro

Re: [Tutor] Curses - What does it do and why is it called this?

2009-10-13 Thread Katt
From: Steve Willoughby To: Katt The name is a humorous reference to the "cursor" on the screen which this package controls for the application, moving it around (and curses even Now I understand. Makes sense. If "Curses" is for UNIX what would I use on a Windows XP system using Python 2.6

Re: [Tutor] What is Curses and why do they call it that.

2009-10-13 Thread Alan Gauld
"Bill Campbell" wrote it offers a degree of terminal independance. It was popular in the period before GUIs became normal but after they became desirable - ie around 1985-1995. And should be more desirable today for applications that require efficient, heads-down data entry where one does n

Re: [Tutor] Help on python file extension windows vista recognition

2009-10-13 Thread Tim Golden
Dave Angel wrote: You will also need to get comfortable with the DOS box (Command Prompt, whatever Vista calls it. It's probably in Start->Accessories). In a DOS box, you could do a DIR of that directory, and see exactly what the file is called. You also could invoke python or pythonw expli

Re: [Tutor] Shebang (#!) in the first line of a python script

2009-10-13 Thread Katt
From: "Mark K. Zanfardino" To: Katt Cc: tutor@python.org Subject: Re: [Tutor] First line of a python program In computing, a shebang (also called a hashbang, hashpling, pound bang, or crunchbang) refers to the characters "#!" when they are the first two characters in a text file. In a Unix-li

[Tutor] (no subject)

2009-10-13 Thread Albert-Jan Roskam
Hi, I'm using Tkinter to program my very frist GUI. Each button grays out after it has been used so the user knows what next steps to take. Now I want to define a Reset button to 'ungray' all buttons (state='normal'). How can I programmatically create a list of all available buttons? Cheers!! A

Re: [Tutor] New to python: some advises for image processing tool

2009-10-13 Thread Stefan Behnel
Nicola De Quattro wrote: > while(var !=q0) > print """ > Please select an action from the menu below: > -- > o) Open an image > +) Rotate the image of 1° clockwise > -) Rotate the image of -1° clockwise >