Copyright (c) Hyperion Entertainment and contributors.

Difference between revisions of "AmigaOS Manual: Python Getting Started"

From AmigaOS Documentation Wiki
Jump to navigation Jump to search
(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 21: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.