본문 바로가기

분류 전체보기94

[Python] 3장 input(), split(), map(), sep(), end(), string 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119#개념#split함수 사용하여 값 나눠 변수에 저장a, b = input('숫자 두 개를 입력하세요(' '): ').split() #10 20 입력, 공백을 기준으로 값을 나눔.print(a+b) #1020 ->문자열이기 때문. a,b = input('숫자를 두개를 .. 2020. 12. 6.
[Python] 2장 Variables and data types 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859#개념print(3*3*3*3) #81print(3**4)    #81print(7/2)     #7나누기 2의 몫 -> 실수형으로 출력. (3.5)print(7//2)    #7나누기 2의 몫 -> 정수형으로 출력. (3)print(7%2)     #7나누기 2의 나머지 (1)quotient, remainder = divmod(7,2)print(quotient, remainder) # 몫, 나머지 a = 1a += 1 #증가 연산a -= 1 #감소 연산 #-------------------------------.. 2020. 12. 6.
[Flask] SQLAlchemy 사용하여 학생테이블 출력하기 app.py파일을 실행하면 student_info.db 파일이 생성된다.     12345678910111213141516171819202122!DOCTYPE html>html>   body>      h3>Students - Flask SQLAlchemy example/h3>      hr/>      form action = "{{ request.path }}" method = "post">         label for = "name">Name/label>br>         input type = "text" name = "name" placeholder = "Name" />br>          label for = "city"">City         text" name = "city" pl.. 2020. 11. 25.
[Flask] 로그인 페이지, 로그인 성공 시 flash 메시지 출력하기 123456789101112131415161718192021!doctype html>html>   head>      title>Flask Message flashing/title>   /head>   body>        {% with messages = get_flashed_messages() %}         {% if messages %}            ul>               {% for mes in messages %}               li>{{ mes }}/li>               {% endfor %}            /ul>        {% endif %}        {% endwith %}                h1>Flask Message .. 2020. 11. 25.
[HTML] <ul> / <ol>, <li> , <i>, <b> 태그 1234567891011121314!DOCTYPE html>head>    meta charset="UTF-8">/head>body>    h2>식물원 관람 유의사항/h2>        ul>            li>i>입장권/i>에 게시된 b>관람요령/b>을 살펴보시기 바랍니다./li>            li>안내원의 안내에 따라주시기 바랍니다./li>            li>관람 지역 이외의 출입제한 지역은 출입을 금합니다./li>            li>식물이 삭제된 곳에 들어가지 마십시오./li>        /ul>/body>/html>Colored by Color Scripter 1234567891011121314!DOCTYPE html>head>    meta charset="UTF-.. 2020. 11. 24.
[HTML] <br>, &nbsp, &lt, &gt, &amp, &quot, &copy 1234567891011121314151617!DOCTYPE html>head>    meta charset="UTF-8">    title>제목 연습/title>/head>body>    안녕하세요.br>    반갑습니다.br>    열심히 HTML을 &nbsp;&nbsp;&nbsp;&nbsp;공부합시당 :) br>br>         br>&lt; 내용 &gt;     br> &amp;    br> &quot; 안녕!! &quot;    br> &copy;/body>/html>Colored by Color Scripter 2020. 11. 24.
[HTML] 제목 연습 : <h1> ~ <h6> 태그 1234567891011121314!DOCTYPE html>head>    meta charset="UTF-8">    title>제목 연습/title>/head>body>    h1>글자 제목/h1> 가 자동으로 됨.-->    h2>글자 제목/h2>    h3>글자 제목/h3>    h4>글자 제목/h4>    h5>글자 제목/h5>    h6>글자 제목/h6>/body>/html>Colored by Color Scripter 2020. 11. 24.
[Flask] input값에 따라 Pass, Fail 문자 출력하기 12345678910!doctype html>html>   body>      {% if marks>50 %}         h1> Your result is pass!/h1>      {% else %}         h1>Your result is fail/h1>      {% endif %}   /body>/html>   123456789from flask import Flask, render_templateapp = Flask(__name__) @app.route('/input/')def input_name(score):   return render_template('result.html', marks = score) if __name__ == '__main__':   app.run(host='0.. 2020. 11. 24.
[Python] 삼각형 넓이 구하기 123456width = int(input('width: '))height = int(input('height: ')) area = width * height / 2 # /는 소수점, //는 정수형으로 계산함. print('area: ', area) 2020. 11. 23.
[Python, OpenCV] 두 개의 이미지 파일 합성하기 12345678910111213141516171819202122232425262728293031# apple.jpg 그림에 opencv_logo 그림을 Mask_inverse하여 합성. import cv2import numpy as np src1 = cv2.imread('../data/apple.jpg') #사과파일 읽기src2 = cv2.imread('../data/opencv_logo.png') #로고파일 읽기 rows, cols, channels = src2.shape #로고파일 픽셀값 저장roi = src1[50:rows+50,50:cols+50] #로고파일 필셀값을 관심영역(ROI)으로 저장함. gray = cv2.cvtColor(src2, cv2.COLOR_BGR2GRAY) #로고파일의 색상을.. 2020. 11. 11.