Possible to share pyui files?
-
Hello everyone,
I downloaded pythonista a couple weeks ago and created a forum account a few days ago, but this is my first post. I wanted to first mention that I also downloaded editorial (although I'm not sure if I will use it much), in support of pythonista. I would really like to thank omz for the time and support of pythonista.
I know its just a few days shy (hopefully) of 2.0, but here is my first question..
How would I go about sharing code that uses pyui files? I created a basic image editing app that I would like to share, and if it was pure python, copy and paste would be easy. I do not know how someone would get my pyui file(s) into their device (without publishing to app store). Is it possible?
-
Thank you! The PackUI script is perfect! I will mess around with reading, printing, and copying later.
Is it ok for me to post the results here if anyone wants to check it out? They seem kind of long.
-
@dgm while posting the code is allowed it is good practice to put it some where more appropriate (GitHub, GitLab, Mecurial, PasteBin, BitBucket, etc) and then post the link to it here, as this also makes it easier for us to play around with your programs. We can simply download it instead of trying to copy and paste the HTML version of the code.
It also means we can provide more constructive feedback.
-
@Cethric thanks for the clarification.
The uipacked files can be found Here. This is my first time using github, so I hope I did it right.
Edit: I took down the packed files as per @Cethric 's advice. The original files can now be found in the same place.
-
@Webmaster4o
How would I change the file to a .json ending. adding it directly to the filename only makes it file_name.json.pyuiThis method sounds like a good one where you can simple change the json file back to pyui when it is downloaded.
-
@TutorialDoctor This is only possible in the beta.
-
last edited by
-
@TutorialDoctor I should have said not sure if it will work in 1.5. That was a typo. It won't work unless you're on the beta.
-
You can use os.rename() to rename a file from pyui to json...
-
Renaming files and folders using Python's library functions works normally on 1.5, as @JonB said. The file name box in the editor is however very persistent in keeping the current file extension. This has been changed in the beta, now changing a file's extension is much easier.
-
Last night I figured out a neat way to share pyui files. I created two actions, one that converts pyui files into json, and another to convert json into pyui. This way we can share the .json files and things are well.