Python




Python is a high-level, general-purpose programming language, though it is best used for scripting. Its simplicity and ease of use has made it a popular choice for writing scripts to assist in raids, even though Aryans use it to web scrape and niggers abuse it to generate AI slop.
Like JavaScript it is heavily used by pajeets who shit up the internet with low-quality, slow, unmaintainable code, such as for making shitty web applications.
Things you can do with Python
[edit | edit source]
- Automate low-level work (like copy pasting, file navigation, changing settings)
- Make scripts to spam soyjak.pa(USER WAS BANNED FOR THIS POST)
- Write APIs and websites using CGI
- Make scripts to automate your PC
- It's good for stuff with data, you can connect it to MySQL
- you can use or flash to make websites in python. its very powerful, but sometimes very slow, depending on what the task is.
- Anything AI related, such as training LLMs or doing machine learning. Most machine learning libraries such as TensorFlow are written in Python.
- Make pentesting scripts and put them in a github repository
- Mathematics and scientific computing. Python has many external libraries such as NumPy and SciPy (back ends are usually written in C++ for fast computation). SageMath is also a good computer algebra system built on Python.
Things you shouldn't do with Python
[edit | edit source]- Use it as your first programming language. Due to how simple the language is, you can easily learn some really bad programming habits due to you not needing to declare variables, as well as dynamic typing.
- Use it to make video games. Being an interpreted language, it is incredibly slow and unoptimized. Additionally, most people won't want to download a very specific version of a programming language in order to play a simple video game that runs like shit. Just learn C++ or Go like a normal human being. You're not a romhacker.
- Use it to write complex applications (Java is your friend).
- Use it for web development (JavaScript is used for that).
- Larp as a performative "programmer"
Tutorial
[edit | edit source]The following is a brief tutorial on the functionality of Python. This tutorial assumes no prior programming knowledge, but still assumes enough technical or mathematical competence to learn the language.
This tutorial assumes you're using Python 3.14 or later. While the tutorial may reference features or concepts in other languages, these will be explained with context.
Hello World
[edit | edit source]The Hello World program in Python is as follows:
print("Hello, world!")
print() is a built-in function, which is used to display text, variables (we will explain what this is later) or output to the screen.
Variables
[edit | edit source]In Python, a variable is a named value which can store data in the computer's memory. You can think of this as a labelled storage box (with a name and contents), and can be re-used later.
A variable is created as soon as something is assigned to it, using the equals sign.
name = "Nate"
age = 19
Names can only contain letters, numbers and underscores; they must start with a letter or an underscore. Additionally, names are case-sensitive (so Age, age and AGE are three different names).
Finally, variables cannot have a keyword as a name.
In Python, the type of a variable may be changed at any time by re-assigning it:
x = 10
x = "Hello"
However, this is not good practice to reassign types, and we will avoid this in the tutorial.
Basic types
[edit | edit source]In Python, there are four basic types:
int: a whole number, without any decimal points.- For example:
42,-7,0
- For example:
float: a number with a decimal point.- For example:
3.14,2.71,-0.005,10.0
- For example:
str: a piece of text wrapped in a quote (single or double).- For example:
"Hello",'a',"nusoi","67"
- For example:
bool: a logical value representing a truth state.- Only values:
True,False
- Only values:
Type annotations
[edit | edit source]Python allows the user to explicitly indicate the type of a variable at declaration. For clarity, we will do this in this tutorial.
name: str = "Nate"
age: int = 19
Reading input
[edit | edit source]To read input in Python, use the built-in input() function. A text prompt may be passed inside this function, which will be printed. When a line with input() is hit, the program is paused, and waits for the user to enter something into the console.
username: str = input("Input your name: ")
print("Hello, " + username + "!")
Note that input() itself returns a str, and that all user text is always treated as a string.
If we wanted to use input as a number, we can use casting. Python offers the following conversions
int(): converts a value tointfloat(): converts a value tofloatstr(): converts a value tostrbool(): converts a value tobool
This is an example of using the int() cast:
age: int = int(input("Enter your age: "))
print("Next year, you will be: ", age + 1)
Example
[edit | edit source]#/usr/bin/env python3
import random
def should_ack(ack_probability: int) -> bool:
"""
@brief Determines whether the tranny should ack based on a given probability.
@param ack_probability An integer between 0 and 100 representing the chance of acking.
@return True if the random probability is less than the ack_probability; otherwise, False.
"""
prob: float = max(0.0, min(random.random() * 100.0, 100.0))
return prob < float(ack_probability)
def main() -> None:
"""
@brief Main function that decides whether to ack or scream TRANS RIGHTS ARE HUMAN RIGHTS!!!!!!!! based on probability.
"""
if should_ack(41):
raise RuntimeError("ACK!!!!")
else:
print("TRANS RIGHTS ARE HUMAN RIGHTS!!!!!!!!")
if __name__ == "__main__":
main()
Simpler version
[edit | edit source]#/usr/bin/env python3
import random
# simpler version of the above program that acks with
# equal probability instead of 41% of the time because
# lets be honest 41% is not enough
if __name__ == "__main__":
x: bool = random.choice([True, False])
if x:
print("TRANS RIGHTS ARE HUMAN RIGHTS!!!!!!!!")
else:
raise RuntimeError("ACK!!!!")
Notable uses by soyjak.party
[edit | edit source]- Discord Babybot
- Troonbuster
- Operation SoySphere-Cobvas
- Soyjak.pythonanywhere.com (splinter during the Soypocalypse)
- Glowquest raid


