Skip to content

sneakers-the-rat/vertical-python

Repository files navigation

vertical-python

Python but vertical.

Write a .vpy file:

hello_world.vpy

h d
e e
l f
l
oph
_re
wil
onl
rto
l(_
d"w
(ho
)er
 ll
 ld
 o(
  )
 w:
 o
 r
 l
 d
 !
 "
 )

then run it

$ vertical-python ./hello_world.vpy
hello world!

or encode a .py file to a .vpy file:

$ vertical-python ./hello_world.vpy --print > hello_world.py
$ vertical-python --encode ./hello_world.py > hello_world.vpy

Imports

To make your vertical python file importable, use the .py file extension and declare a vertical encoding

The vertical_python.codec module must be imported before attempting to import vertically-encoded python.

# -*- coding=vertical -*-
p
r
i
n
t
(
"
n
e
a
t
!
"
)

CLI

usage: vertical-python [-h] [--print | --encode] path

python but vertical

positional arguments:
  path        path to vertical .vpy file

options:
  -h, --help  show this help message and exit
  --print     just print the rotated vpy, not eval
  --encode    treat PATH as .py and print vertical .vpy to stdout

Changelog

  • v0.3.0: #2 - vertical codec and importable modules
  • v0.2.0: #1 - @mathematicalmichael - encode .py to .vpy
  • v0.1.0: Initial functionality

About

python but vertical

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages