python

"""oracle_config.pyOracle 데이터베이스 서버에 접속(로그인)하기 위해 필요한 정보들을 정의""" # 사용자 이름 user = 'scott' # 비밀번호 pwd = 'tiger' # 데이터베이스 서버 주소: DSN(Data Source Name) dsn = 'localhost:1521/orcl' >>Oracle 데이터베이스 서버에서 select 구문 실행, 결과 확인현재 프로젝트 디렉토리 상태 # 사용자가 입력한 문자열에 따옴표(')나 큰따옴표(")가 포함되어 있는 경우# SQL 에러가 발생할 수 있으므로 권장되지 않음.# -> Data Binding 방법을 권장. import cx_Oracleimport lec08_database.oracle_config as cfg with cx_O..
"""oracle_config.pyOracle 데이터베이스 서버에 접속(로그인)하기 위해 필요한 정보들을 정의""" # 사용자 이름 user = 'scott' # 비밀번호 pwd = 'tiger' # 데이터베이스 서버 주소: DSN(Data Source Name) dsn = 'localhost:1521/orcl' >>Oracle 데이터베이스 서버에서 select 구문 실행, 결과 확인현재 프로젝트 디렉토리 상태 >>Insert 구문 실행하기 import cx_Oracleimport lec08_database.oracle_config as cfg # database server와 연결 설정with cx_Oracle.connect(cfg.user, cfg.pwd, cfg.dsn) as connection: ..
# plotting을 위한 패키지 임포트import matplotlib.pyplot as plt # 친구 수friends = [70, 65, 72, 63, 71, 64, 60, 64, 67]minutes = [175, 170, 205, 120, 220, 130, 105, 145, 190] plt.scatter(friends, minutes)plt.title('Minutes vs Friends')plt.xlabel('# of Friends')plt.ylabel('average time(minutes)')plt.show() friends = [70, 65, 72, 63, 71, 64, 60, 64, 67]minutes = [175, 170, 205, 120, 220, 130, 105, 145, 190]lab..
"""oracle_config.pyOracle 데이터베이스 서버에 접속(로그인)하기 위해 필요한 정보들을 정의""" # 사용자 이름 user = 'scott' # 비밀번호 pwd = 'tiger' # 데이터베이스 서버 주소: DSN(Data Source Name) dsn = 'localhost:1521/orcl' >>Oracle 데이터베이스 서버에서 select 구문 실행, 결과 확인현재 프로젝트 디렉토리 상태 for 변수 in 커서: 실행문for-in 구문에서 cursor.fetchone()의 결과를 변수에 전달 import cx_Oracleimport lec08_database.oracle_config as cfg # connection 설정connection = cx_Oracle.connect(cf..
Codezoy
'python' 태그의 글 목록 (10 Page)