| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- tomcat
- MSSQL
- SQL
- IntelliJ
- plugin
- 보조정렬
- window
- GIT
- Java
- hadoop
- mybatis
- es6
- NPM
- 공정능력
- SPC
- Sqoop
- Eclipse
- table
- mapreduce
- Spring
- react
- Kotlin
- JavaScript
- Python
- Express
- Android
- xPlatform
- vaadin
- R
- SSL
- Today
- Total
목록python (28)
DBILITY
특정 디렉토리의 파일 목록을 조회, 이름변경, 복사를 해봤다. os, shutil을 사용. 문자열 앞에 r이나 R을 붙이면 백슬래시(\)가 문자로 인식된다.즉, Escape문자로 인식하지 않는다. import os import shutil import uuid # current directory print(os.getcwd()) # A Python raw string is a normal string, prefixed with a r or R. # This treats characters such as backslash (‘\’) as a literal character. # This also means that this character will not be treated as a escape char..
Mock up서버는 훌륭한 분이 개발을 해두어서 사용했다. https://github.com/joon610/mockup-server GitHub - joon610/mockup-server: this is mock server (Vue + TypeScript + Electron) this is mock server (Vue + TypeScript + Electron) - GitHub - joon610/mockup-server: this is mock server (Vue + TypeScript + Electron) github.com Fetch데이터는 아래에서 받았다. https://dummy.restapiexample.com/ Dummy sample rest api - dummy.restapiexampl..
python공식사이트를 참고하고, 다른 언어를 사용하는 경우엔 대충 자동완성을 사용하면 알 수 있음. import time import datetime print(time.time()) # 1629171779.0626843 print(time.ctime(time.time())) #Tue Aug 17 12:42:59 2021 print(time.localtime()) #time.struct_time(tm_year=2021, tm_mon=8, tm_mday=17, tm_hour=12, tm_min=42, tm_sec=59, tm_wday=1, tm_yday=229, tm_isdst=0) print(time.localtime().tm_yday) #229 print(time.localtime().tm_year)..
가장 편한 것은 3.6이상에서 지원하는 세번째겠다. >>> name = 'bean' >>> print('My Name is %s'%name) My Name is bean >>> print('My Name is {}'.format(name)) My Name is bean #3.6 over >>> print(f'My Name is {name}') My Name is bean
그냥 해봤다. 새로운 언어(?)의 사용법을 조금 익히면 항상 그렇다. text파일을 write mode로 여는 부분이 있고 1~46까지 6개의 무작위 번호를 추출하는 부분은 다음과 같다. >>> import random >>> random.sample(range(1,47),k=6) [37, 21, 2, 27, 31, 28] #결과가 오름차순으로 정렬이 안되어 있어 다음과 같이 sorted를 사용 >>> sorted(random.sample(range(1,47),k=6)) [11, 25, 29, 31, 41, 42] import random import re def lotto(game=5): ele_len: int = 6 NL: str = '\n' try: f = open('fortune_num.txt',..