Here is a ui file reader that uses the os and ui modules that populates a tableview with files in a directory and allows you to click the files to view the contents in a text view.
Easy to tweak to make more complex applications.
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.
Here is a ui file reader that uses the os and ui modules that populates a tableview with files in a directory and allows you to click the files to view the contents in a text view.
Easy to tweak to make more complex applications.
Collapsable code would be an awesome feature all the way through.
Pen Tool
Something like Adobe's pen tool where we can add custom vector shapes to UI's.
The reason I suggest this is because I find myself having to design UI elements in a separate app and converting them to .png, loading them into an ImageView. SVG support would be nice.
Workaround:
Can't think of a workaround right now. But I do have some ideas that could use the objc_utils
. Also there is a vector app that is open source now. Perhaps some parts could be integrated into Pythonista?
Alignment Options
Alignment and snapping options. I think Editorial aligns and snaps just fine but it doesn't work in Pythonista's UI designer. Perhaps even a bit of grid spacing options also.
Alignment in Pythonista's UI designer doesn't really work.
Workaround:
Can't think of a workaround right now.
If you have been following the Pythonista Slack Chat, you might have seen I have been working on a bible app using SQlite3 in Pythonista. Well, it is complete enough to showcase here in the forums.
Modules it uses
This single app demonstrates just about every feature of Pythonista's ui
module. It demonstrates how to use Sqlite databases with the ui module to create a full app. The current list of modules it actively uses are ui,sqlite3,datetime,sound,console,clipboard,dialogs
What I still need to do
I still want to tweak some things and clean up the code a bit. I still want to add translation functionality and cross-reference.
Why I created it
I created this app for my personal use and education and for the use and education of others. I needed to be able to move through the scriptures quicker than other apps on the Apple app store allowed me to move. I also wanted to be able to take notes faster based on the scriptures.
License
GNU GENERAL PUBLIC LICENSE
Yes, you can contribute!
Here is a test using Pythonista's UI module to create a password database with the sqlite module. This project demonstrates
No security or integrity. This is just a simple example. Code is not as clean as it could be yet.
I have a tutorial about databases in the works
Nice to see a full and useful app with Pythonista! A few years ago I was set to learn 7 spoken languages but soon realized it would take much longer to see any profit on that course. That is how I got into computer programming. I figured they were languages too, and much easier to speak in.
This may be helpful when I get back on that course. Good job!
Hello. Starting to make some projects with Pythonista for educational purposes (for people new to Pythonista).
I will try to keep the code short and simple. All projects are hosted on my Github.
The Navigation View Tutorial demonstrates how to add multiple views to a navigation view. Additionally you will see how to:
I might be uploading quite a few examples/projects made with Pythonista, and I quickly realized how flooded the forums would be. Should I just create one post titled "Tutorial Doctor Shared Code" or something and just update that one post?
If that is the case, I should consolidate my other posts there too?
I am using github and am just posting links to repo directories.
Follow the Pythonista Slack link provided here and join the #editorial
channel for more direct help.
Slack is an online instant messaging and collaboration system and solution that enables you to centralize all your notifications, from sales to tech support, social media and more, into one searchable place where your team can discuss and take action on each.
While we are at it, we might as well throw Pythonista in there. That is a good idea.
import ui,sqlite3
database = "database.db"
con = sqlite3.connect(database)
cursor = con.cursor()
users_query = "select * from users"
user_sections ="SELECT * FROM users INNER JOIN post on post.user_id = user.id"
user_names = [x[1] for x in cursor.execute(users_query)]
v = ui.load_view()
table = v['table']
table.data_source.items = user_names
v.present()
To add accessories:
user_names = [{"title":x[1],"accessory_type":"disclosure_indicator"} for x in cursor.execute(users_query)]
I completely missed this reply. Sounds like a good challenge to take on. I'll see how far I can get with it.
@johnridesabike Wow! Really! Glad it was helpful!
I am currently working on setting up a Flask template project that will work somewhat similar to Pythonista using Bootstrap for the UI elements. I plan to convert that bible app over to a WebApp and maybe an IOS app one day. I followed you on Github as well by the way.
- TD
Nice! I know what it takes to make an app that you've been wanting. I made a full bible app myself. I didn't use Jinja though (as I didn't know anything about it then):
https://github.com/TutorialDoctor/The-Bible-App
I am currently learning Flask for web app development. All of what I know started with Editorial's drag&drop programming. From there I went to Pythonista and now I am learning Flask.
Thanks @olemoritz!
I'm thinking about making an Sqlite workflow where you can create, read, update, delete info of an SQLITE database with actions.
I'm thinking about making the different functions as custom actions with fields for input.
I'd like some feedback on if anyone would like this and some ideas on how one might use this. This will help me design it better.
Thanks.
-Tutorial Doctor
@xxfunxx said:
Hello. I wrote something a long time ago that might help you understand programming a bit better:
http://forum.maratis3d.com/viewtopic.php?id=868
and
http://forum.maratis3d.com/viewtopic.php?id=840
I'm interested in using Pythonista to program Alexa skills. Currently I am playing around with a chatbot script I made a while ago and using the speech module to have the iPad talk to Alexa (really fun). I'm wondering if someone has already created a smart home module that can connect to various devices or not.
I did find a video of someone using Python to create skills. https://www.youtube.com/watch?v=cXL8FDUag-s
I feel I am on to something. Anyone done anything with smart home devices? Perhaps HomeKit in Pythonista would be cool? A little program I am playing with below:
import speech
def talk(x):
speech.say(x,"en-au",.5)
commands = {"key":"value",
"end":"end",
"brief":"flash briefing",
"stop":"stop",
"simon":"simon says: What is your favorite animal?",
"1":"volume to 1",
"2":"volume to 2",
"3":"volume to 3",
"4":"volume to 4",
"5":"volume to 5",
"6":"volume to 6",
"7":"volume to 7",
"8":"volume to 8",
"9":"volume to 9",
"10":"volume to 10",
"bible":"play bible app",
"?":"What can you do?",
"weather":"What's the weather like?",
"movies":"What movie's are playing",
"joke":"Tell me a joke.",
"inspire":"Inspire me."
}
def Main():
running=True
while running:
command=input('Type a command :')
if command != "end" or "the":
try:
talk("Alexa, "+commands[command])
except: talk(command)
if command=='end':
return False
if command=='...':
talk(command)
# FUNCTIONS
#-----------------------------
Main()
I'm getting back into creating Workflows for Editorial and realized I never posted the Bible app I made for Editorial to the forums. Instructions below.
Inside Editorial download the bible app workflow:
http://www.editorial-workflows.com/workflow/5886269255057408/gB6JnYgZBNw
Then, download my GitHub Get workflow:
http://www.editorial-workflows.com/workflow/5825287698776064/0yCN6R61LAQ
By default the GitHub Get workflow is set to download a Github repo that includes the needed bible.db
database. Run the Github Get workflow, find the database file inside of the new-found Online Downloads folder in Editorial, and move it to the Documents folder.
Now you can run the Bible 2 workflow!
I'm guessing the newest version of Editorial is supposed to have an asset picker for the sound module. I don't see it? Perhaps this was copied from Pythonista (which does have an asset picker) and was not removed for Editorial documentation. However, Editorial does have an updated sound module.
Any leads?
from sys import argv
filename=input()
target=open(filename,'w') #open it for writing, as opposed to reading.
target.write('hello')
target.close()