Day 3 | Devember dev log 4
If you are only interested in the “org-software” project skip this update, not much of interest here.
Quick Update from the bus:
I don’t have anything coherent yet, mostly modified code snippets from various tutorials but I have not posted any code yet, so here is at least something.
I try to keep to an hour because there is not a lot of time at the moment. For me it’s kind of hard to pick up the thread from the last day my natural work cycle is usually more around 2 hours per item.
Anyways I made some progress with
- planning the overall project
- I realized how little I usually work with python it’s really mostly implementing or changing a bit of math
- sql is strange and even though I don’t need to handle it directly I need to get used to sqlAlchemy. I will probably need to come up with a couple of simple examples on my own.
random code - random sample from playing around with sqlAlchemy and other stuff - mostly from tutorials
import sqlalchemy from sqlalchemy import create_engine engine = create_engine('sqlite:///:memory:', echo=True) connection = engine.connect() connection.execute( """ CREATE TABLE users ( username VARCHAR PRIMARY KEY, password VARCHAR NOT NULL ); """ ) # tags VARCHAR connection.execute( """ INSERT INTO users (username, password) VALUES (?, ?); """, "test_user_0", "1234" ) result = connection.execute("SELECT username FROM users") for row in result: print("username:", row['username']) connection.close() #reminder: don't write useless comments #connection.execute( # """ # INSERT INTO users (username, password) VALUES (?, ?, ?); # """, # "test_user_0", "1234", "test_tag" #) # # import subprocess import pyinotify w = pyinotify.WatchManager() cases = pyinotify.IN_MODIFY class EventHandler(pyinotify.ProcessEvent): def process_IN_MODIFY(self, event): print "modified" # note: inotify works on linux only # #
Maybe I have some time later to make this post a bit more coherent and add the more interesting stuff. I have some handwritten notes. Usually I don’t write about what I do, so I have to get used to that.