일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
- ubuntu
- java
- Android
- IOT
- parser
- 라즈베리파이
- dht11
- Raspberry Pi
- odroid-x2
- JSON
- orange pi
- uno
- rails
- 아두이노
- python3
- ruby on rails
- mqtt
- 오렌지파이
- Server
- BLE
- RUBY
- STM32F4
- nano
- Nginx
- flask
- Arduino
- Raspberry Pi 3
- 개발환경
- Python
- Beacon
- Today
- Total
목록Python (9)
[熱情]
http://www.uugear.com/portfolio/dht11-humidity-temperature-sensor-module/
python 3.5 from multiprocessing import Process import time import os def func1(data): for i in range(0, 10): print(data) def func2(): for i in range(0, 10): print("bye~!") def func3(): print('module name : ', __name__) if hasattr(os, 'getppid'): print('parent process : ', os.getppid()) print('process id : ', os.getpid()) if __name__ == "__main__": proc1 = Process(target=func1, args=("hello",)) p..
python 3.5 import json sample_data = '{ "num" : 123, "name": "bbb", "phone": "01012345678", "email": "asdf@qwer@net" }' def json_parser(data): try: jdata = json.loads(sample_data) print("num : ", jdata["num"]) print("name : ", jdata["name"]) print("phone : ", jdata["phone"]) print("email : ", jdata["email"]) except(KeyError, TypeError, ValueError) as e: print("json parser error : ", e) if __name..
import sys try: user_input = input() except KeyboardInterrupt: print("Keyboard interrpt : ctrl + c") sys.exit(0)
python 3.x대를 사용. #구구단#이게 최선의 코드는 아니라고 생각한다~~ for i in range(2, 10): for j in range(1, 10): print("{0} x {1} = {2}".format(i, j, i*j)) # 시간 출력하기.. # iso8601 utc import datetime locattime = datetime.datetime.now().isoformat() utctime = datetime.datetime.utcnow().isoformat() print(locattime) print(utctime) 2016-01-26T14:13:23.054052 2016-01-26T05:13:23.054052