problem using pickle

2016-03-13 Thread Nicky Mac
Dear Python team,
I have studied the excellent documentation, and attempted to make use of
pickle thus:

filename = 'my_saved_adventure'
import  pickle
class object:
def __init__(self,i,.t) :
self.id   = i
 .

class world:
def __init__(self):
self.object

class object:
def __init__(self,i,

.then   Object instances of object are created 

myworld = world;
myworld.Object = Object
fileobj = open(filename,'wb')
pickle.dump(myworld,fileobj); fileobj.close()
result = "saved your game to " + filename

fileobj = open(filename,'rb')
myworld = pickle.load(fileobj); fileobj.close()
Object = myworld.Object
result = "restored your game from " + filename


The proecedures execute without error
but a file of only 21b is created containing " €c__main__world q .
altho there are several k of object instance data.

-- 
Nick "Mac" McElwaine
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-25 Thread Nicky Mac
thanks again for continuing to address my problem.
all those files are present as required.
This is a hard slog.
Maybe I should give up and fallback to my now working win 7 system
until a resolution crops up via an update/upgrade.
Have  a happy and peaceful Christmas


On 24 December 2015 at 22:17, eryk sun <eryk...@gmail.com> wrote:

> On Thu, Dec 24, 2015 at 3:29 PM, Nicky Mac <nmcelwa...@gmail.com> wrote:
> >
> > C:\Users\Nick>python -m idlelib
> > ** IDLE can't import Tkinter.
> > Your Python may not be configured for Tk. **
>
> In the 3.5 installation directory, ensure that tkinter is installed in
> Lib/tkinter. There should be an "__init__.py" and several other files
> such as "filedialog.py". Also ensure that the DLLs  directory has the
> extension module "_tkinter.pyd" and dependent DLLs "tcl86t.dll" and
> "tk86t.dll".
>



-- 
Nick "Mac" McElwaine
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-25 Thread Nicky Mac
problem solved :_
I upgraded to 3.5.1 just released, and it works fine!
(except pillow and pygame installs still dont work, but that's not your
problem)
Enjoy the holidays

On 25 December 2015 at 14:12, Nicky Mac <nmcelwa...@gmail.com> wrote:

> thanks again for continuing to address my problem.
> all those files are present as required.
> This is a hard slog.
> Maybe I should give up and fallback to my now working win 7 system
> until a resolution crops up via an update/upgrade.
> Have  a happy and peaceful Christmas
>
>
> On 24 December 2015 at 22:17, eryk sun <eryk...@gmail.com> wrote:
>
>> On Thu, Dec 24, 2015 at 3:29 PM, Nicky Mac <nmcelwa...@gmail.com> wrote:
>> >
>> > C:\Users\Nick>python -m idlelib
>> > ** IDLE can't import Tkinter.
>> > Your Python may not be configured for Tk. **
>>
>> In the 3.5 installation directory, ensure that tkinter is installed in
>> Lib/tkinter. There should be an "__init__.py" and several other files
>> such as "filedialog.py". Also ensure that the DLLs  directory has the
>> extension module "_tkinter.pyd" and dependent DLLs "tcl86t.dll" and
>> "tk86t.dll".
>>
>
>
>
> --
> Nick "Mac" McElwaine
>



-- 
Nick "Mac" McElwaine
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-24 Thread Nicky Mac
wow - a very comprehensive answer.
However it seems I have now got it correctly reinstalled  with the correct
environment and path (as below) So I'm back to my original problem:

C:\Users\Nick>python -m idlelib
** IDLE can't import Tkinter.
Your Python may not be configured for Tk. **

On doing a repair or modify to install tcl/Tk again, the same result.

C:\Users\Nick>python -c "import sys; print(*sys.path, sep='\n')"
 gives
C:\Python\Python35\python35.zip
C:\Python\Python35\DLLs
C:\Python\Python35\lib
C:\Python\Python35
C:\Python\Python35\lib\site-packages
This looks OK,  Python35 directory contains Lib and tcl as it does on my
now working Win7 system, and Lib contains tkinter

C:\Users\Nick>path
PATH=C:\Python\Python35\Scripts\;C:\Python\Python35\;C:\ProgramData\Oracle\Java\javapath;C:\Program
Files\Broadcom\Broadcom 802.11 Network
Adapter;;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program
Files (x86)\ATI Technologies\ATI.ACE\Core-Static;
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-24 Thread Nicky Mac
what a horrible environment windows is to support anything!
(I was a UNIX professional).
seems the user profile PATH is a registry entry, and was not updated when I
deinstalled Python2.7
still haven't  figured out how to change it - I will NOT attempy a regedit.

season's greetings

On 24 December 2015 at 13:59, Nicky Mac <nmcelwa...@gmail.com> wrote:

> Dear python Team
> I think I've been wasting your time:
>
> C:\Users\Nick>path
> PATH=C:\Python27\;C:\Python27\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\Program
> Files\Broadcom\Broadcom 802.11 Network
> Adapter;;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program
> Files (x86)\ATI
> Technologies\ATI.ACE\Core-Static;C:\Python\Python35\Scripts\;C:\Python\Python35\
>
> somehow the new py3.5 has been added to the end, not the beginning.
> guess this path is what you meant by "my profile".
> I'll set about fixing it.
> Meery christmas to you all
> Nick
>
> On 24 December 2015 at 11:06, Nicky Mac <nmcelwa...@gmail.com> wrote:
>
>> Hello again.]
>> not sure what you mean by "my profile".
>> following your suggestion, looks normal:
>>
>> C:\Users\Nick> python -c "import importlib;
>> print(importlib.find_loader('idlelib').path)"
>> C:\Python\Python35\lib\idlelib\__init__.pyc
>>
>> A search for idlelib shows this one plus one deep inside OpenOffice and a
>> Game.
>>
>> On 23 December 2015 at 21:20, eryk sun <eryk...@gmail.com> wrote:
>>
>>> On Wed, Dec 23, 2015 at 1:51 PM, Nicky Mac <nmcelwa...@gmail.com> wrote:
>>> >
>>> > no sign of old Py2.7 anywhere :-
>>> >
>>> > C:\Users\Nick>python -c "import sys; print(*sys.path, sep='\n')"
>>> >
>>> > C:\Python\Python35\python35.zip
>>> > C:\Python\Python35\DLLs
>>> > C:\Python\Python35\lib
>>> > C:\Python\Python35
>>> > C:\Python\Python35\lib\site-packages
>>>
>>> The first blank entry is for the current directory. Do you maybe have
>>> an old "idlelib" directory in your profile?
>>>
>>> Print what it's attempting to load:
>>>
>>> python -c "import importlib;
>>> print(importlib.find_loader('idlelib').path)"
>>>
>>
>>
>>
>> --
>> Nick "Mac" McElwaine
>>
>
>
>
> --
> Nick "Mac" McElwaine
>



