Re: [Tutor] really basic question..

2017-08-05 Thread Alan Gauld via Tutor
On 05/08/17 16:48, bruce wrote: > redid a search just now. found a bunch of sites that said it's > doable.. embarrased Just because its doable doesn't mean you should though... Bare except clauses can hide a multitude of sins. Unless its at the top level of your program and you use it to log

Re: [Tutor] unorderable types

2017-08-05 Thread Howard Lawrence
# this is a guess number game. import random guessesTaken = 0 print('hello! What is your name?') myName = input() number = random.randint(1, 20) print('Well, ' + myName + ', i am thinking of a number between 1 and 20') while guessesTaken < 6: print('take a guess.') guess = input()

Re: [Tutor] unorderable types

2017-08-05 Thread Howard Lawrence
Typing the : print("type (guess_value)=", type (guess_value)) print("type (number)=",type(number) type (guess_value)= type (number)= == the code runs again then prints type guess_value =< class int> type number= = Now Traceback kicks in

Re: [Tutor] Unorderable types

2017-08-05 Thread Cameron Simpson
On 04Aug2017 22:00, boB Stepp wrote: When I attempted to recreate his error message with the original code snippets he sent, I got something a bit different: py3: guess = input() 2 py3:

[Tutor] how to make an lexical scope block?

2017-08-05 Thread Xiaosong Chen
In C, it's a common pattern to use temporary variables in an lexical scope to prevent the global scope from getting dirty. For example, ```C int a[N]; for (int i = 0; i < N; i++) { int temp = ... a[i] = ... // something got from temp } // temp do not exists here ``` But in python, such a

Re: [Tutor] how to make an lexical scope block?

2017-08-05 Thread Peter Otten
Xiaosong Chen wrote: > In C, it's a common pattern to use temporary variables in an lexical > scope to prevent the global scope from getting dirty. > For example, > > ```C > int a[N]; > for (int i = 0; i < N; i++) { > int temp = ... > a[i] = ... // something got from temp > } > // temp do

Re: [Tutor] how to make an lexical scope block?

2017-08-05 Thread Steven D'Aprano
On Sat, Aug 05, 2017 at 03:23:57PM +0800, Xiaosong Chen wrote: > In C, it's a common pattern to use temporary variables in an lexical > scope to prevent the global scope from getting dirty. [...] > But in python, such a pattern seems impossible. An straightforward > translation should be like

Re: [Tutor] file move with wait period

2017-08-05 Thread banda gunda
Thanks Cameron (I hope I address your first name correctly). Get Outlook for iOS From: Cameron Simpson Sent: Friday, August 4, 2017 5:18:58 AM To: banda gunda Cc: tutor@python.org Subject: Re: [Tutor] file move with wait

Re: [Tutor] Recommended Python Compiler

2017-08-05 Thread George Sconyers via Tutor
Thank you all for the feedback. As most of you pointed out I meant "IDE" instead of "compiler."  There are a lot of options for me to check out this weekend. Looking forward to cracking a case of Mountain Dew and digging in.  George Sent from Yahoo Mail for iPhone On Tuesday, August 1, 2017,

Re: [Tutor] Unorderable types

2017-08-05 Thread Peter Otten
boB Stepp wrote: > Did the text of this error message change between Python 3.5 and 3.6? Yes: $ python3.5 -c '1 < ""' Traceback (most recent call last): File "", line 1, in TypeError: unorderable types: int() < str() $ python3.6 -c '1 < ""' Traceback (most recent call last): File "", line

Re: [Tutor] how to make an lexical scope block?

2017-08-05 Thread Alan Gauld via Tutor
On 05/08/17 08:23, Xiaosong Chen wrote: > In C, it's a common pattern to use temporary variables in an lexical > scope to prevent the global scope from getting dirty. This was very common in the early days of C - around 1979-1985 - when compilers often only considered the first 4 (or 6)

[Tutor] really basic question..

2017-08-05 Thread bruce
Hey guys. A really basic question. I have the following: try: element = WebDriverWait(driver, 100).until(EC.presence_of_element_located((By.ID, "remarketingStoreId"))) except TimeoutException: driver.close() I was wondering can I do something like the following to

Re: [Tutor] really basic question..

2017-08-05 Thread bruce
Lord... redid a search just now. found a bunch of sites that said it's doable.. embarrased Not sure what I was looking for earlier.. need r u m! On Sat, Aug 5, 2017 at 11:44 AM, bruce wrote: > Hey guys. > > A really basic question. I have the following: > try: >