I have a script functions.py that contains functions for all the database processing in sql, and another one that imports functions.py and is supposed to call something like functions.get_all_entries_in_database(). However, I always get this error:
Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/A76B1CFC-263B-4F7C-8D73-F7A0548010E8/Pythonista3/Documents/Codes/Audio/Main.py", line 52, in change_playing_mode_action
modes = manager.get_playing_modes(id)
File "/private/var/mobile/Containers/Shared/AppGroup/A76B1CFC-263B-4F7C-8D73-F7A0548010E8/Pythonista3/Documents/Codes/Audio/db_lib.py", line 144, in get_playing_modes
modes = c.execute('SELECT %s FROM playing_mode ORDER BY id'%keywords).fetchall()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 6163689472 and this is thread id 4315310976
salite3.threadsafety doesn’t chance anything...
I have some questions about tableViewCells:
- when I swipe a tableViewCell to the left, it displays a red delete button. Is it possible to show multiple buttons there?
- can I see for how long a tableViewCell has been pressed? Like, if I hold down on it for two seconds I get a menu to rename that cell?
- Is it possible to display a second line of text in a tableViewCell with a different Color and size?
Thanks a lot :)
The more reasonable stuff:
- with Shortcuts: app icon that launches my favourite game and sets a reminder for 30min, so that I stop wasting my time
- learning python in general, especially on the school bus
- showing me today’s lessons in the iOS widget menu
- notification if lessons get cancelled or moved
- push-up counter and push-up max-hold timer
- music app that downloads songs from YouTube and then plays them (didn’t want to pay for Spotify or some alternative)
Things I still want to do:
- app for making flowcharts, they should then be converted automatically to python code (and code to flowchart). Graphvitz (a software for that) is just way too expensive for me.
- GPS tracker that logs my coordinates when going for a run (and then plot them on a map on a large screen in my room, so that I can see all my routes and times)
- several games
@cvp Thanks, I tried it and it is exactly what I wanted. I just got to get used to using placeholders, I barely used them before... :)
@mikael I’ll definitely look into it when I understand SQL. Although I never feel like really knowing a coding language, because there’s always something new to learn (at least for me). I mean, I’ve been coding in python a lot for 3 years now and still haven’t used placeholders :)
I recently began learning about SQL in school (for now it’s just about the SELECT command) and realised how incredibly inefficient the data management in my previous python projects is. If I needed to save data and use it again the next time the code runs, I saved it in .txt files and reloaded it later on.
I want code another iteration of my music player app in Pythonista, with a proper data base. What’s the best way to do this, like from the ground up? Any module suggestions? Preferably, I’d like to be able to use SQL commands, so that the things I learn also apply at school.
I’m aware that it’s a broad question, I just don’t want to start using a crappy module and then scrap the whole project halfway because a different approach is better. (this just already happened way too often)