Re: [Tutor] Terminology question

2015-05-15 Thread Jim Mooney Py3.4.3winXP
On 14 May 2015 at 16:47, Alan Gauld wrote: > Rather than printing the messages you could re-raise > the error but with the error message attached as a string. > I'm a little unclear how you catch the string you create in a raise, in the caller. I tried an example from the docs but it didn't work

Re: [Tutor] Terminology question

2015-05-15 Thread Mark Lawrence
On 15/05/2015 20:02, Jim Mooney Py3.4.3winXP wrote: On 14 May 2015 at 16:47, Alan Gauld wrote: Rather than printing the messages you could re-raise the error but with the error message attached as a string. I'm a little unclear how you catch the string you create in a raise, in the caller.

[Tutor] Help!

2015-05-15 Thread Fredrick Barrett
Hi, I'm a beginner and I've reached a roadblock. I'm trying to create a simple guessing game program just to practice creating loops, however it is not working out as planned. print ("Lets play a game") import random # Generate random number from 1-10 rand_value = random.randint(1,10) guess = in

[Tutor] Connecting Py 2.7 with visa

2015-05-15 Thread Wilson, Pete
Greetings I am trying to write a test executive program using python 2.7 on a windows 7 computer. I want to connect to a Keithley 2100 voltmeter using National Instruments VISA. I am having trouble installing pyvisa. All the documentation refers to using 'pip' and a command line "$ pip install

Re: [Tutor] Help!

2015-05-15 Thread Steven D'Aprano
On Fri, May 15, 2015 at 07:35:30PM -0400, Fredrick Barrett wrote: > print ("Lets play a game") > > import random > > # Generate random number from 1-10 > rand_value = random.randint(1,10) > guess = input("Guess a number from 1-10 ") Here you guess once. > if guess == rand_value: > print (

Re: [Tutor] Connecting Py 2.7 with visa

2015-05-15 Thread Mark Lawrence
On 15/05/2015 23:12, Wilson, Pete wrote: Greetings I am trying to write a test executive program using python 2.7 on a windows 7 computer. I want to connect to a Keithley 2100 voltmeter using National Instruments VISA. I am having trouble installing pyvisa. All the documentation refers to usin

Re: [Tutor] Terminology question

2015-05-15 Thread Steven D'Aprano
On Fri, May 15, 2015 at 12:02:44PM -0700, Jim Mooney Py3.4.3winXP wrote: > On 14 May 2015 at 16:47, Alan Gauld wrote: > > > Rather than printing the messages you could re-raise > > the error but with the error message attached as a string. > > > > I'm a little unclear how you catch the string yo

Re: [Tutor] Terminology question

2015-05-15 Thread Steven D'Aprano
On Thu, May 14, 2015 at 03:43:30PM -0700, Jim Mooney Py3.4.3winXP wrote: > I noticed that if I call a function that throws an error, I can catch it > from the caller, instead of catching it in the function. Is this is what is > known as "errors bubbling up?" Also, is this how you're supposed to do