Difference between revisions of "Python"

From RogueBasin
Jump to navigation Jump to search
m (The Temple of Torment official website is down, and all download references to the game points to that website)
 
(55 intermediate revisions by 33 users not shown)
Line 1: Line 1:
== What is Python ==
{{Programming language| name = Python
|company = Python Software Foundation
|influences = ABC programming language
|updated = May 3, 2021 (3.9.5)<ref>[https://www.python.org/downloads/ Python downloads], official downloads page with release information.</ref>
|status = Stable
|licensing = Open Source<ref>[https://docs.python.org/3/license.html History and License], detailed license info from the Python documentation.</ref>
|platforms = [[Linux]], [[Unix]], [[Mac OS X]], [[Windows]] and others.
|site = http://www.python.org}}


Python is an interpreted, interactive, object-oriented programming language. It incorporates modules, exceptions, dynamic typing, very high level dynamic data types, and classes. Python combines remarkable power with very clear syntax. It has interfaces to many system calls and libraries, as well as to various window systems, and is extensible in C or C++. It is also usable as an extension language for applications that need a programmable interface. Finally, Python is portable: it runs on many Unix variants, on the Mac, and on PCs under MS-DOS, Windows, Windows NT, and OS/2.
== What is Python? ==


''Taken from the official Python FAQ.''
From the official [http://www.python.org/doc/faq/general/#what-is-python Python FAQ]:


"Python is an interpreted, interactive, object-oriented programming language. It incorporates modules, exceptions, dynamic typing, very high level dynamic data types, and classes. Python combines remarkable power with very clear syntax. It has interfaces to many system calls and libraries, as well as to various window systems, and is extensible in [[C]] or [[Cpp|C++]]. It is also usable as an extension language for applications that need a programmable interface. Finally, Python is portable: it runs on many Unix variants, on the Mac, and on PCs under MS-DOS, Windows, Windows NT, and OS/2."


== Roguelike specific details ==
A full set of features can be found [http://www.python.org/about/ here.]
Python's expressive code, dynamic typing, flexible data types, and powerful OO and exception handling facilities make it well-suited to quick, productive RL development. Python is not the best choice if a small memory footprint or raw performance are important. Psyco allows you to get more performance at the cost of more memory, and is highly recommended.


* [[Python_shadowcasting_implementation]] - Python code for field-of-view calculation using Bjorn Bergstrom's excellent [[FOV_using_recursive_shadowcasting|recursive shadowcasting algorithm]].
== Roguelike Specific Details ==


Python's expressive code, dynamic typing, flexible data types, and powerful OO and exception handling facilities make it well-suited to quick, productive RL development. However, like all interpreted languages, Python has a reputation for large memory overheads and being slower in some applications when compared to compiled languages such as C++. These problems, however, can be overcome with the extension of third-party Python modules and proper profiling and programming techniques. Another problem is that Python often requires the user to download an interpreter separately. A way to solve that is to include the interpreter in the game download.
Python's rapid speed of development and human-readable code makes it an excellent choice for programmers wanting to develop a Roguelike in a limited amount of time, making the language ideal for 7DRL Challenges.
== Python-Specific Articles on RogueBasin ==
'''General:'''
* [[Complete Roguelike Tutorial, using python+libtcod]]
'''Field of View and Line of Sight:'''
* [[Python shadowcasting implementation]] - Python code for field-of-view calculation using Bjorn Bergstrom's excellent [[FOV_using_recursive_shadowcasting|recursive shadowcasting algorithm]].
* [[Permissive Field of View in Python]] - An implementation of the [[Precise_Permissive_Field_of_View|precise Permissive Field of View]] algorithm in Python.
* [[Raycasting_in_python]] - A python implementation of brute force raycasting.
* [[Bresenham%27s_Line_Algorithm#Python]] - Bresenham's Line Algorithm for line of sight.
'''Pathfinding'''
* [[A Python 3 and 2 Pathfinder with Pygame Example]] - A Python 3 and 2 pathfinder that uses A* and Dijkstra pathfinding with a Pygame example.
'''Map Generation:'''
* [[Dungeon builder written in Python]] - A dungeon builder.
* [[A Simple Dungeon Generator for Python 2 or 3]] - A simple and adaptable python 2 or 3 dungeon generator.
* [[Python_Curses_Example_of_Dungeon-Building_Algorithm]] - An example of a dungeon building algorithm.
* [[An_Implementation_of_City_Generation_by_Leaf_Venation]] - A city generator in Tk.
'''Scheduling:'''
* [[A simple turn scheduling system -- Python implementation]] - A simple time system for Roguelikes.
* [[A_priority_queue_based_turn_scheduling_system]] - A turn scheduling system that uses a priority queue.
'''Name Generation:'''
* [[Markov_chains_name_generator_in_Python]] - Example code used to generate random names.
* [[Names_from_a_high_order_Markov_Process_and_a_simplified_Katz_back-off_scheme]] - High quality Markov process random name generation.
== Related links ==


== Realted links ==
* [http://python.org Official Python website]
* [http://python.org Official Python website]
* [http://adamv.com/dev/python/curses/ WCurses], a Python module implementing a substantial subset of the [[Curses]] interface under Windows.  Python includes Curses support by default for other OS's.
* [http://www.python.org/doc/faq/ Official Python FAQs]
* [http://psyco.sourceforge.net/ Psyco], the specializing compiler for Python. Improves performance 2 to 100 times (usually about 4 times), and requires little more from the programmer than to import the module.
* [[libtcod]] is a free, fast, portable and uncomplicated API for roguelike developers providing an advanced true color console emulator, input, and lots of other utilities frequently used in roguelikes.
* [http://foo.wyrd.name/en:bearlibterminal/ BearLibTerminal] is another API for roguelike developers. Unlike libtcod, it provides and API for output only. It is therefore more compact, and is much simpler. Sports binding for C/C++, C#, Ruby, Lua, Python and Pascal.
* [http://www.py2exe.org/ py2exe] is a package which converts Python scripts into executable Windows programs, able to run without requiring a Python installation.  Since most Windows users will not have Python installed, py2exe is a good way to distribute your Python game to that audience.
* [http://www.py2exe.org/ py2exe] is a package which converts Python scripts into executable Windows programs, able to run without requiring a Python installation.  Since most Windows users will not have Python installed, py2exe is a good way to distribute your Python game to that audience.
* [https://github.com/pyinstaller/pyinstaller/wiki PyInstaller] is a program that converts (packages) Python programs into stand-alone executables, under Windows, Linux, and Mac OS X.
* [http://www.pygame.org/news.html Pygame] ([[Pygame]]) is an SDL wrapper for Python that has been used for many graphical and non-graphical Roguelikes.
== Roguelike games in Python ==
{|class="wikitable sortable" style="width:50%"
!style="width:15%;"|Status || Name
|-
| {{defunct}} ||  [[Artisan]]
|-
| {{stable}} ||  [[Armoured Commander]]
|-
| {{alpha}} ||  [[CrashRun]]
|-
| {{alpha}} ||  [[CyberRogue]]
|-
| {{7DRL}} ||  [[Cypress Tree Manor]]
|-
| {{7DRL}} ||  [[Fist of the Rogue Warrior]]
|-
| {{alpha}} ||  [[Herculeum]]
|-
| {{alpha}} ||  [[Ighalsk]]
|-
| {{defunct}} ||  [[I, Monster]]
|-
| {{defunct}} ||  [[Lands of Elderlore]]
|-
| {{beta}} ||  [[Mines of Elderlore]]
|-
| {{defunct}} ||  [[Netpack]]
|-
| {{7DRL}} || [[Nightmare Tyrant]]
|-
| {{beta}} ||  [[Nyctos]]
|-
| {{defunct}} ||  [[Pyro]]
|-
| {{beta}} ||  [[rng clrc]]
|-
| {{alpha}} ||  [[Roguelike me]]
|-
| {{defunct}} ||  [[Shuruppak]]
|-
| {{stable}} ||  [[SummonerRL]]
|-
| {{7DRL}} ||  [[Swamp Monster]]
|-
| {{defunct}} ||  [[The Temple of Torment]]
|-
| {{alpha}} ||  [[Torchlit]]
|-
| {{7DRL}} ||  [[TrapRL]]
|-
| {{beta}} ||  [[Ultima Ratio Regum]]
|-
| {{defunct}} ||  [[Wa]]
|-
| {{7DRL}} ||  [[Whispers in the Void]]
|-
| {{7DRL}} ||  [[Z-Day]]
|}


[[Category:Programming languages]]
== References ==
<references />

Latest revision as of 11:30, 17 November 2022

Python
Programming Language
Company Python Software Foundation
Influences ABC programming language
Updated May 3, 2021 (3.9.5)[1]
Status Stable
Licensing Open Source[2]
Platforms Linux, Unix, Mac OS X, Windows and others.
Official site of Python


What is Python?

From the official Python FAQ:

"Python is an interpreted, interactive, object-oriented programming language. It incorporates modules, exceptions, dynamic typing, very high level dynamic data types, and classes. Python combines remarkable power with very clear syntax. It has interfaces to many system calls and libraries, as well as to various window systems, and is extensible in C or C++. It is also usable as an extension language for applications that need a programmable interface. Finally, Python is portable: it runs on many Unix variants, on the Mac, and on PCs under MS-DOS, Windows, Windows NT, and OS/2."

A full set of features can be found here.

Roguelike Specific Details

Python's expressive code, dynamic typing, flexible data types, and powerful OO and exception handling facilities make it well-suited to quick, productive RL development. However, like all interpreted languages, Python has a reputation for large memory overheads and being slower in some applications when compared to compiled languages such as C++. These problems, however, can be overcome with the extension of third-party Python modules and proper profiling and programming techniques. Another problem is that Python often requires the user to download an interpreter separately. A way to solve that is to include the interpreter in the game download.

Python's rapid speed of development and human-readable code makes it an excellent choice for programmers wanting to develop a Roguelike in a limited amount of time, making the language ideal for 7DRL Challenges.

Python-Specific Articles on RogueBasin

General:

Field of View and Line of Sight:

Pathfinding

Map Generation:

Scheduling:

Name Generation:

Related links

  • Official Python website
  • Official Python FAQs
  • libtcod is a free, fast, portable and uncomplicated API for roguelike developers providing an advanced true color console emulator, input, and lots of other utilities frequently used in roguelikes.
  • BearLibTerminal is another API for roguelike developers. Unlike libtcod, it provides and API for output only. It is therefore more compact, and is much simpler. Sports binding for C/C++, C#, Ruby, Lua, Python and Pascal.
  • py2exe is a package which converts Python scripts into executable Windows programs, able to run without requiring a Python installation. Since most Windows users will not have Python installed, py2exe is a good way to distribute your Python game to that audience.
  • PyInstaller is a program that converts (packages) Python programs into stand-alone executables, under Windows, Linux, and Mac OS X.
  • Pygame (Pygame) is an SDL wrapper for Python that has been used for many graphical and non-graphical Roguelikes.

Roguelike games in Python

Status Name
defunct Artisan
stable Armoured Commander
αlpha CrashRun
αlpha CyberRogue
7DRL Cypress Tree Manor
7DRL Fist of the Rogue Warrior
αlpha Herculeum
αlpha Ighalsk
defunct I, Monster
defunct Lands of Elderlore
βeta Mines of Elderlore
defunct Netpack
7DRL Nightmare Tyrant
βeta Nyctos
defunct Pyro
βeta rng clrc
αlpha Roguelike me
defunct Shuruppak
stable SummonerRL
7DRL Swamp Monster
defunct The Temple of Torment
αlpha Torchlit
7DRL TrapRL
βeta Ultima Ratio Regum
defunct Wa
7DRL Whispers in the Void
7DRL Z-Day

References

  1. Python downloads, official downloads page with release information.
  2. History and License, detailed license info from the Python documentation.