Re: [Tutor] program not doing what I need it to do

2018-01-28 Thread Alan Gauld via Tutor
On 29/01/18 00:45, Alan Gauld via Tutor wrote: > scores = [] # three sets of scores. Oops, sorry that line shouldn't be there. It came from my first pass through the code, before I saw how you were storing the data lower down. -- Alan G Author of the Learn to Program web site http://www.alan-

Re: [Tutor] program not doing what I need it to do

2018-01-28 Thread Alan Gauld via Tutor
On 28/01/18 22:06, Edna Broukhim wrote: You have tried to give the variables sensible names but a little bit more work will make your code more readable and therefore easier to debug. You need to rethink your data model slightly. You have a number of users (which you don't explicitly store at pr

[Tutor] program not doing what I need it to do

2018-01-28 Thread Edna Broukhim
I have the following program. It needs to say the user's name, average and the letter grade of each user. I don't know how to fix it so it gives the average of all users. It only gives the average of the last user. user=int(input("How many students?")) Score1=[] Score2=[] Score3=[] name=[] for

Re: [Tutor] program code for Python Programming for the Absolute Beginner, 3rd ed.?

2017-07-02 Thread Alan Gauld via Tutor
On 02/07/17 11:03, Richard Grose wrote: > https://www.google.co.uk/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ahUKEwiw1tD3qurUAhULKlAKHWMOAPMQFggkMAA&url=https%3A%2F%2Fgithub.com%2FCWade3051%2FPy%2Ftree%2Fmaster%2FAbsolute%2520Book%2Fpy3e_source&usg=AFQjCNG36WhZfh5ftqWncjtgZy3z6xgh6g&cad=rjt >

Re: [Tutor] program code for Python Programming for the Absolute Beginner, 3rd ed.?

2017-07-02 Thread Richard Grose
https://www.google.co.uk/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ahUKEwiw1tD3qurUAhULKlAKHWMOAPMQFggkMAA&url=https%3A%2F%2Fgithub.com%2FCWade3051%2FPy%2Ftree%2Fmaster%2FAbsolute%2520Book%2Fpy3e_source&usg=AFQjCNG36WhZfh5ftqWncjtgZy3z6xgh6g&cad=rjt Py/Absolute Book/py3e_source at master · CW

[Tutor] Program to check Python 2 syntaxes incompatible to Python 3?

2017-06-28 Thread STF
Hi, After reading some articles about Python 2 vs Python 3 issues and web pages like: https://docs.python.org/3/whatsnew/3.0.html https://wiki.python.org/moin/Python2orPython3 I'm wondering if there's any program/tool to list out incompatible syntaxes in a Python 2 source file. I know the 2to3 t

Re: [Tutor] Program won't print out in Windows 10

2016-07-24 Thread Tim Golden
On 24/07/2016 16:38, Ken G. wrote: While the following program prints out fine using Python 2.7.6 in Ubuntu 14.04.4 as developed using Geany 1.23.1, same program won't print out to printer under Windows 10 Pro (64 bit). Geany uses there is version 1.28 using Python 2.7.12. I can use CTRL-P t

Re: [Tutor] Program won't print out in Windows 10

2016-07-24 Thread Steven D'Aprano
On Sun, Jul 24, 2016 at 11:38:06AM -0400, Ken G. wrote: > While the following program prints out fine using > Python 2.7.6 in Ubuntu 14.04.4 as developed using > Geany 1.23.1, same program won't print out to printer > under Windows 10 Pro (64 bit). Geany uses there is > version 1.28 using Python 2.

[Tutor] Program won't print out in Windows 10

2016-07-24 Thread Ken G.
While the following program prints out fine using Python 2.7.6 in Ubuntu 14.04.4 as developed using Geany 1.23.1, same program won't print out to printer under Windows 10 Pro (64 bit). Geany uses there is version 1.28 using Python 2.7.12. I can use CTRL-P to print out the listing. ==

Re: [Tutor] Program Arcade Games Help

2016-03-12 Thread Alan Gauld
On 12/03/16 05:15, DiliupG wrote: > All the help and guidance you need are in the pages here. > > http://programarcadegames.com/ > > if you follow the book slowly from the start you shouldn't have a problem. > If you do, stackoverflow is a good place to ask. As is the tutor list of course. :-)

Re: [Tutor] Program Arcade Games Help

2016-03-12 Thread DiliupG
All the help and guidance you need are in the pages here. http://programarcadegames.com/ if you follow the book slowly from the start you shouldn't have a problem. If you do, stackoverflow is a good place to ask. When ever you ask a question try to give as much details as possible so that who eve

Re: [Tutor] Program Arcade Games Help

2016-03-11 Thread Alan Gauld
On 11/03/16 15:11, Ethan Batterman wrote: > I am really struggling with Lab 9: Functions pt 3 and 4 of program arcade > games. We have no idea what you are talking about. I assume you are studying some kind of course or book. But which one? What is Lab 9? What are functions pt 3 and 4? What is pr

[Tutor] Program Arcade Games Help

2016-03-11 Thread Ethan Batterman
I am really struggling with Lab 9: Functions pt 3 and 4 of program arcade games. Any help or guidance would be greatly appreciated. I am completely lost. Thank you in advance! Ethan ___ Tutor maillist - Tutor@python.org To unsubscribe or change subs

Re: [Tutor] program code for Python Programming for the Absolute Beginner, 3rd ed.?

2014-12-16 Thread Alan Gauld
On 16/12/14 04:06, Sunil Bharuchi wrote: I went to the website (www.courseptr.com/downloads) to download the source code (py3e_source.zip). It's not there. Where can I get it the source code? Try using Google with python absolute beginners source code -- Alan G Author of the Learn to Program

Re: [Tutor] program code for Python Programming for the Absolute Beginner, 3rd ed.?

2014-12-16 Thread Sunil Bharuchi
I went to the website (www.courseptr.com/downloads) to download the source code (py3e_source.zip). It's not there. Where can I get it the source code? -- Sunil Bharuchi sunilkumar.bharuchi@mail.mil sbharu...@gmail.com (C) 408.644.7626 ___ Tutor mail

Re: [Tutor] program for a problem

2012-10-26 Thread Dwight Hutto
On Mon, Oct 8, 2012 at 11:55 AM, Tharuni Dheeraj wrote: > please send me the program for the following que: > > Write a program that asks the user for a dollar amount.It then reports the > corresponding number of euros by using the current exchange rate. > -- > Regards, > Tharuni Dheeraj > > > ___

Re: [Tutor] program for a problem

2012-10-17 Thread bob gailer
On 10/8/2012 11:55 AM, Tharuni Dheeraj wrote: please send me the program for the following que: Write a program that asks the user for a dollar amount.It then reports the corresponding number of euros by using the current exchange rate. As the list name (Tutor) suggests we are here to help yo

Re: [Tutor] program for a problem

2012-10-17 Thread Mark Lawrence
On 08/10/2012 16:55, Tharuni Dheeraj wrote: please send me the program for the following que: Write a program that asks the user for a dollar amount.It then reports the corresponding number of euros by using the current exchange rate. -- Regards, Tharuni Dheeraj __

[Tutor] program for a problem

2012-10-17 Thread Tharuni Dheeraj
please send me the program for the following que: Write a program that asks the user for a dollar amount.It then reports the corresponding number of euros by using the current exchange rate. -- Regards, Tharuni Dheeraj ___ Tutor maillist - Tutor@python

Re: [Tutor] Program gets stuck after a creating a list from dictinary items!

2012-07-07 Thread Mark Lawrence
On 07/07/2012 09:34, Alan Gauld wrote: On 07/07/12 04:35, Steven D'Aprano wrote: I find it ironic that you are suggesting removing the debugger to make it easier to debug the code :) But the pdb.trace() calls are not needed for debugging. The interactive debugger will work just fine without t

Re: [Tutor] Program gets stuck after a creating a list from dictinary items!

2012-07-07 Thread Alan Gauld
On 07/07/12 04:35, Steven D'Aprano wrote: I find it ironic that you are suggesting removing the debugger to make it easier to debug the code :) But the pdb.trace() calls are not needed for debugging. The interactive debugger will work just fine without them. They are for very specialised use.

Re: [Tutor] Program gets stuck after a creating a list from dictinary items!

2012-07-06 Thread Steven D'Aprano
Prasad, Ramit wrote: I believe that the usage of 'in ' converts it into a set (or set-like) object so probably that is the same as set(list(set())). No, certainly not. That would be terribly inefficient, since it means first iterating over blah entirely to convert it into a set, and then iter

Re: [Tutor] Program gets stuck after a creating a list from dictinary items!

2012-07-06 Thread Steven D'Aprano
Ali Torkamani wrote: I could resolve it by defining a small function: def getValue(mydict,keys): A=[]; for i in keys: A=A+[mydict[i]] return A That will be terribly, painfully inefficient for large amounts of data. Do you understand Big O notation? The above is O(N**2), c

Re: [Tutor] Program gets stuck after a creating a list from dictinary items!

2012-07-06 Thread Steven D'Aprano
Alan Gauld wrote: On 06/07/12 22:16, Ali Torkamani wrote: have the pdb.set_trace()'s for debugging, to see what's going on inside. So what does it show? If you aren't using it get rid of it. The less distractions there are the easier it is to debug things. I find it ironic that you are s

Re: [Tutor] Program gets stuck after a creating a list from dictinary items!

2012-07-06 Thread Steven D'Aprano
Ali Torkamani wrote: Dear Tutors, I'm trying to write a dictionary into a csv file, in the following code FlatData is the global dictionary whose keys are datetime objects, and the values are list of dictionaries. sCommonFeatures are key's that exist in all of such 'sub'-dictionaries, and sOtherF

Re: [Tutor] Program gets stuck after a creating a list from dictinary items!

2012-07-06 Thread Alan Gauld
On 06/07/12 22:16, Ali Torkamani wrote: Actually printing some thing after that line does not show any thing, OK, But it could be any of the lines above the print. Why are you so sure its that line? You are probably correct but I'd like to know why you are so sure? What have you done to isolat

Re: [Tutor] Program gets stuck after a creating a list from dictinary items!

2012-07-06 Thread Prasad, Ramit
> > Also what are you using the pdb traces for? > > Do they show any output? > Actually printing some thing after that line does not show any thing, I have > the pdb.set_trace()'s for debugging, to see what's going on inside. ho would > you debug that? When debugging, I usually just add more pri

Re: [Tutor] Program gets stuck after a creating a list from dictinary items!

2012-07-06 Thread Mark Lawrence
Please stop top posting, you have been asked at least once before, no further comments, TIA. On 06/07/2012 22:16, Ali Torkamani wrote: Actually printing some thing after that line does not show any thing, I have the pdb.set_trace()'s for debugging, to see what's going on inside. ho would you de

Re: [Tutor] Program gets stuck after a creating a list from dictinary items!

2012-07-06 Thread Ali Torkamani
Actually printing some thing after that line does not show any thing, I have the pdb.set_trace()'s for debugging, to see what's going on inside. ho would you debug that? On Fri, Jul 6, 2012 at 3:57 PM, Alan Gauld wrote: > On 06/07/12 18:21, Ali Torkamani wrote: > >> I'm using Python 2.7. >> By st

Re: [Tutor] Program gets stuck after a creating a list from dictinary items!

2012-07-06 Thread Alan Gauld
On 06/07/12 18:21, Ali Torkamani wrote: I'm using Python 2.7. By stuck I mean, does not pass that specific line (but no errors). How do you know that is the line it is stuck on? def WriteOneDayToCSV(sCommonFeatures,sOtherFeatures,date): FD=FlatData[date] A=['UniqeDate','Year','Month','Da

Re: [Tutor] Program gets stuck after a creating a list from dictinary items!

2012-07-06 Thread Ali Torkamani
I'm using Python 2.7. By stuck I mean, does not pass that specific line (but no errors). Like I said FD is a list of dictionaries. and sCommonFeatures are a subset of key's that have value in all of the dictionaries. On Fri, Jul 6, 2012 at 1:04 PM, Prasad, Ramit wrote: > > > I could resolve it

Re: [Tutor] Program gets stuck after a creating a list from dictinary items!

2012-07-06 Thread Prasad, Ramit
> > I could resolve it by defining a small function: > > > > def getValue(mydict,keys): > > A=[]; > > for i in keys: > > A=A+[mydict[i]] > > return A > > > > and then calling it: D=getValue(prog,sCommonFeatures); > > (instead of D=[prog[key1] for key1 in list(sCommonFeatures)];)

Re: [Tutor] Program gets stuck after a creating a list from dictinary items!

2012-07-06 Thread Prasad, Ramit
Please do not top post. > > BTW I changed it to: > D=[prog[key1] for key1 in list(sCommonFeatures)] > > because sCommonFeatures is actually a set, but it still has the smae problem > On Fri, Jul 6, 2012 at 12:27 PM, Ali Torkamani wrote: > Thanks, I checked, FD is not empty, > Thanks for remind

Re: [Tutor] Program gets stuck after a creating a list from dictinary items!

2012-07-06 Thread Ali Torkamani
I could resolve it by defining a small function: def getValue(mydict,keys): A=[]; for i in keys: A=A+[mydict[i]] return A and then calling it: D=getValue(prog,sCommonFeatures); (instead of D=[prog[key1] for key1 in list(sCommonFeatures)];) but I'm still surprised why the latt

Re: [Tutor] Program gets stuck after a creating a list from dictinary items!

2012-07-06 Thread Ali Torkamani
BTW I changed it to: D=[prog[key1] for key1 in list(sCommonFeatures)] because sCommonFeatures is actually a set, but it still has the smae problem On Fri, Jul 6, 2012 at 12:27 PM, Ali Torkamani wrote: > Thanks, I checked, FD is not empty, > Thanks for reminding about the flush and close, but I

Re: [Tutor] Program gets stuck after a creating a list from dictinary items!

2012-07-06 Thread Ali Torkamani
Thanks, I checked, FD is not empty, Thanks for reminding about the flush and close, but I think some thing is wrong with: D=[prog[key1] for key1 in sCommonFeatures] In the debug mode it works fine from the command line, but in the for loop it gets stuck. Ali On Fri, Jul 6, 2012 at 12:22 PM, Pra

Re: [Tutor] Program gets stuck after a creating a list from dictinary items!

2012-07-06 Thread Prasad, Ramit
From: Ali Torkamani > I'm trying to write a dictionary into a csv file, in the following code > FlatData is the global dictionary whose keys are datetime objects, and the > values are list of dictionaries. sCommonFeatures are key's that exist in all > of such 'sub'-dictionaries, and sOtherFeatures

[Tutor] Program gets stuck after a creating a list from dictinary items!

2012-07-06 Thread Ali Torkamani
Dear Tutors, I'm trying to write a dictionary into a csv file, in the following code FlatData is the global dictionary whose keys are datetime objects, and the values are list of dictionaries. sCommonFeatures are key's that exist in all of such 'sub'-dictionaries, and sOtherFeatures are the key's t

Re: [Tutor] program code for Python Programming for the Absolute Beginner, 3rd ed.?

2011-08-29 Thread Richard D. Moores
On Mon, Aug 29, 2011 at 00:19, TheIrda wrote: > on the left check the Programming, networking and security and look for your > book. > Click download and you can see the link to the source code and book related > software > > http://www.delmarlearning.com/companions/content/1435455002/downloads/in

[Tutor] program code for Python Programming for the Absolute Beginner, 3rd ed.?

2011-08-28 Thread Richard D. Moores
The book says the program code is in py3e_source.zip, at www.courseptr.com/downloads , but that leads to the book at with a "View Available Downloads" link that yields no downloads. Does anyone know where py3e_source.zip is? Or

Re: [Tutor] Program to Predict Chemical Properties and Reactions

2011-07-16 Thread Dave Angel
On 07/16/2011 07:21 PM, Christopher King wrote: Actually maybe not, depending on the complexity of the pattern, but it would be difficult. You would have to know how much it decreases for every time you go down or to the right. If its more complex than that, you may have to program each rule in,

Re: [Tutor] Program to Predict Chemical Properties and Reactions

2011-07-16 Thread Christopher King
Actually maybe not, depending on the complexity of the pattern, but it would be difficult. You would have to know how much it decreases for every time you go down or to the right. If its more complex than that, you may have to program each rule in, not just enter them in a prompt. I'm assuming none

Re: [Tutor] Program to Predict Chemical Properties and Reactions

2011-07-16 Thread Dave Angel
On 07/16/2011 05:32 PM, B G wrote: Thanks, Emile-- although I'm not sure I was completely clear about my objective. What I really meant is that is there a way (via machine learning) to give the computer a list of rules and exceptions, and then have it predict based on these rules the ionization e

Re: [Tutor] Program to Predict Chemical Properties and Reactions

2011-07-16 Thread B G
Thanks, Emile-- although I'm not sure I was completely clear about my objective. What I really meant is that is there a way (via machine learning) to give the computer a list of rules and exceptions, and then have it predict based on these rules the ionization energy. Ultimately I'm pretty interest

Re: [Tutor] Program to Predict Chemical Properties and Reactions

2011-07-16 Thread Emile van Sebille
On 7/16/2011 9:24 AM B G said... I was just wondering how feasible it would be to build something like the following: Brief background, in chemistry, the ionization energy is defined as the energy required to remove an electron from an atom. The ionization energies of different elements follow g

[Tutor] Program to Predict Chemical Properties and Reactions

2011-07-16 Thread B G
I was just wondering how feasible it would be to build something like the following: Brief background, in chemistry, the ionization energy is defined as the energy required to remove an electron from an atom. The ionization energies of different elements follow general trends (ie moving left to ri

Re: [Tutor] Program

2011-05-19 Thread Noah Hall
On Thu, May 19, 2011 at 7:23 PM, Johnson Tran wrote: > So I figured out how to use the loop method, thanks. I still cannot seem to > figure out how to use Len() to show the output of my answers (from all my > googling Len() seems to be used to count characters?) Also, I am not really > sure I u

Re: [Tutor] Program

2011-05-19 Thread Johnson Tran
So I figured out how to use the loop method, thanks. I still cannot seem to figure out how to use Len() to show the output of my answers (from all my googling Len() seems to be used to count characters?) Also, I am not really sure I understand how to use the append method of the list. Here's my

Re: [Tutor] Program

2011-05-18 Thread Alan Gauld
"Johnson Tran" wrote I had a couple questions about my program: def CollectNames(): answer_set=set([]) sorted_list = sorted(answer_set) This creates an empty set then sorts it and stores the result as an empty list. I'm not sure what you think it does but I'm guessing that's not it...

Re: [Tutor] Program

2011-05-18 Thread Wayne Werner
On Wed, May 18, 2011 at 7:26 AM, Johnson Tran wrote: > Hi Again All, > > I had a couple questions about my program: > Corey gave you some good pointers already, but let me add a few... > > def CollectNames(): > >answer_set=set([]) >sorted_list = sorted(answer_set) > This won't do what

Re: [Tutor] Program

2011-05-18 Thread Corey Richardson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/18/2011 09:05 AM, Johnson Tran wrote: > Thanks for the reply. > > So to append a word is it suppose to look kind of like: > > word=raw_input("Name #1: ") > word.append(words) > > I keep getting error message: > > Traceback (most recent ca

Re: [Tutor] Program

2011-05-18 Thread Johnson Tran
Thanks for the reply. So to append a word is it suppose to look kind of like: word=raw_input("Name #1: ") word.append(words) I keep getting error message: Traceback (most recent call last): File "/Users/JT/Desktop/pythonfinal", line 23, in CollectNames() File "/Users/JT/Desktop/pyt

Re: [Tutor] Program

2011-05-18 Thread Corey Richardson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/18/2011 08:26 AM, Johnson Tran wrote: > Hi Again All, > > I had a couple questions about my program: > > def CollectNames(): > > answer_set=set([]) > sorted_list = sorted(answer_set) > word=raw_input("Name #1: ") > > word=

[Tutor] Program

2011-05-18 Thread Johnson Tran
Hi Again All, I had a couple questions about my program: def CollectNames(): answer_set=set([]) sorted_list = sorted(answer_set) word=raw_input("Name #1: ") word=raw_input("Name #2: ") word=raw_input("Name #3: ") word=raw_input("Name #4: ") word=raw_input(

Re: [Tutor] program hangs in while loop using wx.yield

2010-11-16 Thread Alan Gauld
"Patty" wrote then I went through Alan Gauld's tutorial which also helped. Glad to hear it :-) If I just can't figure out how to do this with Tkinter and the Python I can send some basic code if that would help... Imaging Library, is 'wxPython' the additional software I would want to

Re: [Tutor] program hangs in while loop using wx.yield

2010-11-16 Thread Walter Prins
Not wanting to hijack Terry's conversation, but for what it's worth: On 16 November 2010 18:08, Patty wrote: > If I just can't figure out how to do this with Tkinter and the Python > Imaging Library, is 'wxPython' the additional software I would want to > install and try with? Is its purpose to

Re: [Tutor] program hangs in while loop using wx.yield

2010-11-16 Thread Patty
tandards for this language? Regards, Patty - Original Message - From: "Terry Carroll" To: Sent: Monday, November 15, 2010 11:37 PM Subject: Re: [Tutor] program hangs in while loop using wx.yield On Sun, 14 Nov 2010, Alex Hall wrote: Is there a basic tutorial for this

Re: [Tutor] program hangs in while loop using wx.yield

2010-11-15 Thread Terry Carroll
On Sun, 14 Nov 2010, Alex Hall wrote: Is there a basic tutorial for this sort of thing? Chapter 3 ("Working in an event-driven environment") of the book "wxPython in Action" is a pretty good tutorial on event-driven GUI programming in wxPython. The book in general is pretty good; I no longe

Re: [Tutor] program hangs in while loop using wx.yield

2010-11-15 Thread Alan Gauld
"Alex Hall" wrote Is there a basic tutorial for this sort of thing? There are a few books on the suvbject but I can't thik of any titles off the top of my head. And mostly they are written for C++ rather than Python. fraction of a second. However, I need to wait for as long as the human ta

Re: [Tutor] program hangs in while loop using wx.yield

2010-11-14 Thread Walter Prins
On 15 November 2010 00:12, Alex Hall wrote: > Again: is there a basic tutorial that would explain how control works > when dealing with a gui, especially one that is meant to last a long > time but occasionally block input? > Normally the way is for the GUI controls (e.g. widgets, grids, objects

Re: [Tutor] program hangs in while loop using wx.yield

2010-11-14 Thread Alex Hall
On 11/14/10, Alan Gauld wrote: > "Alex Hall" wrote > >> The problem is that I want to go until there is a winner. You are >> right about just letting the mainloop of the gui handle input (I >> forgot the gui is already looping and waiting for input) but I would >> like to make the user pause whil

Re: [Tutor] program hangs in while loop using wx.yield

2010-11-14 Thread Alan Gauld
"Alex Hall" wrote The problem is that I want to go until there is a winner. You are right about just letting the mainloop of the gui handle input (I forgot the gui is already looping and waiting for input) but I would like to make the user pause while the computer goes, this way the user cann

Re: [Tutor] program hangs in while loop using wx.yield

2010-11-14 Thread Alex Hall
On 11/14/10, Alan Gauld wrote: > "Alex Hall" wrote > >> I had this working back in the summer, but have since had to >> restructure some things in the code. Now, my program is hanging >> while >> it waits for the human player to take his/her turn, and I am not >> sure >> how to free it; > > I don

Re: [Tutor] program hangs in while loop using wx.yield

2010-11-14 Thread Alan Gauld
"Alex Hall" wrote I had this working back in the summer, but have since had to restructure some things in the code. Now, my program is hanging while it waits for the human player to take his/her turn, and I am not sure how to free it; I don't really understand this concept in a GUI? Why wo

[Tutor] program hangs in while loop using wx.yield

2010-11-13 Thread Alex Hall
Hi all, I had this working back in the summer, but have since had to restructure some things in the code. Now, my program is hanging while it waits for the human player to take his/her turn, and I am not sure how to free it; as long as it hangs, the player cannot do anything, so it continues to han

Re: [Tutor] Program to Simulate Keystrokes

2009-08-04 Thread Kent Johnson
On Tue, Aug 4, 2009 at 3:01 PM, Chris Fuller wrote: > On Tuesday 04 August 2009 12:43, Megan Land wrote: >> If at all possible I need a program that will work on Windows and Linux (I >> know a tall order).  I'm trying to keep this simple but if I have to use >> two different programs I will. > If

Re: [Tutor] Program to Simulate Keystrokes

2009-08-04 Thread Chris Fuller
On Tuesday 04 August 2009 12:43, Megan Land wrote: > Hi, > > I'm working on a python script to automate a program we run at work. The > program is run from one command. The only problem is that it asks you to > hit enter to continue after it runs. Is there a way I can do this? > > If at all poss

Re: [Tutor] Program to Simulate Keystrokes

2009-08-04 Thread Wayne
On Tue, Aug 4, 2009 at 12:43 PM, Megan Land wrote: > Hi, > > I'm working on a python script to automate a program we run at work. The > program is run from one command. The only problem is that it asks you to hit > enter to continue after it runs. Is there a way I can do this? > > If at all poss

Re: [Tutor] Program to Simulate Keystrokes

2009-08-04 Thread Alan Gauld
"Megan Land" wrote I'm working on a python script to automate a program we run at work. The program is run from one command. The only problem is that it asks you to hit enter to continue after it runs. Is there a way I can do this? Assuming it is using stdin/out to read the keystrokes yo

[Tutor] Program to Simulate Keystrokes

2009-08-04 Thread Megan Land
Hi, I'm working on a python script to automate a program we run at work. The program is run from one command. The only problem is that it asks you to hit enter to continue after it runs. Is there a way I can do this? If at all possible I need a program that will work on Windows and Linux (I k

Re: [Tutor] Program Slicing / Trace

2009-06-25 Thread Kent Johnson
On Thu, Jun 18, 2009 at 10:37 AM, Jojo Mwebaze wrote: > Hi Tutor > > The problem i have is to see which statements modify my data at execution > time without referring to the code. Referring to the code is difficult esp > because of branching. You can never tell before hand which branch execution >

Re: [Tutor] Program Slicing / Trace

2009-06-18 Thread Jojo Mwebaze
True both are assignments, L3, does change a value of any variable. Johnson On Thu, Jun 18, 2009 at 4:53 PM, Elisha Rosensweig wrote: > It is not clear to me in what way line 3 is different than line 2 - both > are assignments... Please clarify > > Elisha > > On Thu, Jun 18, 2009 at 10:37 AM,

Re: [Tutor] Program Slicing / Trace

2009-06-18 Thread Emile van Sebille
On 6/18/2009 7:37 AM Jojo Mwebaze said... Hi Tutor The problem i have is to see which statements modify my data at execution time without referring to the code. Referring to the code is difficult esp because of branching. You can never tell before hand which branch execution will follow. e.

Re: [Tutor] Program Slicing / Trace

2009-06-18 Thread Elisha Rosensweig
It is not clear to me in what way line 3 is different than line 2 - both are assignments... Please clarify Elisha On Thu, Jun 18, 2009 at 10:37 AM, Jojo Mwebaze wrote: > Hi Tutor > > The problem i have is to see which statements modify my data at execution > time without referring to the code. R

[Tutor] Program Slicing / Trace

2009-06-18 Thread Jojo Mwebaze
Hi Tutor The problem i have is to see which statements modify my data at execution time without referring to the code. Referring to the code is difficult esp because of branching. You can never tell before hand which branch execution will follow. e.g in the example below, statements 1, 2, 5,7 and

Re: [Tutor] Program to report if file was modified today

2009-02-12 Thread David
David wrote: > Kent Johnson wrote: > >> On Wed, Feb 11, 2009 at 11:21 PM, bob gailer wrote: >> >> >> > Thanks Alan and Kent, > This works as expected; > > #!/usr/bin/python > import sys > import os > import time > > def mod(): > """Find files modified today, given a file path.""" >

Re: [Tutor] Program to report if file was modified today

2009-02-12 Thread David
Kent Johnson wrote: > On Wed, Feb 11, 2009 at 11:21 PM, bob gailer wrote: > > Thanks Alan and Kent, This works as expected; #!/usr/bin/python import sys import os import time def mod(): """Find files modified today, given a file path.""" now = time.strftime('%Y-%m-%d', time.localtime(

Re: [Tutor] Program to report if file was modified today

2009-02-12 Thread Kent Johnson
On Wed, Feb 11, 2009 at 11:21 PM, bob gailer wrote: > David wrote: >> >> I get this error with the int(time.localtime()) >> start_of_today = int(time.localtime()) >> TypeError: int() argument must be a string or a number, not >> 'time.struct_time' > > Should have been start_of_today = int(time.ti

Re: [Tutor] Program to report if file was modified today

2009-02-12 Thread Alan Gauld
"David" wrote I really only want it to report when a file has been modified so this seems to work, #!/usr/bin/python import sys import os import time def mod(): """Find files modified today, given a file path.""" latest = 0 now = time.strftime('%Y-%m-%d', time.localtime())

Re: [Tutor] Program to report if file was modified today

2009-02-11 Thread bob gailer
David wrote: I get this error with the int(time.localtime()) start_of_today = int(time.localtime()) TypeError: int() argument must be a string or a number, not 'time.struct_time' Should have been start_of_today = int(time.time()) -- Bob Gailer Chapel Hill NC 919-636-4239

Re: [Tutor] Program to report if file was modified today

2009-02-11 Thread David
bob gailer wrote: 1) That can't be the entire program, as there is no call to Mod()! Yep, it was lost in my copy paste 2) Convention says function names start with lower case. Save initial caps for class names. Thanks for the reminder, I had forgotten :) 3) Get rid of latest - that is why yo

Re: [Tutor] Program to report if file was modified today

2009-02-11 Thread Kent Johnson
On Wed, Feb 11, 2009 at 8:46 PM, bob gailer wrote: > 5) It is not necessary to convert times to strings. You can get midnight > today from int(time.localtime()) ?? In [1]: import time In [2]: time.localtime() Out[2]: time.struct_time(tm_year=2009, tm_mon=2, tm_mday=11, tm_hour=21, tm_min=20, tm

Re: [Tutor] Program to report if file was modified today

2009-02-11 Thread bob gailer
David wrote: Hi Everyone and thanks for the list and your help. In my adventure in learning Python (never programed before) I am attempting to findout if a file has been modified today given a search path. It is working somewhat. Here it is; #!/usr/bin/python import sys import os import time

[Tutor] Program to report if file was modified today

2009-02-11 Thread David
Hi Everyone and thanks for the list and your help. In my adventure in learning Python (never programed before) I am attempting to findout if a file has been modified today given a search path. It is working somewhat. Here it is; #!/usr/bin/python import sys import os import time def Mod():

Re: [Tutor] Program launcher in taskbar

2008-07-13 Thread Alan Gauld
"ammar azif" <[EMAIL PROTECTED]> wrote I am running ubuntu as my development platform but the application is targeted for windows machine. Is there any platform dependent library that can help me Assuming you mean platform *independent* library I suspect the answer is no. Things like the ta

Re: [Tutor] Program launcher in taskbar

2008-07-13 Thread ammar azif
Subject: Re: [Tutor] Program launcher in taskbar To: tutor@python.org Date: Sunday, July 13, 2008, 9:00 AM Ammar wrote... > Is is possible to place my program icon in the system tray portion > of the taskbar (like instant messaging applications)? > The program will be launched by clickin

Re: [Tutor] Program launcher in taskbar

2008-07-13 Thread Michiel Overtoom
Ammar wrote... > Is is possible to place my program icon in the system tray portion > of the taskbar (like instant messaging applications)? > The program will be launched by clicking on the icon. How to > do this in python and which module should I use? Are you on a Windows machine? Then you

[Tutor] Program launcher in taskbar

2008-07-13 Thread ammar azif
Hi, Is is possible to place my program icon in the system tray portion of the taskbar(like instant messaging applications)? The program will be launched by clicking on the icon. How to do this in python and which module should I use? ___ Tutor

[Tutor] Program Review: startup_user script -and- TimedMultiChoiceDialog class

2008-01-20 Thread ethan s
Hi folks. I'd love some feedback for two scripts. -startup_user: Intended to be called from a users logon script to present a list of apps to launch. List items can be set to default on or off. I run it from my system logon script like this: if exist "c:\_utils\scripts\logon_%USERNAME%.py" pytho

Re: [Tutor] Program Specification Request

2008-01-16 Thread Alan Gauld
"johnf" <[EMAIL PROTECTED]> wrote > > Coming from Scotland I have no idea what that means! > > What no Girl Scout cookies in Scotland???:-) Well we have girls and we have scouts and we have girls who are in the scouts equivalent for girls - the brownies. Brownies are a kind of cookie aren't they

Re: [Tutor] Program Specification Request

2008-01-16 Thread johnf
On Wednesday 16 January 2008 02:44:25 pm Alan Gauld wrote: > >   It is, almost, (19 January 2008)GS cookie time in > > CA. > > Coming from Scotland I have no idea what that means! What no Girl Scout cookies in Scotland???:-) -- John Fabiani ___ Tutor m

Re: [Tutor] Program Specification Request

2008-01-16 Thread Alan Gauld
"Roger Maxwell" <[EMAIL PROTECTED]> wrote > I would like to learn and teach my 2 girls a mini > database GUI program in Python and Since sqlite is included in the standard distribution of Pythn 2.5 you might as well use that. It is easy to administer and uses a simplified version of st

Re: [Tutor] Program Specification Request

2008-01-16 Thread R. Alan Monroe
>I would like to learn and teach my 2 girls a mini > database GUI program in Python and >They are Girl Scouts (and advanced MS & HS > students) http://davidbau.com/archives/2005/07/29/haaarg_world.html Alan ___ Tutor maillist - Tutor@py

Re: [Tutor] Program Specification Request

2008-01-16 Thread bhaaluu
Greetings, Take a look at this page: http://davidbau.com/python/learning.html and also this one (by the same programmer): http://davidbau.com/archives/2005/07/29/haaarg_world.html Not only are these interesting reads, but also give a glimpse into what it takes to teach kids computer programmin

Re: [Tutor] Program Specification Request

2008-01-16 Thread Ben Bartrum
>Question(s): >Q01: Is this a 'reasonable' first project? Yes. But I'd say do it in 2 phases. First do a command-line version, then do the GUI. >Q02: We can use either MAC or WinXP but which? Or both? It realy doesn't matter >Q03: Is this the appropriate forum? Yes _

[Tutor] Program Specification Request

2008-01-16 Thread Roger Maxwell
Hi all: 1st post! Have been lurker 4 some time. Thanks to all. I am new to Python and a former DOS Clipper programmer. I would like to learn and teach my 2 girls a mini database GUI program in Python and They are Girl Scouts (and advanced MS & HS students) It is, almost, (19 Jan

Re: [Tutor] Program review

2008-01-07 Thread Kent Johnson
Ricardo Aráoz wrote: > looking at the simpler use, if you would have exception handling in : > > try : > with open('/etc/passwd', 'r') as f: > for line in f: > print line > ... more processing code ... > except ExceptionsOnOpening : > ... exception handling

Re: [Tutor] Program review

2008-01-07 Thread Ricardo Aráoz
Torsten Marek wrote: >> try : >> with open('/etc/passwd', 'r') as f: >> for line in f: >> print line >> ... more processing code ... >> except ExceptionsOnOpening : >> ... exception handling >> except : >> ... exceptions inside the for >> >> >> >> Whereas

Re: [Tutor] Program review

2008-01-07 Thread Torsten Marek
On Mo, 2008-01-07 at 21:15 -0300, Ricardo Aráoz wrote: > Kent Johnson wrote: > > Ricardo Aráoz wrote: > >> PEP 0343 is not an > >> example of clarity in the definition of a statement, it mixes > >> justification with historic development with definition with actual > >> equivalent code. Couldn't o

Re: [Tutor] Program review

2008-01-07 Thread Ricardo Aráoz
Kent Johnson wrote: > Ricardo Aráoz wrote: >> Kent Johnson wrote: >>> from contextlib import nested >>> with nested(open_file(self.direcciones), open_file(self.excluidas)) >>> as (fIncl, fExcl): >>> >> Nice! How would you add exception reporting to this? > > I don't have a good answer to tha

  1   2   >