💘 Write any Python with 9 Characters: e,x,c,h,r,(,+,1,)

Related tags

Miscellaneous PyFuck
Overview

💘 PyFuck exchr(+1)

PyFuck is a strange playful code.
It uses only nine different characters to write Python3 code.

Inspired by aemkei/jsfuck

Example

The following source will do an __import__("os").system("ls"):

exec(chr(11+11+11+11+11+11+11+11+1+1+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+1+1+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1+1)+chr(111+1)+chr(111)+chr(111+1+1+1)+chr(111+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+1+1+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+1+1+1+1+1+1+1)+chr(11+11+11+1+1+1+1+1+1+1)+chr(11+11+11+1)+chr(111)+chr(111+1+1+1+1)+chr(11+11+11+1)+chr(11+11+11+1+1+1+1+1+1+1+1)+chr(11+11+11+11+1+1)+chr(111+1+1+1+1)+chr(111+1+1+1+1+1+1+1+1+1+1)+chr(111+1+1+1+1)+chr(111+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+11+1+1)+chr(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1+1)+chr(11+11+11+1+1+1+1+1+1+1)+chr(11+11+11+1)+chr(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1)+chr(111+1+1+1+1)+chr(11+11+11+1)+chr(11+11+11+1+1+1+1+1+1+1+1))

Basics

chr(48) => chr(11+11+11+11+1+1+1+1) "1" => chr(49) => chr(11+11+11+11+1+1+1+1+1) "2" => chr(50) => chr(11+11+11+11+1+1+1+1+1+1) "A" => chr(65) => chr(11+11+11+11+11+1+1+1+1+1+1+1+1+1+1) "B" => chr(66) => chr(11+11+11+11+11+11) "C" => chr(67) => chr(11+11+11+11+11+11+1) "a" => chr(97) => chr(11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1) "b" => chr(98) => chr(11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1+1) "c" => chr(99) => chr(11+11+11+11+11+11+11+11+11) "+" => chr(43) => chr(11+11+11+1+1+1+1+1+1+1+1+1+1) "-" => chr(45) => chr(11+11+11+11+1) "(" => chr(40) => chr(11+11+11+1+1+1+1+1+1+1) ")" => chr(41) => chr(11+11+11+1+1+1+1+1+1+1+1) "[" => chr(91) => chr(11+11+11+11+11+11+11+11+1+1+1) "]" => chr(93) => chr(11+11+11+11+11+11+11+11+1+1+1+1+1) etc.">
"0"  =>  chr(48)  =>  chr(11+11+11+11+1+1+1+1)
"1"  =>  chr(49)  =>  chr(11+11+11+11+1+1+1+1+1)
"2"  =>  chr(50)  =>  chr(11+11+11+11+1+1+1+1+1+1)
"A"  =>  chr(65)  =>  chr(11+11+11+11+11+1+1+1+1+1+1+1+1+1+1)
"B"  =>  chr(66)  =>  chr(11+11+11+11+11+11)
"C"  =>  chr(67)  =>  chr(11+11+11+11+11+11+1)
"a"  =>  chr(97)  =>  chr(11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1)
"b"  =>  chr(98)  =>  chr(11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1+1)
"c"  =>  chr(99)  =>  chr(11+11+11+11+11+11+11+11+11)
"+"  =>  chr(43)  =>  chr(11+11+11+1+1+1+1+1+1+1+1+1+1)
"-"  =>  chr(45)  =>  chr(11+11+11+11+1)
"("  =>  chr(40)  =>  chr(11+11+11+1+1+1+1+1+1+1)
")"  =>  chr(41)  =>  chr(11+11+11+1+1+1+1+1+1+1+1)
"["  =>  chr(91)  =>  chr(11+11+11+11+11+11+11+11+1+1+1)
"]"  =>  chr(93)  =>  chr(11+11+11+11+11+11+11+11+1+1+1+1+1)
etc.

Execute print(1)

