1
0
Fork
You've already forked pythowo
0
No description
  • Python 99.2%
  • Shell 0.8%
2022年06月28日 20:14:59 +02:00
install.sh fixed everything 2022年06月28日 19:25:54 +02:00
main.py fixed semicolon behaviour 2022年06月28日 19:53:55 +02:00
readme.md Update 'readme.md' 2022年06月28日 20:14:59 +02:00
test.owo fixed everything 2022年06月28日 19:25:54 +02:00
test2.owo fixed everything 2022年06月28日 19:25:54 +02:00

Pythowo - The cuwute pwogwamming language

Table of contents

PythowoLogo

Installation

  • Requires python 3.8 or highier
  • Run sudo ./install.sh that will create the proper file in /usr/bin
  • You're all done!

Usage

  • To run a script, type pythowo <file.owo> [flags]
  • Run pythowo -h for further information

How to code in Pythowo

This language is fully python compatible. This means that you can run python scripts with pythowo, as long as you disable Profanity Error (so you can use the letter 'r') with --swear. However, it hase some features of its own.

Comments

Any line containing the sequence UwU will be turned into a comment Example:

	This line woun't be evalUwUated

Syntax

It's generally the python one, except you can use

  • (。・ω・。)ノ♡ instead of ;
  • uwu instead of u
  • owo instead of o
  • w instead of r
  • ^w to use a w and not an r in the output
    (the last two work for caps as well W->R and ^W->W)

and you cannot use r or R.

Also some statements got uwuified:

variable declaration/assignation: please set <name> to <value> that can be chained like so: please set <name1> to <name2> to <value> assigning <value> to both variable

functions: here's some fUwUncitons

task myFunction(arg1, arg2:type, *args, keyword1=defaultvalue1, **kwargs): -> type
	
	...
	wetuwn <return code>

(task is a deltarune chapter 2 reference btw)

and classes:

kitty MyClass:
	task __init__(self, ...):
		...
	...

Interpreter

once you have installed pythowo, you can add #! /bin/pythowo at the start of the file, then run chmod +x <filename> to make it executable as ./<filename>, using automatically pythowo as "interpreter". With that said, is preferrable during development to run your script with pythowo <filename>, so you can use arguments while you code.

Contributing

There's plenty more to uwuify, feel free to share suggestions or implement them yourself and pull request!

Where to look in main.py

The first few lines are initialization and we can safely ignore them.

  • Lines 27 to 89 are the configuration and the core of the language. You will most likely want to change stuff there.
  • You may also wanna have a look at lines 111 to 134

Understanding the transpiling process

The program will modify the .owo file into a python script. It will achieve this by firstly doing a bunch of find+replace, as indicated by replace_deez_nuts dictionary, IN ORDER, example

impowowt wandowom

would first replace owo into o, then the remaining ws into rs, generating the following python code

import random

then by applying some more changes that are hard coded and not in the config part.

Inspiration

Reddit Post