-- 
Nick "Mac" McElwaine
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-24 Thread Nicky Mac
sorry to be such a darned nuisance -
fixed the PATH to eliminate Py2.7 references but get same result:

C:\Users\Nick>path
PATH=C:\Python\Python35\Scripts\;C:\Python\Python35\;C:\ProgramData\Oracle\Java\javapath;C:\Program
Files\Broadcom\Broadcom 802.11 Network
Adapter;;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program
Files (x86)\ATI Technologies\ATI.ACE\Core-Static;

C:\Users\Nick>python -m idlelib
C:\Python\Python35\python.exe: Error while finding spec for
'idlelib.__main__' (: bad magic number in 'idlelib':
b'\x03\xf3\r\n'); 'idlelib' is a package and cannot be directly executed

On 24 December 2015 at 14:52, Nicky Mac <nmcelwa...@gmail.com> wrote:

> what a horrible environment windows is to support anything!
> (I was a UNIX professional).
> seems the user profile PATH is a registry entry, and was not updated when
> I deinstalled Python2.7
> still haven't  figured out how to change it - I will NOT attempy a regedit.
>
> season's greetings
>
> On 24 December 2015 at 13:59, Nicky Mac <nmcelwa...@gmail.com> wrote:
>
>> Dear python Team
>> I think I've been wasting your time:
>>
>> C:\Users\Nick>path
>> PATH=C:\Python27\;C:\Python27\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\Program
>> Files\Broadcom\Broadcom 802.11 Network
>> Adapter;;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program
>> Files (x86)\ATI
>> Technologies\ATI.ACE\Core-Static;C:\Python\Python35\Scripts\;C:\Python\Python35\
>>
>> somehow the new py3.5 has been added to the end, not the beginning.
>> guess this path is what you meant by "my profile".
>> I'll set about fixing it.
>> Meery christmas to you all
>> Nick
>>
>> On 24 December 2015 at 11:06, Nicky Mac <nmcelwa...@gmail.com> wrote:
>>
>>> Hello again.]
>>> not sure what you mean by "my profile".
>>> following your suggestion, looks normal:
>>>
>>> C:\Users\Nick> python -c "import importlib;
>>> print(importlib.find_loader('idlelib').path)"
>>> C:\Python\Python35\lib\idlelib\__init__.pyc
>>>
>>> A search for idlelib shows this one plus one deep inside OpenOffice and
>>> a Game.
>>>
>>> On 23 December 2015 at 21:20, eryk sun <eryk...@gmail.com> wrote:
>>>
>>>> On Wed, Dec 23, 2015 at 1:51 PM, Nicky Mac <nmcelwa...@gmail.com>
>>>> wrote:
>>>> >
>>>> > no sign of old Py2.7 anywhere :-
>>>> >
>>>> > C:\Users\Nick>python -c "import sys; print(*sys.path, sep='\n')"
>>>> >
>>>> > C:\Python\Python35\python35.zip
>>>> > C:\Python\Python35\DLLs
>>>> > C:\Python\Python35\lib
>>>> > C:\Python\Python35
>>>> > C:\Python\Python35\lib\site-packages
>>>>
>>>> The first blank entry is for the current directory. Do you maybe have
>>>> an old "idlelib" directory in your profile?
>>>>
>>>> Print what it's attempting to load:
>>>>
>>>> python -c "import importlib;
>>>> print(importlib.find_loader('idlelib').path)"
>>>>
>>>
>>>
>>>
>>> --
>>> Nick "Mac" McElwaine
>>>
>>
>>
>>
>> --
>> Nick "Mac" McElwaine
>>
>
>
>
> --
> Nick "Mac" McElwaine
>



