Re: [Tutor] key detection

2015-05-05 Thread Jim Mooney Py3.4.3winXP
-reading-from-stdin/ Anyway, I set up msvcrt for now until I install linux - I'm not interested in the program I mentioned, per se, just the error message - mainly to know, generally, what sort of thing it's choking on. Errors are useful

Re: [Tutor] key detection

2015-05-06 Thread Jim Mooney Py3.4.3winXP
On 5 May 2015 at 21:51, Mark Lawrence wrote: > On 06/05/2015 05:30, Jim Mooney Py3.4.3winXP wrote: > >> On 5 May 2015 at 18:32, Steven D'Aprano wrote: >> >> https://code.activestate.com/recipes/577977-get-single-keypress/ >>> >> >> >> Th

Re: [Tutor] key detection

2015-05-06 Thread Jim Mooney Py3.4.3winXP
On 6 May 2015 at 10:41, Jim Mooney Py3.4.3winXP wrote: > I went a further step from the recipes linked to above and got here >> https://pypi.python.org/pypi/readchar > > > I think that's the one that failed for me > Addendum. That only failed in python 3.4. It worked

Re: [Tutor] key detection

2015-05-06 Thread Jim Mooney Py3.4.3winXP
g for special keys, some were printed as hex codes but some as letters. i.e. F11 was b'\x85', but F9 and F10 were b'C' and b'D', so I assume the second byte of some function keys just happens to map to utf-8 letters. Sure enough, when I put in decoding again, F9 and F10

[Tutor] pointer puzzlement

2015-05-07 Thread Jim Mooney Py3.4.3winXP
me? def testid(K=10): K += 10 return 'the ID is', id(K), K *** Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32. *** >>> testid() ('the ID is', 505991936, 20) >>> testid() ('the ID is', 5

Re: [Tutor] pointer puzzlement

2015-05-07 Thread Jim Mooney Py3.4.3winXP
18263656, {'bonk': 'bonkitem'}) >>> testid('clonk') ('the ID is', 18263656, {'bonk': 'bonkitem', 'clonk': 'clonkitem'}) >>> testid('spam') ('th

Re: [Tutor] pointer puzzlement

2015-05-08 Thread Jim Mooney Py3.4.3winXP
On 7 May 2015 at 18:42, Dave Angel wrote: > Python doesn't have pointers So what is the difference between a python name and a pointer? I'm a bit fuzzy on that. -- Jim "What a rotten, failed experiment. I'll start over. Maybe dogs instead of mo

[Tutor] Terminology question

2015-05-14 Thread Jim Mooney Py3.4.3winXP
t;, err) return None vals = get_input() if vals: minimum, maximum, rows, columns = vals try: make_table(minimum, maximum, rows, columns) except ValueError as err: # CATCH FUNCTION ERROR HERE INSTEAD OF IN FUNCTION print("Enter min before max.") else:

Re: [Tutor] Terminology question

2015-05-15 Thread Jim Mooney Py3.4.3winXP
but it didn't work. Could you provide a simple example? Sometimes the docs are heavy slogging if you don't already know what's what ;') -- Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https:

Re: [Tutor] Terminology question

2015-05-16 Thread Jim Mooney Py3.4.3winXP
raise ZeroDivisionError('Here I am') def call_error(): try: make_error() except: print("How do I get the 'Here I am' message to print in the calling routine?") >>> call_error() How do I get the 'Here I am' message t

[Tutor] Getting import to use a variable name

2015-05-19 Thread Jim Mooney Py3.4.3winXP
helps.append(helper) for helper in useful_helps: print(helper.upper() + ':', helper.__doc__, '\n') -- Jim After not doing dishes for a week and washing spoon after spoon, fork after fork, knife after knife - I suddenly understand the mathematical concept of in

Re: [Tutor] Getting import to use a variable name

2015-05-19 Thread Jim Mooney Py3.4.3winXP
> x = 'shutil' >>> import importlib >>> importlib.__import__(x) >>> If I can get dir to accept x I can parse the output to get rid of the __xxx stuff and print it out. -- Jim After not doing dishes for a week and washing spoon after spoon, fork after fork, kni

Re: [Tutor] Getting import to use a variable name

2015-05-19 Thread Jim Mooney Py3.4.3winXP
On 19 May 2015 at 17:25, Jim Mooney Py3.4.3winXP wrote: > > If I can get dir to accept x I can parse the output to get rid of the > __xxx stuff and print it out. > By that I mean dir will give me a list of strings I can then use __doc__ on to get all useful help items. -- Ji

Re: [Tutor] Getting import to use a variable name

2015-05-21 Thread Jim Mooney Py3.4.3winXP
with > > print(attribute_name, attribute.__doc__) > Thanks. That will save a lot of scrolling - and saving scrolling and typing is half the battle ;') -- Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription option

[Tutor] Is there a way to use "with" across suite boundaries?

2015-05-22 Thread Jim Mooney Py3.4.3winXP
=ht) ht.close() def fprint(linelist, ht): # size formatting irrelevant for HTML formatted_string = "{}{}{}{}{}{}".format(*linelist) print(formatted_string, file=ht) print('', file=ht) if __name__ == "__main__": make_lines() -- Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Are the methods in a class copied or just linked to?

2015-07-02 Thread Jim Mooney Py3.4.3winXP
When an instance uses a class method, does it actually use the method that is in the class object's memory space, or is the method copied to the instance? -- Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription op

[Tutor] method conflict?

2015-07-02 Thread Jim Mooney Py3.4.3winXP
def getdata(self): print(self.data) >>> MyClass.setdata >>> id(MyClass.setdata) 40676568 >>> f = MyClass() >>> g = MyClass() >>> id(f.setdata) 43576616 >>> id(g.setdata) 43576616

[Tutor] Python backwards program

2005-04-12 Thread Jim and Laura Ahl
I am very new to programming and I have an assignment to have a raw_input string that is inputted by the user and then is printed backwards.  Can anyone help me?  I can get it to print regular but backwards in not working.   Thank You Jim

Re: [Tutor] Python backwards program

2005-04-13 Thread Jim and Laura Ahl
cookie program that randomly gives one fortune out of 5 to the user.   Jim - Original Message - From: Feziwe Mpondo To: Alberto Troiano Cc: [EMAIL PROTECTED] ; tutor@python.org Sent: Wednesday, April 13, 2005 10:14 AM Subject: Re: [Tutor] Python backwards progr

[Tutor] (no subject)

2005-04-13 Thread Jim and Laura Ahl
How come when I ask it to print i[2:4] from an inputted string it gives me the letters between two and four   But when I ask it to print i[-1:-4] it does not print anything.   Jim ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman

Re: [Tutor] (no subject)

2005-04-14 Thread Jim and Laura Ahl
Jim and Laura Ahl said unto the world upon 2005-04-14 02:09:> How come when I ask it to print i[2:4] from an inputted string it> gives me the letters between two and four> > But when I ask it to print i[-1:-4] it does not print anything.> > Jim> Hi Jim,good to see you

Re: [Tutor] Python backwards program (fwd)

2005-04-14 Thread Jim and Laura Ahl
  i = raw_input("Enter a word.") print i[::-1] raw_input("\n\nPress the enter key to exit.")   Thanks for allowing me to take some of your precious time.   Jim - Original Message - From: Danny Yoo To: [EMAIL PROTECTED] Cc: Tutor Sent: Thursday,

<    1   2   3   4   5   6