목록분류 전체보기 (18)
Python길라잡이
Create an authenticable requestSUGGEST EDITSReceiving an API request, it issued Access keyand Secret keygenerated a token to the Authorizationtransfers through the header. The token to register in the Authorization header follows the JWT ( https://jwt.io ) format.The signature method is HS256recommended, Secret keyand uses the one issued by the secret . Payload consists of the following.{ "acces..
Your browser does not support iframes.
액세스 한정자는 멤버변수나 메소드의 어디에서 액세스 할 수 있는지를 지정하는 것입니다. 지정에는 "public" "private" "protected"의 3 가지 중 하나를 지정합니다. 우선 멤버 변수에 지정된 경우를 살펴 보자.class Test{ public 멤버 변수명; private 멤버 변수명; protected 멤버 변수명; } 위와 같이 멤버 변수의 앞에 액세스 한정자를 붙이는 것으로, 그 멤버 변수에 접근 가능 범위를 지정할 수 있습니다. 각각의 액세스 한정자마다 권한이 어떻게 되는지는 다음과 같습니다.public 클래스내, 클래스외의 어디에서라도 액세스 가능 private 같은 클래스안에서만 액세스 가능 protected 같은 클래스 및 자식클래스에서 액세스 가능 「protected」클래..
$ sudo apt-get install libhpdf-dev$ sudo pecl install haru이렇게 에러가 나올것이다./usr/bin/ld: cannot find -lpng libpng12-dev를 설치한다.apt-get install libpng12-dev /etc/php5/mods-available/haru.ini1extension=haru.so 그후 php5enmod haru
mariaDB 10.1sudo apt-get install software-properties-commonsudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://ftp.utexas.edu/mariadb/repo/10.1/ubuntu xenial main'sudo apt-get update sudo apt-get install mariadb-server http://kkkw.hatenablog.jp/entry/ubuntu/install-mariadb
/etc/my.cnf 의 [mysqld] 섹션에 다음을 추가한다.plugin-load = handlersocket.so;semisync_master.so;semisync_slave.so innodb_adaptive_hash_index = 1- B-Tree에 더해서 Hash인수를 on-demand에 더하는 기능- 완전히 Hash를 사용하면 handlersocket 경우의 참조가 30%정도 빨라진다.- 메모리를 사용하는게 싫으면 무효로 하는편이 좋다.
import urllib2 domain = 'example.com'password = 'xxxxxxxxx'host = '*'ipaddr_file = '/var/log/ddns_ip.txt' ip_get_url = "http://dyn.value-domain.com/cgi-bin/dyn.fcg?ip" attempts = 0 while attempts < 3: try: response = urllib2.urlopen(ip_get_url, timeout=5) content = response.read() f = open(ipaddr_file, 'w') f.write(content) f.close() ip_put_url = 'http://dyn.value-domain.com/cgi-bin/dyn.fcg?d=%s..
MySQLdb란MySQL는 Python의 서포트용 모듈. MySQLdb(version1.2.2)는 MySQL version3.23-5.1를 서포트하고 Python의 version2.3-2.5에서 작동합니다. MySQLdb version1.2.2의 간단한 사용방법import MySQLdb # MySQL데이터베이스에 연결하기 위해서는 MySQLdb.connect를 준비한다. # 인수 지정가능한것은 다음과 같다. # host, user, passwd, db, port, unix_socket, conv, connect_timeout, compress, named_pipe, init_command, read_default_file, read_default_group, cursorclass, use_unicode,..
pythonchallenge를 알게 되어서 문제를 풀고 있는데, 4단계인데 벌써 어렵네요. 푼 방법 1번째 import urllib.request import re def A(str) : return_value = '' page_text = '' with urllib.request.urlopen("http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=%s" % str) as page: for line in page.readlines(): page_text = page_text + line.decode('UTF-8') match = re.search('[0-9]+', page_text) if match: return_value = match.group..
우분투에서 python용 MySQL 을 설치하는 방법은 두가지가 있다. 1. pip을 이용한 설치방법sudo pip install MySQL-python만약 EnvironmentError: mysql_config not found 에러가 나올경우에는mysql_config가 들어있는 libmysqlclient를 설치해줘야 한다.sudo apt-get install libmysqlclient-dev MySQL이 아닌 MariaDB의 경우에는sudo apt-get install libmariadbclient-dev 그후 mysql 커넥터도 설치해줘본다.pip install mysql-connector-python 그후 다음의 에러가 나올시에는/usr/bin/ld: cannot find -lssl/usr/bin..