chr(111+1) "r" => chr(111+1+1+1) "i" => chr(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1) "n" => chr(11+11+11+11+11+11+11+11+11+11) "t" => chr(111+1+1+1+1+1) "(" => chr(11+11+11+1+1+1+1+1+1+1) "1" => chr(11+11+11+11+1+1+1+1+1) ")" => chr(11+11+11+1+1+1+1+1+1+1+1) "print(1)" => chr(111+1)+chr(111+1+1+1)+chr(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+11+11)+chr(111+1+1+1+1+1)+chr(11+11+11+1+1+1+1+1+1+1)+chr(11+11+11+11+1+1+1+1+1)+chr(11+11+11+1+1+1+1+1+1+1+1) exec("print(1)") => exec(chr(111+1)+chr(111+1+1+1)+chr(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+11+11)+chr(111+1+1+1+1+1)+chr(11+11+11+1+1+1+1+1+1+1)+chr(11+11+11+11+1+1+1+1+1)+chr(11+11+11+1+1+1+1+1+1+1+1))">
"p" => chr(111+1)
"r" => chr(111+1+1+1)
"i" => chr(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1)
"n" => chr(11+11+11+11+11+11+11+11+11+11)
"t" => chr(111+1+1+1+1+1)
"(" => chr(11+11+11+1+1+1+1+1+1+1)
"1" => chr(11+11+11+11+1+1+1+1+1)
")" => chr(11+11+11+1+1+1+1+1+1+1+1)
"print(1)" => chr(111+1)+chr(111+1+1+1)+chr(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+11+11)+chr(111+1+1+1+1+1)+chr(11+11+11+1+1+1+1+1+1+1)+chr(11+11+11+11+1+1+1+1+1)+chr(11+11+11+1+1+1+1+1+1+1+1)
exec("print(1)") => exec(chr(111+1)+chr(111+1+1+1)+chr(11+11+11+11+11+11+11+11+11+1+1+1+1+1+1)+chr(11+11+11+11+11+11+11+11+11+11)+chr(111+1+1+1+1+1)+chr(11+11+11+1+1+1+1+1+1+1)+chr(11+11+11+11+1+1+1+1+1)+chr(11+11+11+1+1+1+1+1+1+1+1))

Usage

