본문 바로가기 메뉴 바로가기

미선's Blog

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

미선's Blog

검색하기 폼
  • 분류 전체보기 (376)
    • 공부한다 (0)
      • 2021년 (0)
      • 밥줄 (0)
    • 프로그래밍 (182)
      • 자바 (0)
      • spring (3)
      • 파이썬 (9)
      • script언어 (11)
      • WEB (23)
      • Android (101)
      • OS (16)
    • 데이터관리 (36)
      • 딥러닝 (9)
      • BlockChain (18)
    • 금융 (4)
    • 이모저모 (152)
      • IT 이모저모 (94)
      • 인물 (7)
      • 프로젝트 관련자료 (7)
    • 임시작업장 (0)
  • 방명록

head first python (6)
[Head First Python] 6 사용자 정의 데이터 객체

def sanitize(time_string): if '-' in time_string : splitter = '-' elif ':' in time_string : splitter = ':' else : return(time_string) (mins, secs) = time_string.split(splitter) return(mins + '.' + secs) def get_coach_data(filename): try : with open(filename) as f: data = f.readline() return(data.strip().split(',')) except IOError as ioerr: print('File error: ' + str(ioerr)) return (None) sarah =..

프로그래밍/파이썬 2016. 2. 4. 11:31
[Head First Python] 5 데이터의 이해

두 가지 정렬 방법 원본 정렬(In-place sorting) 변환하고 대체합니다. 리스트의 sort() 사용 사본 정렬(Copied sorting) 변환하고 반환합니다. 내장함수 sorted() 사용 문자열 정렬 우선순위 하이픈 - 점 - 콜론 >>> data = [6, 3, 1, 2, 4, 5] >>> data [6, 3, 1, 2, 4, 5] >>> data [6, 3, 1, 2, 4, 5] >>> data.sort() >>> data [1, 2, 3, 4, 5, 6] >>> data = [6, 3, 1, 2, 4, 5] >>> data [6, 3, 1, 2, 4, 5] >>> data2 = sorted(data) >>> data [6, 3, 1, 2, 4, 5] >>> data2 [1, 2, 3,..

프로그래밍/파이썬 2016. 2. 3. 10:33
[Head First Python] 4 영속성

파일 쓰기 import os man = [] other = [] """ 파일 읽기 """ try : data = open('sketch.txt') for each_line in data : try : (role, line_spoken) = each_line.split(':', 1) line_spoken = line_spoken.strip() if role == 'Man' : man.append(line_spoken) elif role == 'Other Man' : other.append(line_spoken) except ValueError: pass data.close() except IOError: print('The data file is missing!') """ 파일 쓰기 """ try : ou..

프로그래밍/파이썬 2016. 1. 28. 16:25
[Head First Python] 3 파일과 예외

예외 처리 예외(exception) 런타임 에러 에러처리 방법 추가코딩 예외 상황에 대비하여 미리 처리한다 예상치 못했던 문제가 발생했을 때 처리할 수 없다. 먼저 실행하고, 나중에 복구하기 에러가 생기도록 나둔 다음에 에러가 생기면 처리한다. 코드가 해야 할 일에 집중한다. import os try : data = open('sketch.txt') for each_line in data : try : (role, line_spoken) = each_line.split(':', 1) print(role, end='') print(' said ', end='') print(line_spoken, end='') except ValueError: pass data.close() except IOError: p..

프로그래밍/파이썬 2016. 1. 27. 11:00
[Head First Python] 2 코드 공유하기

setup.py 파일 만들기 from distutils.core import setup setup( name = 'nester', version = '1.0.0', py_modules = ['nester'], author = 'misun', author_email = 'xxx@gamil.com', url = 'http://come2misun.tistory.com', description = 'test', ) sdist배포 패키지 만들기 D:\headfirstpython\nester>python setup.py sdist running sdist running check warning: sdist: manifest template 'MANIFEST.in' does not exist (using defaul..

프로그래밍/파이썬 2016. 1. 26. 15:26
[Head First Python] Chaper 1.파이썬과의 첫 만남

Lists are mutable sequences, typically used to store collections of homogeneous items (where the precise degree of similarity will vary by application). 파이썬 리스트 (= 상위수준의 집합체) 특징 파이썬 변수는 식별자를 지정하지 않는다. 파이썬 리스트는 여러 데이터 형을 함께 사용할 수 있다. 중첩 리스트 : 무한 단계까지 리스트 안에 리스트가 들어갈 수 있다. 리스트 내장함수 append extend insert pop remove 참고 44.6.4. Lists Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:38:48) [MSC v.1900..

프로그래밍/파이썬 2016. 1. 25. 14:15
이전 1 다음
이전 다음
최근에 올라온 글
최근에 달린 댓글
TAG
  • OS
  • Eclipse
  • SQLite
  • jQuery
  • Tools
  • Bitcoin
  • WebView
  • Head First jQuery
  • 신문스크랩
  • google I/O
  • 인물
  • html5
  • 오라클
  • 안드로이드
  • IT 신문스크랩
  • Android
  • App Widgets
  • 환경설정
  • Spring 3
  • 애플
  • UML
  • IT
  • oracle
  • Spring
  • 이클립스
  • 블록체인
  • WAC
  • chrome
  • head first python
  • Java
more
Total
Today
Yesterday

Blog is powered by Tistory / Designed by Tistory

티스토리툴바