Page 1 of 1

Pibrella coding problem

Posted: Sat Mar 21, 2015 3:53 pm
by Clarnico 999
Hello.
I am currently trying to write the code for a robot using my rPi (model b), and am having a few problems.
It is not allowing me to run the code as saved in Python, so I have tried saving it in Leafpad instead.
It initially runs, but says that there is an error, and then exits ("Pibrella exiting cleanly, please wait... (etc)).
Is there any way to change this, so that I can save and run a file rather than retyping it into LX terminal each time please?
Thank you.

Re: Pibrella coding problem

Posted: Sat Mar 21, 2015 5:05 pm
by B.Goode
The 'workflow' is something like this:

From the desktop or command line (LXterminal), start an editor. You can create a new file, or edit an existing one, according to your needs. There are *many* choices of editor: nano, leafpad and idle are all installed by default with Raspbian. Once you have created or modified your script save it with a name that allows you to recognise it, such as mypitest.py

To run the script from the command line, use python mypitest.py (I don't recall whether PiBrella scripts need to be run with 'superuser'/'admin' privilages - if so use sudo python mypitest.py)

Other than for the briefest experiments, re-typing code is not the way to go about things...

The python interpreter (the program that runs when you type python) is to run your script: it isn't a convenient way to write and modify a script.

The idle IDE provides a way to combine access to an editor and the python interpreter within one set of desktop windows, and some users find this combination convenient, but it is not the only way to develop python code.