-- 
Nick "Mac" McElwaine
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-24 Thread Nicky Mac
Dear python Team
I think I've been wasting your time:

C:\Users\Nick>path
PATH=C:\Python27\;C:\Python27\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\Program
Files\Broadcom\Broadcom 802.11 Network
Adapter;;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program
Files (x86)\ATI
Technologies\ATI.ACE\Core-Static;C:\Python\Python35\Scripts\;C:\Python\Python35\

somehow the new py3.5 has been added to the end, not the beginning.
guess this path is what you meant by "my profile".
I'll set about fixing it.
Meery christmas to you all
Nick

On 24 December 2015 at 11:06, Nicky Mac <nmcelwa...@gmail.com> wrote:

> Hello again.]
> not sure what you mean by "my profile".
> following your suggestion, looks normal:
>
> C:\Users\Nick> python -c "import importlib;
> print(importlib.find_loader('idlelib').path)"
> C:\Python\Python35\lib\idlelib\__init__.pyc
>
> A search for idlelib shows this one plus one deep inside OpenOffice and a
> Game.
>
> On 23 December 2015 at 21:20, eryk sun <eryk...@gmail.com> wrote:
>
>> On Wed, Dec 23, 2015 at 1:51 PM, Nicky Mac <nmcelwa...@gmail.com> wrote:
>> >
>> > no sign of old Py2.7 anywhere :-
>> >
>> > C:\Users\Nick>python -c "import sys; print(*sys.path, sep='\n')"
>> >
>> > C:\Python\Python35\python35.zip
>> > C:\Python\Python35\DLLs
>> > C:\Python\Python35\lib
>> > C:\Python\Python35
>> > C:\Python\Python35\lib\site-packages
>>
>> The first blank entry is for the current directory. Do you maybe have
>> an old "idlelib" directory in your profile?
>>
>> Print what it's attempting to load:
>>
>> python -c "import importlib;
>> print(importlib.find_loader('idlelib').path)"
>>
>
>
>
> --
> Nick "Mac" McElwaine
>



-- 
Nick "Mac" McElwaine
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-24 Thread Nicky Mac
Hello again.]
not sure what you mean by "my profile".
following your suggestion, looks normal:

C:\Users\Nick> python -c "import importlib;
print(importlib.find_loader('idlelib').path)"
C:\Python\Python35\lib\idlelib\__init__.pyc

A search for idlelib shows this one plus one deep inside OpenOffice and a
Game.

On 23 December 2015 at 21:20, eryk sun <eryk...@gmail.com> wrote:

