import os
import shutil
def main():
p = os.path.abspath(os.getcwd())
path = p+"/"
files = os.listdir(path)
for file in files:
path_to_file = path+file
type_of_file = file.split(".")
path_to_dir = path+type_of_file[1]
print(file, "-- type -- ",type_of_file[1])
try:
try:
os.makedirs(type_of_file[1])
shutil.move(path_to_file, path_to_dir)
print(f"--{file}-- in {path_to_dir}")
except:
pass
except:
print(type_of_file[1]," already exists")
pass
if __name__ == "__main__":
main()
Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Posts made by MustaphaBen
-
A simple file-automation desk clean up.
-
RE: a simple terminal emulator
First : split screen And multitasking trust me those things are not the best in ios 10.3.3 and there is no split screen so if i wanna watch a turorial i need to go to youtube and then to pythonista.
Sec : the version its old now I can't even install youtube lol.
Third : my ipad its old so I can't even update it.Thats why i wanted to do the jbk cuz i can use all these features without cost
-
RE: a simple terminal emulator
I think jb's progrmmers are creative more than apple's programmers
-
RE: a simple terminal emulator
I agree, but ios have some limitations i have an ipad 4 ios 10.3.3 and trust me it sucks its old and so limited
-
RE: a simple terminal emulator
Thanks but i cant anymore i broke my ipad, i did the jbk and i installed a bad tweak and it deleted all the stock apps, but ill do that for sure when i fix my ipad
-
RE: i wanna make a project. But i dnt know whr to start
not a game , something like a cli or a tool
-
RE: install react on pythonista?
but the app play.js can install reac
so its not even possible to install it on pythonista
And like when you install it you can see you're output on a localhost or something? -
install react on pythonista?
hey is it possible to install react using pythonista
-
i wanna make a project. But i dnt know whr to start
hey. i need some ideas to make ? can someone give me some 💡
i need to build something from scratch but i dnt know whr to start i dnt have perfect ideas
so it will be helpful if you give me some cool ideas 💡 -
RE: Hello m building a terminal emulator. And i wanna make my own pip script to install modules and libraries , but idnt knw how, can anyone help me?
Thank You, ofc ill read abt the cmd
module
-
RE: Hello m building a terminal emulator. And i wanna make my own pip script to install modules and libraries , but idnt knw how, can anyone help me?
m doing this just for fun " better than stash " that was just a comment
-
RE: i deleted Tabs.plist and other files of pythonista without jailbreak .
yo i fixed it when i deleted these files and restart pythonista well all my files are gone but everything its okay 👌
-
i deleted Tabs.plist and other files of pythonista without jailbreak .
hello if i deleted one of these files , is it dangerous cuz i did it
THE FILES
Bookmarks.plist
Documents
Favorites.plist
KeyboardShortcutDefinitions.json
Library
Tabs.plist -
RE: Hello m building a terminal emulator. And i wanna make my own pip script to install modules and libraries , but idnt knw how, can anyone help me?
right . i need to make my own pip but can you help me or can you give me ur email to contact you if ur interested
-
RE: Hello m building a terminal emulator. And i wanna make my own pip script to install modules and libraries , but idnt knw how, can anyone help me?
look bro m making a terminal emulator just like stash.
I wanna make a script that download libraries from the pypi just like pip . i saw the pip.py file in stash but i dont know how to put it on my script -
RE: Hello m building a terminal emulator. And i wanna make my own pip script to install modules and libraries , but idnt knw how, can anyone help me?
i knw but I dont know? how to put it on my script
look this is my codeimport requests, urllib, urllib3, os, dialogs, ui, console import sys, editor import runpy path = '/private/var/mobile/Containers/Shared/AppGroup/DDCB5D2A-91C1-4B79-BA39-E31DE9BF50C0/Pythonista3/Documents/' def calcul(): print("Calculator verion 0.0.1") n1 = int(input("num1: ")) n2 = int(input("num2: ")) print("Please enter a valid number") choices = ["x","/","+","-"] print(choices) choice = input("enter the operator : ") if choice == "x": result = n1 * n2 print(result) if choice == "/": res = n1 / n2 print(res) if choice == "-": re = n1-n2 print(re) if choice == "+": r = n1+n2 print(r) def quick_note(): note = dialogs.text_dialog() console.alert("Would you save this note.", "If you wanna save this note click 'ok' ", "ok") editor.make_new_file('note.txt',note) def cpff(): print("""cpf copy any file with CPF version : 0.2 """) file_name = input("file name: ") #if u wanna copy the file the sheller must be in the exact path of the file or change the file to the sheller directory then copy it dir_path = os.path.dirname(os.path.realpath(__file__)) files = os.listdir(dir_path) for file in files: if file == file_name: o = open(file_name, 'r') content = o.read() new_name = "cpf-"+file_name editor.make_new_file(new_name, content) #First make the setup def simple_commands(): print(''' [?/$heller] Shell with no Experience 1. make-folders 2. create-file 3. remove files 4. cpf | copy files (only files) 5. python3 ( name of the file ) 6. Calc ( a simple calculator with only 2 num ) ''') while True: command = input(f'''[$heller] ''') if command == '1': fname = input("Folder name : ") os.makedirs(fname) console.hud_alert('Folder created') if command == '2': file_name = input("File name : ") content = dialogs.text_dialog('content') editor.make_new_file(file_name, content) console.hud_alert('File created') if command == "exit": sys.exit() if command == '3': try: name = input("File-Folder name : ") os.remove(name) console.hud_alert('File removed') except: print("Error this file-folder does not exist in this directory") pass if command == 'clear': console.clear() if command == "note": quick_note() if command == '4': cpff() try: if command == 'cd '+command.split(" ")[1]: d_name = command.split(" ")[1] p = path+d_name os.chdir(p) except: pass if command == 'cd?': current_directory = os.getcwd() print(current_directory) if command == 'ls': for subdir, dirs, files in os.walk('./'): for file in files: print(file) if command == "6": calcul() try: if command == 'python3 '+command.split(" ")[1]: file_path = command.split(" ")[1] runpy.run_path(file_path, run_name='__main__') else: pass except: pass version = '0.0.3' def setup(): print(f"\nWelcome to sheller {version} its a new shell for pythonista its better than stash or shellista.") simple_commands() def check(): if sys.version[0] == 2: print("sorry you can't use this programme\n your current version is python",sys.version[0]) else: setup() check()
-
Hello m building a terminal emulator. And i wanna make my own pip script to install modules and libraries , but idnt knw how, can anyone help me?
iwanna make a simple script to download modules and libraries for my terminal emulator , if anyone could help that well very nice. thanks.