분류 전체보기
-
함수 정리.파이썬/기초 2020. 11. 15. 11:51
1. random함수 from random import * print(int(random() *10)+1) 10이하의 자연수를 뽑을때 위처럼 사용. (int를 제외하면 소수점까지 보고 * 뒤의 숫자로 나올 숫자를 만들 수 있다.) 2.문자열 함수 st = "My name is abcde" print(st.lower()) #소문자 print(st.upper()) #대문자 print(st[0].isupper()) #대문자 여부 print(len(st)) # 길이 print(st.replace("abcde","Woo")) # 문구 바꾸기 index = st.index("a") #a의 index찾기 print(index) index = st.index("a",index +1) #2번째 a의 index찾기 pri..
-
1. 파이썬 기초 문법파이썬/기초 2020. 11. 8. 13:24
1. 자료형 문법 (연산자) 🎃나누기. / = 소수점까지 나온다. // = 몫만 나온다. % = 나머지가 나온다. 🎃 곱하기 2 * 3 = 6 ( 2* 3) 2 ** 3 = 8 ( 2 * 2 * 2) 2. 변수 위 그림과 같이 파이썬은 값을 기준으로 타입이 결정되고 문법이 끝날때 ;를 붙이지 않는다. 그리고 int형과 boolen형 같은 경우 str함수를 이용해서 형변환을 시켜줘야지 에러가 뜨지 않는다. str함수를 사용하고 싶지 않은 경우 + 대신에 ,를 붙여서 쓰면 str 함수를 사용 안해도 된다. 대신 한칸씩 자동으로 띄어 쓰게 된다. 3. 주석처리 ctrl + / 하면 드래그 한쪽이 전부 주석 처리 된다. (# 주석으로) 4.문자열 다루기. 문자열 자유롭게 자를 수 있다. 5.탈출 문자 # \n ..
-
02.세션을 이용한 로그인.스프링 웹 개발 하기/로그인 처리 2020. 2. 9. 17:21
보기전에 스프링 구조(2)를 참조. Session은 서버에 어떤 값의 정보를 저장해서 해당 정보를 사용하는 방법입니다.(로그인 같은 경우 사용자 정보.) 그렇기 때문에 브라우저를 닫으면 세션이 끊겨서 해당 정보가 지워지게 됩니다. 1.Mapper 만들기 1 2 3 4 5 6 7 8 9 10 11 select * from tbl_member where key = #{key} and pw = #{pw} and interlock_type = 'main' 2.TEST 쿼리 1 2 3 4 insert into tbl_member (key,pw,name,email,nickname,auth,interlock_type,regdate) values ('admin','1234','전승우','aa@naver.com','wo..
-
01. 로그인 만들기(DB 만들기)스프링 웹 개발 하기/로그인 처리 2020. 2. 9. 16:56
1.테이블 만들기 쿼리는 postgresql 입니다. 하지만 다른 쿼리도 크게 다르지 않으니 사용하시는 데에는 크게 문제가 없을 거 같아요. 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 -- 테이블 생성 create table tbl_member( key varchar(80), nickname varchar(50) PRIMARY KEY, pw varchar(100), name varchar(80) not null, email varchar(200) not null, phoneNumber int, birthday int, gender varchar(3), auth int not null, sessionkey varchar(50)..
-
-
0.스프링 구조 설명.스프링 웹 개발 하기/스프링 개발 초기 설정. 2020. 1. 27. 16:31
실제 프로젝트에 사용할 JAVA 1.8,Tomcat 7 ,DB PostgresSql(설정은 오라클 Mysql 포함.) 1. 스프링 구조. 스프링 구조는 기본적으로 MVC 디자인 패턴 구조로 되어 있다. (M)odel(객체) (V)iew(화면) (C)ontroller(조작) 으로 나누는 방식이다. 하지만 같은 MVC 지만 다양한 방식으로 구조를 잡기 때문에 어떤 분은 controller 대신 servlet ,VO 대신 Bean으로 잡으시는 분 들고 있고 다양하다. 그러기 때문에 이건 제가 자주쓰는 구조일 뿐 자기한태 맞는 구조를 찾는 것도 좋은 방식으로 생각하고 있습니다. .jsp 는 화면에 보여주는 역할을 한다. .xml 은 주로 설정 관련된 역할을 한다. .java 는 데이터를 가공하고 DB와 연결을 ..