add python
This commit is contained in:
commit
ea05d7ccfe
|
|
@ -0,0 +1 @@
|
||||||
|
* text=auto
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
print("!Warning this script delete all empty folders in the directory it was executed in [v0.9️]¡")
|
||||||
|
print("1 Start")
|
||||||
|
print("0 Close")
|
||||||
|
x = input("")
|
||||||
|
if x == "1":
|
||||||
|
index_list = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "ñ", "o", "p", "q", "r", "s",
|
||||||
|
"t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
|
||||||
|
"N", "Ñ", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", ]
|
||||||
|
|
||||||
|
while True:
|
||||||
|
for x in index_list:
|
||||||
|
if os.path.exists(f"{x}"):
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
os.mkdir(f"{x}")
|
||||||
|
print(f"{x}")
|
||||||
|
break
|
||||||
|
|
||||||
|
while True:
|
||||||
|
for x in index_list:
|
||||||
|
home_letter = x
|
||||||
|
container = [_ for _ in os.listdir() if _.startswith(home_letter)]
|
||||||
|
for i in container:
|
||||||
|
shutil.move(i, x)
|
||||||
|
break
|
||||||
|
|
||||||
|
for item in os.listdir(os.getcwd()):
|
||||||
|
if os.path.isdir(item):
|
||||||
|
if not os.listdir(item):
|
||||||
|
os.removedirs(os.path.join(os.getcwd(), item))
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
|
@ -0,0 +1,115 @@
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
print("!Warning this script delete all empty folders in the directory it was executed in [v0.9️]¡")
|
||||||
|
print("1 Start")
|
||||||
|
print("0 Close")
|
||||||
|
x = input("")
|
||||||
|
|
||||||
|
if x == "1":
|
||||||
|
index_list = {"documents", "photos", "videos", "music", "compressed", "software", "programming", "others"}
|
||||||
|
|
||||||
|
documents = [".afpub", ".pdf", ".doc", ".docx", ".txt", ".odt", ".odp", ".odg", ".ods", ".xlsx", ".ppt", ".pptx"]
|
||||||
|
|
||||||
|
photos = [".jpg", ".png", ".gif", ".webp", ".pdf", ".afdesign", ".afphoto", ".sai2", ".sai", ".bmp", ".tiff"]
|
||||||
|
|
||||||
|
videos = [".mp4", ".mkv", ".avi", ".mov", ".flv", ".divx", ".webm", ".swf"]
|
||||||
|
|
||||||
|
music = [".mp3", ".aac", ".wav", ".aiff", ".wma", ".opus", ".ogg"]
|
||||||
|
|
||||||
|
compressed = [".rar", ".7z", ".zip", ".msi", ".bz2", ".gz", ".tar", ".wim", ".xz"]
|
||||||
|
|
||||||
|
software = [".deb", ".exe"]
|
||||||
|
|
||||||
|
programming = [".go", ".py", ".html", ".css", ".php", ".js", ".rs", ".md", ".json", ".gitattributes"]
|
||||||
|
|
||||||
|
others = [".tmp", ".dat", ".dmg"]
|
||||||
|
|
||||||
|
while True:
|
||||||
|
for x in index_list:
|
||||||
|
if os.path.exists(f"{x}"):
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
os.mkdir(f"{x}")
|
||||||
|
break
|
||||||
|
|
||||||
|
while True:
|
||||||
|
for x in documents:
|
||||||
|
extension_name = x
|
||||||
|
container = [_ for _ in os.listdir() if _.endswith(extension_name)]
|
||||||
|
for i in container:
|
||||||
|
shutil.move(i, "documents")
|
||||||
|
break
|
||||||
|
|
||||||
|
while True:
|
||||||
|
for x in photos:
|
||||||
|
extension_name = x
|
||||||
|
container = [_ for _ in os.listdir() if _.endswith(extension_name)]
|
||||||
|
for i in container:
|
||||||
|
shutil.move(i, "photos")
|
||||||
|
break
|
||||||
|
|
||||||
|
while True:
|
||||||
|
for x in videos:
|
||||||
|
extension_name = x
|
||||||
|
container = [_ for _ in os.listdir() if _.endswith(extension_name)]
|
||||||
|
for i in container:
|
||||||
|
shutil.move(i, "videos")
|
||||||
|
break
|
||||||
|
|
||||||
|
while True:
|
||||||
|
for x in music:
|
||||||
|
extension_name = x
|
||||||
|
container = [_ for _ in os.listdir() if _.endswith(extension_name)]
|
||||||
|
for i in container:
|
||||||
|
shutil.move(i, "music")
|
||||||
|
break
|
||||||
|
|
||||||
|
while True:
|
||||||
|
for x in compressed:
|
||||||
|
extension_name = x
|
||||||
|
container = [_ for _ in os.listdir() if _.endswith(extension_name)]
|
||||||
|
for i in container:
|
||||||
|
shutil.move(i, "compressed")
|
||||||
|
break
|
||||||
|
|
||||||
|
while True:
|
||||||
|
for x in software:
|
||||||
|
extension_name = x
|
||||||
|
container = [_ for _ in os.listdir() if _.endswith(extension_name)]
|
||||||
|
for i in container:
|
||||||
|
shutil.move(i, "software")
|
||||||
|
break
|
||||||
|
|
||||||
|
while True:
|
||||||
|
for x in programming:
|
||||||
|
extension_name = x
|
||||||
|
container = [_ for _ in os.listdir() if _.endswith(extension_name)]
|
||||||
|
for i in container:
|
||||||
|
shutil.move(i, "programming")
|
||||||
|
break
|
||||||
|
|
||||||
|
while True:
|
||||||
|
for x in others:
|
||||||
|
extension_name = x
|
||||||
|
container = [_ for _ in os.listdir() if _.endswith(extension_name)]
|
||||||
|
for i in container:
|
||||||
|
shutil.move(i, "others")
|
||||||
|
break
|
||||||
|
|
||||||
|
while True:
|
||||||
|
|
||||||
|
for item in os.listdir(os.getcwd()):
|
||||||
|
if os.path.isdir(item):
|
||||||
|
if not os.listdir(item):
|
||||||
|
os.removedirs(os.path.join(os.getcwd(), item))
|
||||||
|
|
||||||
|
break
|
||||||
|
|
||||||
|
for item in os.listdir(os.getcwd()):
|
||||||
|
if os.path.isdir(item):
|
||||||
|
if not os.listdir(item):
|
||||||
|
os.removedirs(os.path.join(os.getcwd(), item))
|
||||||
|
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
# A-Z_Archives_OrderScriptPython
|
||||||
|
|
||||||
|
This is a test of python file manager
|
||||||
|
|
||||||
|
### ⚠️Warning this script delete all empty folders in the directory it was executed in [v0.9️]⚠️
|
||||||
|
|
||||||
|
#### Category | Python script
|
||||||
|
|
||||||
|
Sorts files by the extencion and put it in a category in the directory [Example: document]
|
||||||
|
|
||||||
|
[CategoryPythonScript.py]
|
||||||
|
|
||||||
|
#### A-Z | Python script
|
||||||
|
|
||||||
|
Sorts files by the first letter of the and move them to a folder with their first letter in the directory [A-Z]
|
||||||
|
|
||||||
|
[A-ZPythonFoldersScript.py]
|
||||||
|
|
||||||
|
#### RemoveEmptyFolders | Python script
|
||||||
|
|
||||||
|
RemoveEmptyFolders in the directory
|
||||||
|
|
||||||
|
[RemoveEmptyFolders.py]
|
||||||
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
import os
|
||||||
|
|
||||||
|
print("!Warning this script delete all empty folders in the directory it was executed in [v0.9️]¡")
|
||||||
|
print("1 Start")
|
||||||
|
print("0 Close")
|
||||||
|
x = input("")
|
||||||
|
|
||||||
|
if x == "1":
|
||||||
|
while True:
|
||||||
|
for item in os.listdir(os.getcwd()):
|
||||||
|
if os.path.isdir(item):
|
||||||
|
if not os.listdir(item):
|
||||||
|
os.removedirs(os.path.join(os.getcwd(), item))
|
||||||
|
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
pass
|
||||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,18 @@
|
||||||
|
# Calculadora py
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
## Exe
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pip install pyinstaller
|
||||||
|
|
||||||
|
|
||||||
|
pyinstaller --onefile -w App.py -i calculadora.ico
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Ref
|
||||||
|
|
||||||
|
[PYINSTALLER: CREANDO EJECUTABLES EN PYTHON | TUTORIAL](https://www.youtube.com/watch?v=4zPS8oQma4k)
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 45 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
Loading…
Reference in New Issue