분류 전체보기
Python | py_basic_week1
- py_basic_week1 [변수 / 리스트 / 딕셔너리 / 조건,반복문 / 함수] 1. [enumerate.py] fruits = ['사과', '배', '감', '귤','귤','수박','참외','감자','배','홍시','참외','오렌지'] for i, fruit in enumerate(fruits): print(i, fruit) if i == 4: break 2. [list_prac.py] 짝수 몇개? num_list = [1, 2, 3, 6, 3, 2, 4, 5, 6, 2, 4] count = 0 for i in num_list : if i % 2 == 0 : count += 1 print(count) 전체 합은? num_list = [1, 2, 3, 6, 3, 2, 4, 5, 6, 2, 4] s..
Python | poo_game.py
[poo_game.py] from selectors import EVENT_WRITE from signal import pthread_sigmask from unittest import runner import pygame import random ################################################################################################################################# # 0.기본 화면 초기화 부분 pygame.init() #초기화 #화면 크기 조정하기 screen_width = 480 screen_height = 640 screen = pygame.display.set_mode((screen_w..
TIL | 8.31.수 [1_mini_project]
- 1_mini_project : html / css + pymongo / Flask 완성 [1,2페이지 방명록 작성 서버에 Data 전송 + 업데이트 된 데이터 3페이지에 업로드] POST 요청 확인 Ajax코드 [1, 2page] : 방명록 작성해서 db에 POST function save_comment() { let name = $('#name').val() let comment = $('#comment').val() $.ajax({ type: "POST", url: "/1_mini_project", data: {name_give: name, comment_give: comment}, success: function (response) { alert(response["msg"]) window.loc..
TIL | 8.30.화 [pymongo / Flask]
- pymongo 1. mongoDB 에 데이터 저장하기 전 필수 요소 from pymongo import MongoClient import certifi ca = certifi.where() client = MongoClient('mongodb+srv://won:sparta@cluster0.4vhehoz.mongodb.net/?retryWrites=true&w=majority', tlsCAFile=ca) db = client.dbsparta 내 맥북에선 보안 오류가 나기 때문에 certifi 패키지 설치 필수 !! (pymongo, dnspython, certifi package) 2. mongoDB 에 데이터 조작 관련 소스코드 # 저장 - 예시 doc = {'name':'bobby','age':21..
TIL | 8.29.월 [Html / CSS / Javascript]
- Html / CSS 👉 기본 CSS 배경관련 : background-color, background-image, background-size 사이즈 : width, height 폰트 : font-size, font-weight, font-famliy, color 간격 :margin, padding 1. 백그라운드 이미지 삽입시 background-image: url(''); background-position: center; background-size: cover; 2. pc 및 모바일 화면 비율 조정 display: flex; flex-direction: column; align-items: center; justify-content: center; - flex-direction : row / c..
Python | memory_game.py
[memory_game.py] from multiprocessing import current_process import re from tabnanny import check import pygame from random import * ################################################################################################################################# # F.전역함수 선언 def setup(level) : global display_time display_time = 5 -(level // 3) display_time = max(display_time, 2) number_count = (l..