This package makes you python experience better it includes nice shortcut functions to help solve problems in less lines of code.
Project description
PyEasier
This python package is made with the soul content of making python have less boilerplate code. You may be wondering how to use this helpful python package well my favorite coder it is rather simple look bellow for a list of commands and what they do.
IF YOU FIND A BUG REPORT IT HERE: CLICK ME
- RanNum(low, high)
This function helps you get a random whole number. The low and high parameters are there for you to put in the highest number and lowest number of the range then the function will choose a random number in that range.
print(RanNum(0, 100))
Console Output:
77
2. RanFloat(low, high)
This function helps you get a random decimal number.
The low and high parameters are there for you to put
in the highest number and the lowest number of the range then the function will choose a random decimal number
inside that range.
print(RanFloat(0, 100))
Console Output:
42.012440655242365
3. cap(num, decimalPlaces)
This function helps you make a decimal number shorter.
print(cap(42.012440655242365, 2))
Console Output:
42.01
4. package(module)
This function helps you run pip commands through code.
package("pyeasier")
Console Output:
Collecting PyEasier Downloading PyEasier-py3-none-any.whl (2.5 kB) Requirement already satisfied: py2app in ./venv/lib/python3.9/site-packages (from PyEasier) (0.28.2) Requirement already satisfied: pyinstaller in ./venv/lib/python3.9/site-packages (from PyEasier) (5.1) Requirement already satisfied: macholib>=1.16 in ./venv/lib/python3.9/site-packages (from py2app->PyEasier) (1.16) Requirement already satisfied: modulegraph>=0.17 in ./venv/lib/python3.9/site-packages (from py2app->PyEasier) (0.19.2) Requirement already satisfied: altgraph>=0.16 in ./venv/lib/python3.9/site-packages (from py2app->PyEasier) (0.17.2) Requirement already satisfied: pyinstaller-hooks-contrib>=2021.4 in ./venv/lib/python3.9/site-packages (from pyinstaller->PyEasier) (2022.7) Requirement already satisfied: setuptools in ./venv/lib/python3.9/site-packages (from pyinstaller->PyEasier) (60.2.0) Installing collected packages: PyEasier Successfully installed PyEasier
5. runCmd(cmd)
This function allows you to run terminal commands through code instead of you having to go to the terminal/command prompt and running the command there.
runCmd("pip install pyeasier")
Console Output:
Collecting PyEasier Downloading PyEasier-py3-none-any.whl (2.5 kB) Requirement already satisfied: py2app in ./venv/lib/python3.9/site-packages (from PyEasier) (0.28.2) Requirement already satisfied: pyinstaller in ./venv/lib/python3.9/site-packages (from PyEasier) (5.1) Requirement already satisfied: macholib>=1.16 in ./venv/lib/python3.9/site-packages (from py2app->PyEasier) (1.16) Requirement already satisfied: modulegraph>=0.17 in ./venv/lib/python3.9/site-packages (from py2app->PyEasier) (0.19.2) Requirement already satisfied: altgraph>=0.16 in ./venv/lib/python3.9/site-packages (from py2app->PyEasier) (0.17.2) Requirement already satisfied: pyinstaller-hooks-contrib>=2021.4 in ./venv/lib/python3.9/site-packages (from pyinstaller->PyEasier) (2022.7) Requirement already satisfied: setuptools in ./venv/lib/python3.9/site-packages (from pyinstaller->PyEasier) (60.2.0) Installing collected packages: PyEasier Successfully installed PyEasier
6. osName()
This function allows you to get the os name of the user.
osName()
Console Output:
Darwin
7. py2dmg(fileName)
This function allows you to package your code into a dmg file for Mac users.
py2dmg("myCoolGame.py")
Console Output:
The console output is too long to put here
8. py2exe(filename, console(Optional), iconFileName(Optional))
This function maybe buggy please let me know if it has bugs because I am on a Mac and can't test this out.
This function helps you with packaging your code into an exe file for Window Users. If you want a gui program you don't need to set
console to False it is set by default but if you have a terminal game, and you need the console then set console to true.
py2exe("myCoolGame.py", console = False, iconFile = "rick.icn")
Console Output:
The console output is too long to put here too
- write(file, text)
This function helps you write into files.
write(nice.py, "Hi")
Console Output:
Nothing to put here
10. read(file, mode(Optional))
This function helps you read files. By default, the mode is set to t but if you need to read images and media files set the mode to b.
write(nice.py, "Hi")
r = read(nice.py, mode = "t")
print(r[0])
Console Output:
Hi
11. append(filename, text)
This function helps you append text to a file.
write(nice.py, "H")
append(nice.py, "e")
r = read(nice.py, mode = "t")
print(r[0])
Console Output:
He
12. create(filename)
This function helps you create a new file in your directory.
create("nice.py")
write(nice.py, "H")
append(nice.py, "e")
r = read(nice.py, mode = "t")
print(r[0])
Console Output:
He
13. cos(num)
This functions helps you get the cosine of the number that you input.
print(cos(1))
Console Output:
0.5403023058681398
14. sin(num)
This function helps you get the sine of the number that you input.
print(sin(1))
Console Output:
0.8414709848078965
15. delete(filename)
This function helps you delete the file that you input.
delete("nice.py")
Console Output:
✨ Deleted nice.py ✨
16. log(num, base)
This function helps you find the logarithm of the number that you entered to the base that you entered.
print(log(10, 2))
Console Output:
3.3219280948873626
17. tan(num)
This function helps you find the tangent of the number that you entered.
print(tan(1))
Console Output:
1.557407724654902
18. asin(num)
This function helps you find the arc-sine of the number that you input.
print(asin(1))
Console Output:
1.5707963267948966
19. acos(num)
This function helps you find the arc-cosine of the number that you input.
print(acos(1))
Console Output:
0.0
20. getBatteryLevel()
This function gives you the battery of the user's device.
print(f'{getBatteryLevel()}%')
Console Output:
66%
21. isPluggedIn()
This function gives you either true or false if the user's device is plugged in.
print(isPluggedIn())
Console Output:
False
22. findCircumference(radius)
This function helps you calculate the circumference of a circle.
print(findCircumference(1))
Console Output:
6.283184
23. findRadius(circumference)
This function helps you find the radius of a circle.
print(findRadius(6.283184))
Console Output:
1
24. findDiameter(radius)
This function helps you find the diameter of a circle.
print(findDiameter(1))
Console Output:
2
25. technoblade()
This function pays tribute the youtuber Technoblade.
technoblade()
Console Output:
🐷😞Rip Techno you will be missed 😞🐷
-YellowYams(Vedic Mukherjee)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for PyEasier-0.0.6.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42da3a3d3777e3c6f16771b36659bf5236d063f15c907bf7ad6d63f0da2492ee |
|
MD5 | f1698d17b31985e29687193f2ca85c01 |
|
BLAKE2b-256 | afbae0e48a32d15c5990aed7a3544aa5801070a5ff34666c5c54da90a8b8b3d0 |