a simple terminal emulator
-
new version v0.0.3
I added script executionpython3 {your file here}
import 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 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(''' [~/Documents] Main directory 1. make-folders 2. create-file 3. remove files 4. cpf | copy files (only files) 5. python3 ( name of the file ) ''') 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 == '3': name = input("File-Folder name : ") os.remove(name) if command == 'clear': console.clear() 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) 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()
-
@MustaphaBen you can also check which error your command gives
try: if command == 'cd '+command.split(" ")[1]: d_name = command.split(" ")[1] p = path+d_name os.chdir(p) except Exception as e: print('error:', e)
-
@Mustaphaben you can also replace
if command == 'cd '+command.split(" ")[1]:
By
if command.startswith('cd '):
-
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
-
@MustaphaBen if you use Pythonista or some other similar apps, you don't need a jailbreak
-
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
-
@MustaphaBen Understood. Didn't know.
-
I think jb's progrmmers are creative more than apple's programmers
-
Just curious, but in what ways do you feel limited by iOS 10.3?
-
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