본문 바로가기

파이썬

(4)
[Python/ Anaconda] Ubuntu 20.04 Anaconda 설치 및 Python 가상환경 설정 하기 Ubuntu 20.04 환경에서 Anaconda 를 설치하고 이를 이용해 python 가상환경을 설정하는 방법입니다. Anaconda 설치 # user 홈 directory 로 이동 $ cd # anaconda 설치 파일 불러오기 $ wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh 위 처럼 wget 명령어로 설치 파일을 불러와도 되고, 아래 홈페이지에 직접 들어가서 원하는 버전의 anaconda 리눅스 installer를 찾아서 설치하는 방법도 있습니다. https://www.anaconda.com/products/individual/download-success Anaconda | Get Started Anaconda i..
[Python] OS, CPU 갯수 등 컴퓨터 정보 불러오기 python 으로 프로그램을 짜다 보면, 현재 host 기기의 정보가 필요할 때가 있다. 이럴 때 쓰면 좋은 함수들을 모아보았다. import os , platform , socket print(os.cpu_count()) # cpu 갯수 : 8 print(platform.system()) # os 이름 : Linux print(platform.processor()) # processor 종류 : x86_64 print(platform.version()) # 44~18.04.2-Ubuntu SMP Thu Apr 23 14:27:18 UTC 2020 print(socket.gethostname()) # host 이름 : 대략 이런 종류의 함수들이 있다.
[Python] SW Expert Academy 5189번 문제 (완전탐색, DFS) ---문제--- [파이썬 S/W 문제해결 구현]2일차 - 전자카트 ---코드--- def dfs(j): global sub_result, result, n if len(visited) == n: sub_result+=number[j][0] if(result
[Python] SW Expert Academy 5188번 문제 (완전탐색, DFS) ---문제--- [파이썬 S/W 문제해결 구현]2일차 - 최소합 ---코드--- def dfs(y,x): global sub_result, result if result < sub_result: return if y == n-1 and x == n-1: result = sub_result return for d in range(2): y_tmp = y + dy[d] x_tmp = x + dx[d] if(y_tmp

728x90
반응형