본문 바로가기

개발/PYTHON13

mysql 접속 여기저기 찾아 헤맨 결과,mysqlclient-1.3.7-cp35-cp35m-win_amd64.whl 파일을 다운로드 받아서 설치하면 된다는 것을 찾았습니다. cp 다음 숫자는 python 버전이고, win32로 끝이나면 32bit, amd64로 끝나면 64bit입니다. 각자의 컴퓨터 환경에 적합한 파일을 다운로드 받아서 사용하시면 되겠습니다.주의할 점은 해당 파일이 존재하는 위치에서 설치명령을 실행하는 것이 아니라면 파일이 있는 폴더 경로도 정확히 입력해줘야 합니다. 그리고,아래의 코드를 작성해서 실행했을때 정상 출력이 되면 설치가 잘 된 것입니다.import MySQLdb # Open database connection db = MySQLdb.connect("localhost","userid","pa.. 2017. 6. 30.
python 웹크롤링 Why only 5 libraries?There are dozens of packages for web scraping out there... but you only need a handful to be able to scrape almost any site. This is an opinionated guide. We've decided to feature the 5 Python libraries for web scraping that we love most. Together, they cover all the important bases, and they are well-documented.Do I need to learn every library below?No, but everyone will ne.. 2017. 6. 28.
print newline 넘어가지 않게 ... >>> for i in range(10): ... print i, ... else: ... print ... 0 1 2 3 4 5 6 7 8 9 >>> 출처 : http://stackoverflow.com/questions/493386/how-to-print-without-newline-or-space 2017. 2. 15.
flatMap Stream.flatMap, as it can be guessed by its name, is the combination of a map and a flatoperation. That means that you first apply a function to your elements, and then flatten it. Stream.maponly applies a function to the stream without flattening the stream.To understand what flattening a stream consists in, consider a structure like [ [1,2,3],[4,5,6],[7,8,9] ] which has "two levels". Flattenin.. 2017. 2. 13.