본문 바로가기
728x90

프로그래밍99

파이썬 운영체제(os) 확인하기 파이썬에서 실행하는 운영체제를 확인할수있다 아래코드를 이용하면 된다. import platform print(platform.system()) 윈도우 일 경우 => Windows 리눅스 일 경우 => Linux 로 확인 할 수 있다. 2023. 2. 4.
php 오라클 데이터 조회시 오류 해결 php에서 일반적인 db 조회시 HTML 테이블을 이용하여 보여줄때 $row를 td 안에 넣으면 나오지만 오라클은 조금 다른 조건 이 있습니다 아래 사진처럼 값이 나오지 않는 경우가 있습니다 그건 빨간네모박스처럼 컬럼값을 소문자로 입력했을 경우 값이 보이지 않습니다 $row['MEMO'] 로 대문자로 했을때만 제대로 데이터가 조회 됩니다 또는 첫번째 값처럼 SQL조회된 컬럼 순서로 넣어도 됩니다 예를 들어 select id,name,pw from user 의 sql 조회값을 할때는 $row['0'] 의 값은 id $row['1'] 의 값은 name $row['2'] 의 값은 pw 이며 0부터 순서대로 라고 생각하면 됩니다. 이거 해결한다고 몇일걸렸네요;; 324 2023. 1. 28.
파이썬 오라클 연결 코드 Python oracle example 파이썬 오라클 연결 코드 입니다 import cx_Oracle # Connect to the database connection = cx_Oracle.connect("username", "password", "host:port/sid") # Create a cursor cursor = connection.cursor() # Execute a query cursor.execute("SELECT * FROM employees") # Fetch all the rows rows = cursor.fetchall() # Loop through the rows for row in rows: print(row) # Close the cursor and connection cursor.close() connection... 2023. 1. 22.
파이썬 테트리스 코드 Python Tetris game example 파이썬 테트리스 코드 입니다 import pygame # Define some colors BLACK = (0, 0, 0) WHITE = (255, 255, 255) # This class represents the individual blocks that make up a tetromino class Block(pygame.sprite.Sprite): def __init__(self, color, width, height): super().__init__() self.image = pygame.Surface([width, height]) self.image.fill(color) self.rect = self.image.get_rect() # This class represents the tetromin.. 2023. 1. 22.
728x90