Python 3.8 - alpha release
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
GavinWraith (26) 1563 posts |
But there is. From the desktop press F12. The trouble with this, in these days of graphics modes with millions of pixels, is that the commandline may be a tiny little strip along the bottom of the screen and practically invisible. If you press CTRL-F12 you will get a taskwindow, presuming that you have an editor running which serves taskwindows (Edit, StrongED, Zap), which is easier to use as you have not left the desktop. |
Fred Graute (114) 645 posts |
It’s StrongED. As has been pointed out you’re in a TaskWindow but StrongED is using Python mode which doesn’t pass keypresses onto the underlying task (as Python mode is intended for editing Python files). Switching to TaskWindow mode should fix the problem: At the bottom of the StrongED window is the Infobar and on there should be the name ‘Python’. Click on it with the right mouse button. In the menu that appears, choose TaskWindow. If TaskWindow is not in the menu check the ‘Extra modes’ submenu at the bottom. After that you should be in TaskWindow and editing should work better. |
Stuart Mitchell (3034) 9 posts |
Ah, that makes more sense!! @Gavin – thanks, I knew about F12 for the tiny bottom of the screen command line, but hadn’t understood that you can run Python from there too – it should have been obvious really. @Fred – again, thank you – I wondered if it was more likely to be something to do with the relationship between the editor and the Python prompt/environment, but as a novice at this level of computing, it was opaque to me. I shall try again following your instructions. Thanks everyone! |
Stuart Mitchell (3034) 9 posts |
Tested and working as described. Thanks! |
Lothar (3292) 134 posts |
In RPCEmu it gives the error: Fatal Python error: _Py_HashRandomization_Init: failed to get random numbers to initialize Python Does it not work on ARM7 or do I miss a library? |
David Pitt (3386) 1248 posts |
The CryptRand module is needed in !System. Python 3.8.5 does run on RPCEmu here. CryptRandom is on PackMan and directly here. |
Chris Johns (8262) 242 posts |
Yes – that’s the one. Thanks David. Note to self – move CryptRandom from the ‘Recommends’ to the ‘Depends’ section. |
Chris Johns (8262) 242 posts |
Updated package now on my test site, along with a test of python site, numpy and pygame. Consider it beta :) |
Lothar (3292) 134 posts |
Thanks for CryptRandom Where can I find newest Python 3.8.5? When I search for !Python3 the newest I get is: https://github.com/c-jo/cpython/releases/tag/riscos-3.8.0-a6 |
Chris Johns (8262) 242 posts |
You can get 3.8.5 as a PackMan package from http://packages.lessthan3.org.uk/ or add http://packages.lessthan3.org.uk/pkg/testing as a source to PackMan. Usual disclaimers apply. When I’ve sorted out any major issues I will release them onto the ROOL servers. |
Lothar (3292) 134 posts |
Thanks I found it. Now how can I run a Python program from the interpreter? This works: exec(open('hello').read()) But this does not work: import hello |
David J. Ruck (33) 1629 posts |
Import from the interpreter works for me, but my program is called hello/py Trying with just plain hello gave ModuleNotFoundError: No module named ‘hello’Interestingly renaming it back to hello/py didn’t help, I had to quit the interpreter and restart it, before it worked again. So it looks like Python needs the RISC OS equivelent of the py file extension for import to work, and it also seems to be caching directories on the Python search path (including the current directory) at startup. |
Chris Johns (8262) 242 posts |
Did you set the type to Python3? It will look for that or the /py ending. I think it does cache what’s on the search path, but I can’t remember the full details now. |
Andrew McCarthy (3688) 605 posts |
I was feeling brave today, so I installed Python3 using PackMan. *Edit.. clearly starting the day well, as I didn’t spot pip isn’t supported in 3.8.5 until I hit the send button… (Face to palm!) |
Chris Johns (8262) 242 posts |
You could try coping the contents of 3.8.0a6 Lib.site-packages into PythonSite.Python38.Site-Packages (PythonSite package installs that). I’ve not tried it yet but it might work. It’s next in my tasks to make a RiscPkg for pip .. |
Andrew McCarthy (3688) 605 posts |
Thank you for the suggestion, had a go, no luck here… |
Tristan M. (2946) 1039 posts |
Nor did I apparently. I guess it’s why it goes down in flames when I try to use pip. I’ve been shuffling things like a madman. A decent chunk of the packages I’m running on my RISC OS were built with gcc8. I thought (and am still semi convinced) that’s where my problem lies. |
Chris Johns (8262) 242 posts |
Oh that’a sometime for me to look at then! |
David J. Ruck (33) 1629 posts |
Chris wrote:
Yes typing to Python3 &A73 without an extension works. The file was set to Python &AE5 for use with Python 2.7.16 My Python3 only files are set to &A73, but Python 2 & 3 compatible stuff (the majority) are &AE5. This shouldn’t cause problems for me as they are all cross plaform so have the .py extensions, but it could cause issues for any native code without extensions – you will have to choose whether it should be run on Python 2 or Python 3, but not both. I need some better file icons to make the two types more distinct too.
This will only affect anyone running the interpreter interactively, so shouldn’t be a show stopper, but it could do with documenting as it will catch people out. |
Lothar (3292) 134 posts |
Cannot make it work. Tried all combinations: hello – hello/py – hello inside py directory i.e. DDE style – all file types – all imports: import hello import hello.py import hello/py This works, so finding the file is not the problem: exec(open('hello').read()) |
David Pitt (3386) 1248 posts |
I had noticed that edits do not work as expected having double clicked on the beta !Python3 to finish up in a TaskWindow in Python Mode. Reverting to TaskWindow Mode does resolve the issue. I tried to work out why Python3 did not start up in a plain TaskWindow, but failed. I did discover that removing the In TaskWindow "python3 %*0" -name "Python3" -ctrl -quit -wimpslot 8M Don’t know why, but there it is… |
David Pitt (3386) 1248 posts |
Python 3.8.5-riscos-0 (default, Aug 19 2020, 13:52:07) [GCC 4.7.4] on riscos Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> print(os.getcwd()) ADFS::Titan4.$ >>> import hello3 Hello riscos World - Python3 >>> |
John Rickman (71) 645 posts |
Installation successful and my test programs work, but I get an error trying to get help. Python 3.8.5+ (riscos-1, Aug 26 2020, 15:37:09) [GCC 4.7.4] on riscos Type "help", "copyright", "credits" or "license" for more information. >>> help Type help() for interactive help, or help(object) for help about object. >>> help() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "SCSI::SSD.$.JR.Programz.PYTHON.!Python3.Lib._sitebuiltins", line 102, in __call__ import pydoc File "SCSI::SSD.$.JR.Programz.PYTHON.!Python3.Lib.pydoc", line 366, in <module> class Doc: File "SCSI::SSD.$.JR.Programz.PYTHON.!Python3.Lib.pydoc", line 396, in Doc def getdocloc(self, object, basedir=sysconfig.get_path('stdlib')): File "SCSI::SSD.$.JR.Programz.PYTHON.!Python3.Lib.sysconfig", line 548, in get_path return get_paths(scheme, vars, expand)[name] File "SCSI::SSD.$.JR.Programz.PYTHON.!Python3.Lib.sysconfig", line 538, in get_paths return _expand_vars(scheme, vars) File "SCSI::SSD.$.JR.Programz.PYTHON.!Python3.Lib.sysconfig", line 186, in _expand_vars res[key] = os.path.normpath(_subst_vars(value, vars)) File "SCSI::SSD.$.JR.Programz.PYTHON.!Python3.Lib.sysconfig", line 167, in _subst_vars raise AttributeError('{%s}' % var) from None AttributeError: {'py)version_nodot'} >>> |
David Pitt (3386) 1248 posts |
I get the same here.
added Found it, see typos at lines 85 & 86 in |
John Rickman (71) 645 posts |
Thanks for spotting that – help() is working now |
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14