Re: [Tutor] I don't understand why this program is said to be "not defined" when I test it.

2015-10-16 Thread Alan Gauld
On 16/10/15 23:31, zak nelson wrote: I don't understand why this program is said to be "not defined" when I test it. In future please be more precise in describing the problem, and that means including the full error message in the post. It contains a lot of useful information. I'm guessing it

[Tutor] I don't understand why this program is said to be "not defined" when I test it.

2015-10-16 Thread zak nelson
I don't understand why this program is said to be "not defined" when I test it. def problem22(aList): length=len(aList) if (length>6): bueler=False else: bueler=True for i in aList: if(i < 0 and i > 6)==False: bueler=False

Re: [Tutor] Changes to dbm module/file format

2015-10-16 Thread Peter Otten
Alan Gauld wrote: > Has anyone noticed a change to the DBM file format or is it an OS > specific thing? Last time I used dbm it was on a Windoze box with > Python 3.3 and it generated sets of 3 files for each 'database' > created. (I think this is what it did under v2 as well?) > > I just used it

Re: [Tutor] File operation query

2015-10-16 Thread Reuben
Thanks everyone for the suggestion. At the moment, file.flush() resolves the problem - but I will also give a thought to suggestions provided by other members in this email chain. Regards, RD On Thu, Oct 15, 2015 at 11:05 PM, Alan Gauld wrote: > On 15/10/15 17:00, Reuben wrote: > > I need some

Re: [Tutor] Changes to dbm module/file format

2015-10-16 Thread Alan Gauld
On 16/10/15 01:21, Steven D'Aprano wrote: Python 2.5, under Linux: dbm.open('foo', 'w') creates two files: foo.dir foo.pag Likewise for Python 2.7. Thanks Steven. In Python 3.3 and 3.4, you need to pass the 'c' or 'n' flag, not 'w', and only a single file is created: "foo".

Re: [Tutor] File operation query

2015-10-16 Thread Martin A. Brown
Hello and good day Reuben, I need some clarification for below code. In line 2 of below code snippet, I have provided read and write permission. Assuming I have provided some string input as requested in line 1 - when I try to open "check.txt" file after running the script, it is always empt