In this blog I will be posting some very simple examples of Python code. Since there are a number of different Python interpreters available today. I will not cover how to get the finished code to run. Follow the instructions for your particular interpreter.
Hello World Code
#!/usr/bin/env python
print 'Hello World'
The first line in the code example tells POSIX compliant OS's using the Bash command interpreter where the Python command interpreter is. So far as I know this is not strictly speaking Python code and likely won't work in Windows or other non-POSIX environments.
The second line of code is Python code. This is as simple as a Python program gets.
No comments:
Post a Comment