> On Wed, Dec 23, 2015 at 1:51 PM, Nicky Mac <nmcelwa...@gmail.com> wrote:
> >
> > no sign of old Py2.7 anywhere :-
> >
> > C:\Users\Nick>python -c "import sys; print(*sys.path, sep='\n')"
> >
> > C:\Python\Python35\python35.zip
> > C:\Python\Python35\DLLs
> > C:\Python\Python35\lib
> > C:\Python\Python35
> > C:\Python\Python35\lib\site-packages
>
> The first blank entry is for the current directory. Do you maybe have
> an old "idlelib" directory in your profile?
>
> Print what it's attempting to load:
>
> python -c "import importlib;
> print(importlib.find_loader('idlelib').path)"
>



-- 
Nick "Mac" McElwaine
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-23 Thread Nicky Mac
slight progress:
i reinstalled ticking precompile options in the "Advanced features".
Now I get this:
icrosoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\Nick>python -m idlelib
C:\Python\Python35\python.exe: Error while finding spec for
'idlelib.__main__' (: bad magic number in 'idlelib':
b'\x03\xf3\r\n'); 'idlelib' is a package and cannot be directly executed

any help hugely appreciated!
season's greetings
Nick

On 22 December 2015 at 20:27, Nicky Mac <nmcelwa...@gmail.com> wrote:

> I have run the install (and repair) which explicitly includes Tcl/Tk and l
> have this problem:
>
> Microsoft Windows [Version 10.0.10586] (c) 2015 Microsoft Corporation. All
> rights reserved.
>
> >C:\Python\Python35\python.exe -m idlelib
> ** IDLE can't import Tkinter.
> Your Python may not be configured for Tk. **
>
> Please suggest how this can be fixed
> any support greatly appreciated
>
> Nick  McElwaine
>



-- 
Nick "Mac" McElwaine
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-23 Thread Nicky Mac
dear Python team
thanks for your amazing support!
no sign of old Py2.7 anywhere :-

C:\Users\Nick>python -c "import sys; print(*sys.path, sep='\n')"

C:\Python\Python35\python35.zip
C:\Python\Python35\DLLs
C:\Python\Python35\lib
C:\Python\Python35
C:\Python\Python35\lib\site-packages


On 23 December 2015 at 19:30, eryk sun <eryk...@gmail.com> wrote:

> On Wed, Dec 23, 2015 at 8:38 AM, Nicky Mac <nmcelwa...@gmail.com> wrote:
> >
> > I removed the old python2.7 entries in system Path, the PYTHON variables
> you
> > mentioned are not present.
> > All I have is Python35 in the PATH.
>
> Maybe there's still a stale directory on sys.path for another reason.
> Print sys.path from the command prompt:
>
> python -c "import sys; print(*sys.path, sep='\n')"
>
> P.S. Please reply to the list also this time.
>



-- 
Nick "Mac" McElwaine
-- 
https://mail.python.org/mailman/listinfo/python-list


unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-22 Thread Nicky Mac
I have run the install (and repair) which explicitly includes Tcl/Tk and l
have this problem:

Microsoft Windows [Version 10.0.10586] (c) 2015 Microsoft Corporation. All
rights reserved.

>C:\Python\Python35\python.exe -m idlelib
** IDLE can't import Tkinter.
Your Python may not be configured for Tk. **

Please suggest how this can be fixed
any support greatly appreciated

Nick  McElwaine
-- 
https://mail.python.org/mailman/listinfo/python-list


python 3.5.0rc1 problem opening IDLE in windows

2015-12-04 Thread Nicky Mac
Dear python team
since windows applied some updates last night to my windows 10 and windows
7 systems,
I can't open anything with IDLE as I usually do.
On windows 10 (64bit with 64bit python), I performed the installation
repair procedure.
* Edit with IDLE does not appear as an installed windows program.
* when I open my usual shortcut to IDLE (
C:\Python\Python35\Lib\idlelib\idle.py)
 something briefly flashes on the screen *and immediately disappears.*
* if I directly open a python program in windows, I get these options (as
usual):-
edit with IDLE (-> python launcher for windows console)
edit with IDLE  (-> edit with IDLE (64bit))  - which I always
use, *nothing
happens*

Any ideas gratefully received!!!
sincerely
Nick "Mac" McElwaine
-- 
https://mail.python.org/mailman/listinfo/python-list