'Programming > python(파이썬)' 카테고리의 다른 글
파이썬 print가 희한하네.. (0) | 2017.04.02 |
---|---|
파이썬 리스트(list)와 튜플(tuple) (0) | 2017.04.02 |
python sqlite3 (0) | 2017.03.30 |
python smtplib의 신비..? (0) | 2016.12.30 |
python이 인기라는데.. (0) | 2014.03.19 |
파이썬 print가 희한하네.. (0) | 2017.04.02 |
---|---|
파이썬 리스트(list)와 튜플(tuple) (0) | 2017.04.02 |
python sqlite3 (0) | 2017.03.30 |
python smtplib의 신비..? (0) | 2016.12.30 |
python이 인기라는데.. (0) | 2014.03.19 |
python에서 sqlite 파일을 접속해서 조작하는 방법
$ sudo apt-get install python-sqlite Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libsqlite0 Suggested packages: python-sqlite-dbg The following NEW packages will be installed: libsqlite0 python-sqlite 0 upgraded, 2 newly installed, 0 to remove and 7 not upgraded. Need to get 141 kB of archives. After this operation, 519 kB of additional disk space will be used. Do you want to continue? [Y/n] Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main libsqlite0 armhf 2.8.17-12 [119 kB] Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main python-sqlite armhf 1.0.1-11 [21.3 kB] Fetched 141 kB in 1s (95.8 kB/s) Selecting previously unselected package libsqlite0. (Reading database ... 137326 files and directories currently installed.) Preparing to unpack .../libsqlite0_2.8.17-12_armhf.deb ... Unpacking libsqlite0 (2.8.17-12) ... Selecting previously unselected package python-sqlite. Preparing to unpack .../python-sqlite_1.0.1-11_armhf.deb ... Unpacking python-sqlite (1.0.1-11) ... Setting up libsqlite0 (2.8.17-12) ... Setting up python-sqlite (1.0.1-11) ... Processing triggers for libc-bin (2.19-18+deb8u7) ... pi@raspberrypi:~ $ cd src pi@raspberrypi:~/src $ ll total 2060 drwxr-xr-x 2 pi pi 4096 Mar 30 14:40 . drwxr-xr-x 30 pi pi 4096 Mar 30 14:34 .. -rw-r--r-- 1 pi pi 2099200 Mar 29 12:29 sqlite.udb pi@raspberrypi:~/src $ python Python 2.7.9 (default, Sep 17 2016, 20:26:04) [GCC 4.9.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sqlite3 >>> conn = sqlite3.connect('sqlite.udb') >>> c = conn.cursor() >>> c.execute("select * from tbl_recv") <sqlite3.Cursor object at 0x769eaa20> |
데이터가 유니코드로 나오나..
# we can also implement a custom text_factory ... # here we implement one that will ignore Unicode characters that cannot be # decoded from UTF-8 con.text_factory = lambda x: unicode(x, "utf-8", "ignore") |
파이썬 리스트(list)와 튜플(tuple) (0) | 2017.04.02 |
---|---|
파이썬 type 확인하기 (0) | 2017.04.02 |
python smtplib의 신비..? (0) | 2016.12.30 |
python이 인기라는데.. (0) | 2014.03.19 |
python2 vs python3 (0) | 2013.01.02 |
어라?
파이썬으로 메일보내는데
새가
ㅅㅐ 로 보내지네.. 머지?
[링크 : http://unicode.scarfboy.com/?s=U%2BC0C8]
[링크 : http://unicode.scarfboy.com/?s=U%2b1109]
[링크 : http://unicode.scarfboy.com/?s=U%2b1162]
+
설정해도 안되고..
일단 ssh에서 직접 스크립트를 실행하면 한글이 안깨지고 가는데..
svn 통해서 hook 실행되면 깨진다.
[링크 : https://mikewest.org/2006/06/subversion-post-commit-hooks-101]
[링크 : http://svnbook.red-bean.com/nightly/en/svn.reposadmin.create.html#svn.reposadmin.create.hooks]
파이썬 type 확인하기 (0) | 2017.04.02 |
---|---|
python sqlite3 (0) | 2017.03.30 |
python이 인기라는데.. (0) | 2014.03.19 |
python2 vs python3 (0) | 2013.01.02 |
PyOpenGL (0) | 2011.10.04 |
python sqlite3 (0) | 2017.03.30 |
---|---|
python smtplib의 신비..? (0) | 2016.12.30 |
python2 vs python3 (0) | 2013.01.02 |
PyOpenGL (0) | 2011.10.04 |
python 3.2.2 64bit 버전 설치 (4) | 2011.09.13 |
python smtplib의 신비..? (0) | 2016.12.30 |
---|---|
python이 인기라는데.. (0) | 2014.03.19 |
PyOpenGL (0) | 2011.10.04 |
python 3.2.2 64bit 버전 설치 (4) | 2011.09.13 |
python 버전 골라서 실행하기 (0) | 2011.05.08 |
import OpenGL
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
|
python이 인기라는데.. (0) | 2014.03.19 |
---|---|
python2 vs python3 (0) | 2013.01.02 |
python 3.2.2 64bit 버전 설치 (4) | 2011.09.13 |
python 버전 골라서 실행하기 (0) | 2011.05.08 |
python C/api - PyObject_GetAttrString() (0) | 2010.04.06 |
python2 vs python3 (0) | 2013.01.02 |
---|---|
PyOpenGL (0) | 2011.10.04 |
python 버전 골라서 실행하기 (0) | 2011.05.08 |
python C/api - PyObject_GetAttrString() (0) | 2010.04.06 |
파이썬 문자열 쌍따옴표 세개 - """ python string (0) | 2010.04.04 |
PyOpenGL (0) | 2011.10.04 |
---|---|
python 3.2.2 64bit 버전 설치 (4) | 2011.09.13 |
python C/api - PyObject_GetAttrString() (0) | 2010.04.06 |
파이썬 문자열 쌍따옴표 세개 - """ python string (0) | 2010.04.04 |
python c/api 관련문서 (0) | 2010.03.25 |
[링크 : http://docs.python.org/c-api/object.html#PyObject_GetAttrString] |
Py_Initialize(); PyRun_SimpleString("teststr=\"test test\""); PyObject* po_main = PyImport_AddModule("__main__"); PyObject* po_dict = PyObject_GetAttrString(po_main, "teststr"); printf("teststr [%s]\n",PyString_AsString(po_dict)); Py_DECREF(po_main); Py_DECREF(po_dict); Py_Finalize();
python 3.2.2 64bit 버전 설치 (4) | 2011.09.13 |
---|---|
python 버전 골라서 실행하기 (0) | 2011.05.08 |
파이썬 문자열 쌍따옴표 세개 - """ python string (0) | 2010.04.04 |
python c/api 관련문서 (0) | 2010.03.25 |
python c/api - Py_DECREF (0) | 2010.03.25 |
Or, strings can be surrounded in a pair of matching triple-quotes: """ or '''. End of lines do not need to be escaped when using triple-quotes, but they will be included in the string. print """ Usage: thingy [OPTIONS] -h Display this usage message -H hostname Hostname to connect to """ produces the following output: Usage: thingy [OPTIONS] -h Display this usage message -H hostname Hostname to connect to [링크 : http://docs.python.org/tutorial/introduction.html#strings] |
class MyClass: """A simple example class""" i = 12345 def f(self): return 'hello world' [링크 : http://docs.python.org/tutorial/classes.html] |
For Python there is a standard way of documenting the code using so called documentation strings. Such strings are stored in __doc__ and can be retrieved at runtime. Doxygen will extract such comments and assume they have to be represented in a preformatted way. """@package docstring Documentation for this module. More details. """ def func(): """Documentation for a function. More details. """ pass ## @package pyexample # Documentation for this module. # # More details. ## Documentation for a function. # # More details. def func(): pass [링크 : http://www.stack.nl/~dimitri/doxygen/docblocks.html] |
python 버전 골라서 실행하기 (0) | 2011.05.08 |
---|---|
python C/api - PyObject_GetAttrString() (0) | 2010.04.06 |
python c/api 관련문서 (0) | 2010.03.25 |
python c/api - Py_DECREF (0) | 2010.03.25 |
python c/api 에서 모듈 불러오기 (0) | 2010.03.19 |