Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Editor "No Script Loaded"
-
I do an awfull lot of reading and viewing of code from other projects and routinely run into the "No Script Loaded" screen in the Editor. The reasons for this seem to range from either the file being too large, or the file being in the wrong encoding or format. The most recent incident had to do with downloading some Python sample code from an online book about BS4 (Beautiful Soup 4). Two of the sample code file would not open in Pythonista. In this case the files were not very large - only a page of code. I was able to use brumm's newer PhoneView app to "hexview" the files and see that they were UTF-8 with Windows CR LF line endings and no EOF code at the very end of the file. There was also a " # coding: UTF-8" string at the beginning of the file (note the space before the #). This was all good info, but it still did not give me a "fix" for the file. My fix was to use PhoneView again to HTMLView the file - which worked just fine! I then just did a copy paste from there to a new script file. I left off the coding: UTF-8 line. This was a bit tedious, but it worked. After this I tried the HTMLView on several other files that I could not open and they all worked reasonably well. One was a "C" code file that was 150k and it looked fine except for tabs were not what I would have liked.
This whole thing makes me wonder if using an HTMLView in the Editor could be added. I am pretty sure that there is a project online that implements a full blown source code editor using JavaScript and it seem like the "environment" is much more resilient to encodings and the formats of files then the UI textview.
I also noticed, however, that the hexviewer in PhoneView had no problems displaying any of the files. The 150k file was difficult to navigate, but I was able to scroll though from top to bottom with no crashing. This means that a bare or slighly enhanced text view such as the one already being used by the Editor could be implemented.
I understand that the main purpose of the Editor in Pythonista is to display and edit small Python scripts. The only reason I am having trouble is that I like to use code from other projects and convert to Python. I have lots of C, C++, C#, Java stuff lying around and use this stuff as the starting point for new Python projects.
-
You might want to check out EditAreaForPythonista which is a free javascript editor for source code running in Pythonista.
It is described by @JonB at: http://omz-forums.appspot.com/pythonista/post/5836666543538176
-
@ccc - I actually tried that EditArea out and it worked pretty well. It certainly demonstrates that you can do this kind of thing in Pythonista already and that it may be a good option for extending the current editor. My first impression was that it was more of a word processor type editor but upon further investigation it is more then that. This is a very feature rich project.