Copyright (c) Hyperion Entertainment and contributors.

AmigaOS Manual: Python Getting Started: Difference between revisions

From AmigaOS Documentation Wiki
Jump to navigation Jump to search
Content deleted Content added
Created chapter structure
 
Changed title to "How to write Python programs" and added an example.
Line 3: Line 3:
= Using Python interactively =
= Using Python interactively =


= How to write Python programs =
= Program examples =

== Program 1. Amiga.py ==
<syntaxhighlight lang="python">
# A simple program
print 'Amiga. The Computer For the Creative Mind.'
</syntaxhighlight>

Enter the above program, and save it as '''PYTHON:Scripts/Amiga.py'''. To run the program, open a Shell window and type:

Python PYTHON:Scripts/Amiga.py

You should see the following text in your Shell window:

Amiga. The Computer for the Creative Mind.

Revision as of 20:00, 8 January 2019

Running Python programs

Using Python interactively

How to write Python programs

Program 1. Amiga.py

# A simple program
print 'Amiga. The Computer For the Creative Mind.'

Enter the above program, and save it as PYTHON:Scripts/Amiga.py. To run the program, open a Shell window and type:

Python PYTHON:Scripts/Amiga.py

You should see the following text in your Shell window:

Amiga. The Computer for the Creative Mind.