파이썬
[Python web] 5. Template(), ajax() html글 객체 가져오기 (Brython)
1.Brython document 속성 표 함수 설명 예제 Template() html글 안의 {}로 묶인 객체를 변환할수 있다 Template(document['아이디']).render(name='글에{여기부분} 이름입력') ajax() web 상의 정보를 가져오고 불러올 수 있다 req = ajax.ajax() req.open('GET', url, True) req.bind('complete', 실행함수) json web의 text 정보를 분석 추출하는데 사용한다 data = json.loads(req.responseText) targettext = data['특정속성'] set_timeout() sleep을 사용할 수 없어 대신 사용한다 timer.set_timeout(실행함수, 3000) 2. 실..
[Python web] 4. document 사용법 객체 불러오기 (Brython)
1.Brython document document는 DOM 기본적인 것을 모두 수용하며 document.select( '객체 속성 + 객체 이름')으로 불러올수도 있다 속성 표 속성 속성기호 예제 tag 없음 div class . .class_element id # #id_element tag+tag [] div[h1] tag+element 기호 div.class_element 불러온 객체는 리스트 형태로 되어있어 원하는 객체를 선택해 추출해야한다 2. 실행 1. 간단한 실행 방법 3. 파일구조 Folder─┬─ index.htm ├─ style.css └─ script ─┬─ brython.js ├─ brython.min.js ├─ brython_stdlib.min.js └─ python.py tag ..
[Python web] 3. 특성 (이벤트) 적용해보기(Brython)
1.계산기 만들기 간단한 계산기를 만드는 예제이다 2. 실행 1. 간단한 실행 방법 3. 파일구조 Folder─┬─ index.htm ├─ style.css └─ script ─┬─ brython.js ├─ brython.min.js ├─ brython_stdlib.min.js └─ python.py *{ font-family: sans-serif; font-weight: normal; font-size: 1.1em; } td{ background-color: white; padding: 10px 30px 10px 30px; border-radius: 0.2em; text-align: center; cursor: default; } #result{ width:200px; border-color: #000..
[Python web] 2. Brython DOM 객체 가져오는 방법(Brython)
1. Brython DOM Brython 에서는 간단한 방법으로 객체를 가져오고 사용하는 방법을 제공하고 있다 변화주려는 객체
[Python web] 1. 웹 만들기 (Brython)
1.Brython brython에 관한 사이트다 brython.info/index.html Brython Muy cierto que has visto relojes de este tipo en demos de HTML5. Pero, mira el código fuente de esta página... No hay lineas de Javascript, es puro código Python dentro de un script de tipo "text/python". Brython es diseñado para remplazar a JavaScript brython.info 2. 실행 1. 간단한 실행 방법 3. 파일구조 Folder─┬─ index.htm ├─ style.css └─ script ─┬─..