omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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.


    a simple terminal emulator

    Pythonista
    5
    14
    2842
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • MustaphaBen
      MustaphaBen last edited by ccc

      new version v0.0.3
      I added script execution python3 {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()
      
      
      
      
      
      1 Reply Last reply Reply Quote 0
      • MustaphaBen
        MustaphaBen last edited by

        thanks for testing my script

        cvp 2 Replies Last reply Reply Quote 0
        • cvp
          cvp @MustaphaBen last edited by cvp

          @MustaphaBen the line

          path = '/private/var/mobile/Containers/Shared/AppGroup/DDCB5D2A-91C1-4B79-BA39-E31DE9BF50C0/Pythonista3/Documents/'
          

          refers to your device. The code after AppGroup varies on all devices, thus if you want to know it for the device on which your script runs, you can extract it from sys.argv[0].
          If you don't do it, your path is incorrect

          cvp 1 Reply Last reply Reply Quote 0
          • cvp
            cvp @MustaphaBen last edited by cvp

            @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)
            
            1 Reply Last reply Reply Quote 0
            • cvp
              cvp @cvp last edited by cvp

              @Mustaphaben you can also replace

                    if command == 'cd '+command.split(" ")[1]:
              

              By

                    if command.startswith('cd '):
              
              1 Reply Last reply Reply Quote 0
              • MustaphaBen
                MustaphaBen last edited by

                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

                cvp 1 Reply Last reply Reply Quote 0
                • cvp
                  cvp @MustaphaBen last edited by

                  @MustaphaBen if you use Pythonista or some other similar apps, you don't need a jailbreak

                  1 Reply Last reply Reply Quote 0
                  • MustaphaBen
                    MustaphaBen last edited by

                    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

                    cvp 1 Reply Last reply Reply Quote 0
                    • cvp
                      cvp @MustaphaBen last edited by

                      @MustaphaBen Understood. Didn't know.

                      1 Reply Last reply Reply Quote 0
                      • MustaphaBen
                        MustaphaBen last edited by

                        I think jb's progrmmers are creative more than apple's programmers

                        1 Reply Last reply Reply Quote 0
                        • JonB
                          JonB last edited by

                          Just curious, but in what ways do you feel limited by iOS 10.3?

                          1 Reply Last reply Reply Quote 0
                          • MustaphaBen
                            MustaphaBen last edited by

                            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

                            1 Reply Last reply Reply Quote 0
                            • aryaemma
                              aryaemma last edited by aryaemma

                              This post is deleted!
                              1 Reply Last reply Reply Quote 0
                              • Girmaymebrahtu
                                Girmaymebrahtu last edited by

                                This post is deleted!
                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post
                                Powered by NodeBB Forums | Contributors