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.
New to programming
-
Hi, I am new to programming anything. I just bought the app and can't figure out the interpreter. I enter the simple examples like >>> 2+2 , I receive the message "you can't run text file" , "no script loaded" . As I said I have no previous experience whatsoever. I just thought I would try it out. Any help would be appreciated.
-
I don't know what are you doing exactly to access to the intepreter, but obviously it doesn't work how you tried :-)
There are several ways to run python code. From easy to difficult, they are:
- Go to the "Preview" screen. Notice four buttons at top. One of them is "Console". Press it, and you will arrive to a blank screen with a bar at the bottom which has the symbol
>
. You can write there direct python expressions such as2+2
(do not write the>>>
which is not part of the python language, but the prompt used by standard python interpreter in other operating systems). The answer appears in the blank area. - The approach in 1 is good for small snippets, but if you want to write something longer, press the button "Python Scratchpad". Write your program there and run it pressing the "▶ " button. Note that, since you are not in the console anymore, expressions such as
2+2
will not print any result by default. If you want to see the result of an expression, you have toprint
it, eg:print 2+2
- As part of a workflow. Once you are confident with you python skills, you can write python code which is executed as part of a workflow. For that, you have to use the "Run python script" action from the Action Library. Typically you'll want that your script can have access to other workflow variables, such as the selection or the input. This is somewhat advanced stuff, so better leave it for the future.
- Go to the "Preview" screen. Notice four buttons at top. One of them is "Console". Press it, and you will arrive to a blank screen with a bar at the bottom which has the symbol
-
Hi, Merry Christmas! I thank you for the information, I see how it works now. I cannot thank you enough.