test.py $ python pyfuck.py ____ _____ _ | _ \ _ _| ___| _ ___| | __ | |_) | | | | |_ | | | |/ __| |/ / | __/| |_| | _|| |_| | (__| < |_| \__, |_| \__,_|\___|_|\_\ |___/ by Satoki FileName: test.py -> output.py $ python output.py Satoki">
$ echo "print('Satoki')" > test.py
$ python pyfuck.py
 ____        _____           _
|  _ \ _   _|  ___|   _  ___| | __
| |_) | | | | |_ | | | |/ __| |/ /
|  __/| |_| |  _|| |_| | (__|   <
|_|    \__, |_|   \__,_|\___|_|\_\
       |___/
                                    by Satoki

FileName: test.py
-> output.py
$ python output.py
Satoki
You might also like...
Generate Openbox Menus from a easy to write configuration file.

openbox-menu-generator Generate Openbox Menus from a easy to write configuration file. Example Configuration: ('#' indicate comments but not implement

 A simple way to read and write LAPS passwords from linux.
A simple way to read and write LAPS passwords from linux.

A simple way to read and write LAPS passwords from linux. This script is a python setter/getter for property ms-Mcs-AdmPwd used by LAPS inspired by @s

Write a program that works out whether if a given year is a leap year
Write a program that works out whether if a given year is a leap year

Leap Year 💪 This is a Difficult Challenge 💪 Instructions Write a program that works out whether if a given year is a leap year. A normal year has 36

Write Streamlit apps using Notion! (Prototype)

Streamlit + Notion test app Write Streamlit apps using Notion! ☠️ IMPORTANT: This is just a little prototype I made to play with some ideas. Not meant

This is a far more in-depth and advanced version of "Write user interface to a file API Sample"

Fusion360-Write-UserInterface This is a far more in-depth and advanced version of "Write user interface to a file API Sample" from https://help.autode

A way to write regex with objects instead of strings.

Py Idiomatic Regex (AKA iregex) Documentation Available Here An easier way to write regex in Python using OOP instead of strings. Makes the code much

Write-ups for CTF Internacional MetaRed 2021 5th stage

MetaRed2021-5th-Writeups Write-ups for CTF Internacional MetaRed 2021 5th stage Easy (15) No Status Category Name Creator(s) 01 Done osint Cybersecuri

poetry2nix turns Poetry projects into Nix derivations without the need to actually write Nix expressions

poetry2nix poetry2nix turns Poetry projects into Nix derivations without the need to actually write Nix expressions. It does so by parsing pyproject.t

Djangoblog - A blogging site where people can make their accout and write blogs and read other author's blogs

This a blogging site where people can make their accout and write blogs and read other author's blogs.

Comments
  • PyFuckをGitHub Pages上で使えるようにしました!

    PyFuckをGitHub Pages上で使えるようにしました!

    PyScriptを用いて、PyFuckのコードをそのまま読み込んでHTML上で実行できるようにしました。 サンプル: https://xryuseix.github.io/PyFuck/ スクリーンショット 2022-06-20 9 04 17

    マージして頂くとGitHub Actionsが走ります。それが終わったらこのページからSourceBranchgh-pagesに変更してください。 スクリーンショット 2022-06-20 9 02 33

    ついでに、ここにリンク貼ってもらえると助かります https://satoki.github.io/PyFuck/ スクリーンショット 2022-06-20 11 01 22

    opened by xryuseix 1
Owner
Satoki
Satoki
Parser for RISC OS Font control characters in Python

RISC OS Font control parsing in Python This repository contains a class (FontControlParser) for parsing font control codes from a byte squence, in Pyt

Charles Ferguson 1 Nov 2, 2021
A dot matrix rendered using braille characters.

⣿ dotmatrix A dot matrix rendered using braille characters. Description This library provides class called Matrix which represents a dot matrix that c

Tim Fischer 25 Dec 12, 2022
Hacktoberfest2021 🥳- Contribute Any Pattern In Any Language😎 Every PR will be accepted Pls contribute

✨ Hacktober Fest 2021 ✨ ?? All Contributors are requested to star this repo and follow me for a successful merge of pull request. ?? ?? Add any patter

Md. Almas Ali 103 Jan 7, 2023
Write complicated anonymous functions other than lambdas in Python.

lambdex allows you to write multi-line anonymous function expression (called a lambdex) in an idiomatic manner.

Xie Jingyi 71 May 19, 2022
sawa (ꦱꦮ) is an open source programming language, an interpreter to be precise, where you can write python code using javanese character.

ꦱꦮ sawa (ꦱꦮ) is an open source programming language, an interpreter to be precise, where you can write python code using javanese character. sawa iku

Rony Lantip 307 Jan 7, 2023
An extension for Arma 3 that lets you write extensions in Python 3

An Arma 3 extension that lets you to write python extensions for Arma 3. And it's really simple and straightforward to use!

Lukasz Taczuk 48 Dec 18, 2022
Svg-turtle - Use the Python turtle to write SVG files

SaVaGe Turtle Use the Python turtle to write SVG files If you're using the Pytho

Don Kirkby 7 Dec 21, 2022
This is a modified variation of abhiTronix's vidgear. In this variation, it is possible to write the output file anywhere regardless the permissions.

Info In order to download this package: Windows 10: Press Windows+S, Type PowerShell (cmd in older versions) and hit enter, Type pip install vidgear_n

Ege Akman 3 Jan 30, 2022
Why write code when you can import it directly from GitHub Copilot?

Copilot Importer Why write code when you can import it directly from GitHub Copilot? What is Copilot Importer? The copilot python module will dynamica

Mythic 41 Jan 4, 2023