객체

    [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 ..