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.


    can pythonista use pickles?

    Pythonista
    4
    34
    15462
    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.
    • bobsmith76
      bobsmith76 last edited by

      My python program relies heavily on pickles. Without pickles the thing will never work. Further, it would take an enormous amount of time to rebuild my program without pickles and I'm not willing to do that since I essentially use pythonista just to show off at parties or social events. Is there anyway to get these pickles to work or is there some type of work around?

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

        @bobsmith76 if pickles = pickle, see , else, Sorry

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

          yea, I meant pickle. Right now, I can't import pkl files into pythonista. How do I do it?

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

            @bobsmith76 You can import any file to Pythonista via a script like here

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

              ok I changed the code to

              resp = console.alert('Alert!', 'Choose File Extension', '.py', '.pyui', '.pkl', hide_cancel_button=False)
                      if resp == 1:
                          ext = '.py'
                      elif resp == 2:
                          ext = '.pyui'
                      elif resp == 3:
                          ext = '.pkl'```
              
              Then I ran the code and clicked pkl and it said Done! saved in ~Documents/inbox as clipboard 1.pkl.  I then went back and tried to import the pickle files but they were still grayed out.
              cvp 1 Reply Last reply Reply Quote 0
              • cvp
                cvp @bobsmith76 last edited by

                @bobsmith76 Where is your file?
                It should be imported via

                • share
                • run Pythonista 3 script
                • edit script
                • choose your script
                • run
                1 Reply Last reply Reply Quote 0
                • bobsmith76
                  bobsmith76 last edited by

                  I don't see how you import via share. The only place I know to import is to click on 'this ipod touch', that gives me the choice to hit a + sign but I do not see a button that says 'share'. I then tried clicking on the setting and i did see 'share extension shortcuts'. I then hit run script but nothing happened.

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

                    @bobsmith76 I supposed your file was outside Pythonista because you want to import it.
                    Wher is your file?

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

                      right now the file is in the same folder is in the same folder that I put my other files when i want to import: my icloud folder. i put all my files into the icloud then i hit 'this ipod' and then hit the plus sign to import the files but the pkl files are grayed out.

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

                        @bobsmith76 In the files app, select your file, then click share at bottom left, then run Pythonista 3, then edit script, then select the import script, then run

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

                          @bobsmith76 Or, if you can rename your file as .dat instead of .pkl, you will be able to import in the way you tried, and then, when the file will be in Pythonista, you will also be able to rename it as .pkl

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

                            Ok, I can do the first 3 steps but when I go and hit edit script, a list of my files will pop up which are available in my icloud and even though my pkl files are in my icloud they do not appear so that I cannot select them. I tried renaming them as dat files but that did not work either.

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

                              @bobsmith76 After edit script, you have to select the import script that you have just copied some hours ago, and run it

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

                                @bobsmith76
                                When you have, in Files app, selected your .pkl file, and klicked share at bottom left,
                                Do you see this menu? If yes, click "import file" and your .pkl file will be on "this iPod"
                                (Forget the script I linked in the begin of this topic)

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

                                  Maybe I did this step incorrectly

                                  https://forum.omz-software.com/topic/3606/script-to-import-any-file-in-pythonista-from-any-app

                                  i named that files python_script and put it in my file folder which contains all of my other files. maybe that was wrong. in any case, when i click on pyth_script.py from 'script library' this ipod touch, i then hit the wrench sign, then share, then run pythonista3, then i see that menu you're telling me about. when i hit edit script, nothing happens, because just take me back to the script library and the pkl files aren't there, when i hit import file, it just copies the pyth_script to my script library.

                                  cvp 3 Replies Last reply Reply Quote 0
                                  • cvp
                                    cvp @bobsmith76 last edited by

                                    @bobsmith76 Forget this method and try the last one I described with an image

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

                                      @bobsmith76 With any method, you have to start the process not in Pythonista but in the Files app showing your .pkl file!
                                      Then, you have to select the .pkl file and click share at the bottom left...

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

                                        @cvp print of French screen in Apple Files app

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

                                          @bobsmith76 What you did in your last post is to share your script from Pythonista to Pythonista instead of sharing a .pkl file from another app (ex: Files app) to Pythonista 😇.
                                          When an external shared file "arrives' in Pythonista, you have to import it via the standard "import file" (since last version) or via an user script (like your copied script). The import will copy your .pkl file to "script files/this iPod/name.pkl"

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

                                            here, I took some screenshots available here

                                            https://drive.google.com/drive/folders/1djAgW_weu-eGZFB-ZKV_6ZOQzu6bxXrB?usp=sharing

                                            when I click on the file to share on my desktop with is lemmata.pkl nothing relating to pythonista3 shows up.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Powered by NodeBB Forums | Contributors