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.
Workaround for Multiple File Sharing
-
So what does everyone think? Maybe everyone has done this before. The thought just crossed my mind, "Now that my friend has Pythonista, sharing multiple files is impossible." Not anymore with my idea.
Hopefully @omz will add the ability to do this without needing installer files. Does anyone know if he is working on this? Because it is super annoying. I understand that it is a problem with Apple, and them suppressing Pythonista because they think it is dangerous, or something like that.
-
This Save Attachment extension will let you bring a file into Pythonista, for example a Zip of files and or folders. Pythonista has built in the facility to Unzip an archive.
-
@guerito yes, but that extension also only works when in a file action/share mode. The situation I am in with my friend is one where we are just texting the files to paste to each other's Pythonista apps.
Another idea I had would have been to make a Python program that me and my friend could connect to, and store files, and then when accessed through socket via a special command, it would run a piece of the code that would request the files from the server, and save them all to the user's Pythonista app. (Complicated explanation for a simple story, sorry.)
Yeah, I know. I am working on a better extension for our current position.
-
If you're curious, I wrote something similar a while back: https://github.com/dgelessus/pythonista-scripts/blob/master/PackUI.py
-
@AtomBombed If you have access to a WebDAV server you could try my gitsynchista. Don't get mislead by the name. You don't have to have git involved if you don't want to...
-
This is really the whole point of GitHub.
-
I think the OP want to share the files directly from Pythonista to Pythonista.
Best way would be to use Dropbox or Google Drive and have both users connect to the same folder. Then all that would be needed is to download from dropbox or Google Drive.
But yes, Github is great also for version control.
I know for now you can share multiple files by selecting them and having google drive installed. That is how I do it. It can't share folders though.
-
gitview or stash git can be used from within pythonista. Though if both sides are changing a repo, you either have to be vigilant about only committing after doing a pull, or you must use fetch/merge in the stash version (I really ought to write a tutorial).
Another option along the lines of texting files back and forth would be gistcheck. Use the built in folder gist export from pythonista, then use gistcheck to read the folder in on the other side. gistcheck allowed for some level of modify/push to the same gist, althouh not sure it has been tested with multiple files. Also, I for one have not tested it in Pythonista 2.0 (I remember the bookmarklet stopped working with some ios version, but then maybe started working again. Possibly a share sheet would be more appropriate)
-
@AtomBombed A few questions / comments on the code above.
- This solution will not deal gracefully with code that already contains triple single quoted strings. @dgelessus PackUI does a good job of dealing with this.
- Usually when you are going to compare
raw_input()
text against constants, it is a good idea to first .lower() or .upper() the user text. - Why convert the user entered text to int before converting it to float? This will give unexpected averages by dropping the fractional part.
- Why not use the built-in sum() rather than adding the numbers one by one?
- .keys() is redundant and not needed in this context.
- The files are opened but not which can be dangerous especially in Pythonista.
# coding: utf-8 files = {"averages.py":'''# coding: utf-8 # This program will calculate the average value of a list of user entered floats. from __future__ import division stored = [] while True: entered_value = raw_input("Enter a number, or end: ").lower() if entered_value == "end": break elif entered_value == "alpha": print(7.6) else: stored.append(float(entered_value)) print("Average: " + str(sum(stored) / len(stored)))'''} for filename in files: with open(filename, "w") as out_file: out_file.write(files[filename])
-
@ccc yeah, this was just quickly thrown together... but I am still working on a better way for it.
I actually am turning this into a module that parses, packages it automatically, and escapes the quotes in the file you want to share.