일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- cpp
- baekjun
- codesingal
- matrixElementsSum
- 2015 봄학기 알고리즘
- Python
- shapeArea
- centuryFromYear
- codesignal
- collections.deque
- 백준
- Numpy
- 파이썬머신러닝완벽가이드
- adjacentElementsProduct
- recursion
- 피보나치 수
- Sequential Search
- Counting cells in a blob
- 수 정렬하기
- 파이썬 포렌식
- til
- almostIncreasingSequence
- Daily Commit
- 10953
- flask
- C++
- data_structure
- All Longest Strings
- markdown
- 2750
- Today
- Total
목록Doing 80
Introfor

1. installation py -3 -m pip install flask 2. Creating web app object and url from flask import Flask app = Flask(__name__) # Flask 객체의 인스턴스를 만들고 'app'에 할당. # __name__은 파이썬 인터프리터에서 제공하는 값으로 현재 활성 모듈의 이름을 포함. @app.route('/') # @는 장식자로 함수나 클래스에 사용되는데 주로 함수에 사용된다. # 함수 장식자는 함수 코드를 바꾸지 않고도 함수의 동작을 조절 # app 변수를 이용해 플라스크의 route 장식자를 이용할 수 있다. # route 장식자는 플라스크 서버로 '/'URL 요청이 들어왔을 때 어떤 함수를 호출할 것인지 조정. ..
자신이 만든 모듈을 사용하려면 모듈이 있는 디렉터리에서 작업을 하거나 사이트 패키지에 모듈을 설치하는 것이다. 사이트 패키지에 모듈을 설치하는 방법은 모듈을 배포할 때 사용하는 방식과 동일하다. 1. 배포 설명 만들기 기존에 만든 py파일이 있고, 그것을 배포 파일로 만들기 위해 setuptools를 사용 name - 파일명을 적음 py_modules - 패키지에 포함할 '.py' 파일 목록 from setuptools import setup setup( # name - 배포 파일 식별 # py_modules - 패키지에 포함할 '.py' 파일 목록 name = 'vsearch', version = '1.0', description = 'nope', author = 'nope', author_email ..
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758nums = [1,2,3,4]print(nums) nums.remove(3)print(nums)# remove(객체):객체의 값을 인자로 받음. 리스트에 있는 객체이 remove의 인자값과 동일 시 제거하고, 리스트 크기를 1 감소 nums.pop()print(nums)print(nums.pop(0))print(nums)# pop(인덱스):인덱스 값을 인자로 받음. 인덱스 값을 통해 리스트에 객체를 삭제하고, 그 값을 반환.# 인덱스 값이 없을 시 마지막 객체를 삭제&반환 print(nums.extend([3,4])..
12345678910111213141516171819def classification(test): standard, rest = int(7/len(test)), 7%len(test) for i in range(standard): # enumerate 리스트가 있는 경우 순서와 리스트의 값을 전달하는 기능 # for j, name in enumerate(patroller): # # print(j,name) enumerate 값을 보여줌 # print(j, name) for j, name in enumerate(test): print(j,name) if i==1 and j == 2 : l1 = list(enumerate(test)) print(l1[rest-1][rest-1],l1[rest-1][rest])..
요셉의 문제 :A부터 J까지의 10명의 사람이 시계 방향으로 순서대로 원을 지어 앉아 있다고 하자. 이때 A부터 시작하여서 4명 간격으로 사람을 그 원에서 뽑아낸다고 하면 그 순서는 어떻게 될 것인가? 결과 : A, E, I, D, J, G, F, H, C, B 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061#include #include typedef struct _node { int data; struct _node *next;} node; node *head; void insertNodes(int k) { node *t; int i; t = (n..
12345678910111213141516171819202122232425262728293031323334353637383940414243#include int max(int x, int y){ return (x>y)? x:y;} int matrixPath(int arr[][4], int i, int j, int *cnt) { if(i==0 && j==0) return arr[0][0]; else if(i==0){ // printf("(((%d,%d)))\n",i,j); return (arr[0][j]+ matrixPath(arr, 0, j-1, cnt)); } else if(j==0){ // printf("((%d,%d))\n",i,j); return (arr[i][0]+ matrixPath(arr, ..
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101#include#include #define FALSE 0#define TRUE 1 int n = 10;int w[3][10] = {0}; int Weight(int k, int p) { if (p
The way most people learn to multiply large numbers looks something like this: 86 x 57 ------ 602 + 4300 ------ 4902If you know your multiplication facts, this "long multiplication" is quick and relatively simple. However, there are many other ways to multiply. One of these methods is often called the Russian peasant algorithm. You don't need multiplication facts to use the Russian peasant algor..
123456789101112131415#include int main() { int num = 0; int fibo = 0, fibo1 = 0, fibo2 = 1; scanf("%d",&num); for(; num>0; num--){ printf("%d ",fibo); fibo = fibo2; fibo2 += fibo1; fibo1 = fibo; }}Colored by Color Scriptercs 12345678910111213141516171819202122232425#include int f(int n); int main(){ int num = 0; scanf("%d ",&num); for(int i = 0 ; i
1234567891011121314151617181920#include void hanoi(int n, int from, int by, int to){ if (n == 1) printf("\nMove from %d to %d", from, to); else{ hanoi(n - 1, from, to, by); printf("\nMove from %d to %d", from, to); hanoi(n - 1, by, from, to); }} int main(void){ int i = 3; hanoi(i, 1, 2, 3); return 0;}Colored by Color Scriptercs