Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3 language support #63

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

python3 language support #63

wants to merge 6 commits into from

Conversation

irsbugs
Copy link

@irsbugs irsbugs commented May 21, 2020

Support for the Python 3 Language

Laby currently supports programming of the ant in the Python language version 2.

Python 2 was released 20 years ago and was officially discontinued at the beginning this year. Python 3, version 3.5 and later, are the currently supported releases. Some Linux distributions are now no longer including Python 2 as part of the distribution.

This pull request is for providing Python 3 as a language for Laby. Four new files are added:

/usr/share/laby/mods/python3/
├── help
├── lib
│   └── robot.py
├── rules
└── skel

To highlight some of the changes between the Python 2 and Python 3 robot.py files:

  • The file is now PEP8 compliant.
  • The local output() and input() functions have been removed.
  • The import sys; is removed.
  • sys.stdout.write() and sys.stdout.flush() are replaced by the prompt feature of Python3 builtin input() function.
  • The sys.stdin.readline() is replaced by the Python 3 builtin input() function.
  • When using look() the string received by input() is returned without adding the complexity of enumerated constants.

The help, rules, and skel files have had minor modifications from their Python 2 versions to make them suitable for use with Python 3.

Upon implementing support in Laby for the Python 3 language, the Python 2 functionality should be deprecated.

Regards, Ian Stewart. 2020-05-21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant