for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import sys
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
class SomeClass: def some_method(self): """Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.
import re
import os
from pypen.settings import settings
def _check_if_executed_with_python():
if not sys.argv:
return
if sys.argv[0] == "-m":
match = re.search("pypen", sys.argv[0])
if match:
print()
print("It seems like you are trying to run a PyPen sketch using the python command.")
print("Try instead running it with 'pypen {}'!".format(" ".join(sys.argv)))
print("Run 'pypen --help' for more information.")
settings._is_executing_with_python = True
_check_if_executed_with_python()
from pypen.utils import *
from pypen.drawing import *
from pypen.drawing import _COLORS
class _Mouse:
def __init__(self, x, y):
self.x = x
self.y = y
TIME = T = DELTA_TIME = DT = FRAME = F = FPS = 0
WIDTH = settings.width
HEIGHT = settings.height
MOUSE = _Mouse(0, 0)
def grid(spacing=1, start_x=0, start_y=0):
spacing = max(1, abs(spacing))
x = start_x
y = start_y
while y < settings.height:
yield x, y
x = (x + spacing)
if x >= settings.width:
y += spacing
def pixels():
return grid(1, 0, 0)
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.