技術メモ

メモ代わりに使います!

2018-01-09から1日間の記事一覧

Python-長い行を途中で折り返す

v = 1 + 2 + \ 3 + 4 + 5 \ + 6 + 7 \ + 8 + \ 9 + 10 print v

Python-insert実行してもエラーはないのにデータが作成されない

下記のようにcommitとcloseを忘れないように db = connect_to_cloudsql() cursor = db.cursor() cursor.execute('SET NAMES utf8;') cursor.execute('SET CHARACTER SET utf8;') cursor.execute('SET character_set_connection=utf8;') cursor.execute("inse…

Python-現在表示されているページのURLを取得

下記のように記載することで取得可能 class ShowQuestion(webapp2.RequestHandler): def get(self, id): question = Questions.get_by_id( int( id ) ) #数値idの場合intキャストする # いろいろする app = webapp2.WSGIApplication([ ('/questions/(.*)', S…