본문 바로가기

프로그램&DB

파이썬 Unescape 함수 : Unescape HTML Entities in Python 파이썬 Unescape 함수 : Unescape HTML Entities in Python한시간은 찾아다닌 모양입니다. 드디어 찾았네요.아래쪽 녹색 박스의 스크립트를 사용하시면 됩니다. ^^+집에가자..!! I'm not a programmer, I mean a real programmer. I do hack code sometimes, mostly python, to be able to process files for recurring tasks. I had to read XHTML files to send to an XML parser (ElementTree).This piece of code might be useful for someone and there will be certainly peop.. 더보기
ASP 성능향상을 위한 15계명 ASP 성능향상을 위한 15계명 written by Microsoft translated by Microsoft 1. 애플리케이션 레벨의 파일에 대해서는 GLOBAL.ASA을 이용하라. 파일에서 데이터를 읽기 위해서 일반적인 ASP파일시스템 개체를 이용하지 않고, GLOBAL.ASA를 이용하십시오. GLOBAL.ASA란 이벤트 처리 스크립트나 세션을 가지는 개체들에 대한 정보를 저장하는 옵션 파일입니다. 즉, 애플리케이션 전반에 걸친 이벤트에 대한 정보나 개체를 저장할 수 있는 것으로 사용자에게는 직접적으로 보여지지 않는 일종의 시스템 개체를 말합니다. 그리고 ASP파일시스템 개체 대신 이를 이용하여 데이터를 읽는 방법입니다. GLOBAL.ASA는 시스템 개체이므로 데이터가 일단 이 개체에 저장되었다면 .. 더보기
ASP에서 python 사용하기 ASP에서 python 사용하기 당연히 파이썬이 설치되어 있어야 한다. (PWS)Personal Web Server 혹은 IIS(Internet Information Server)가 설치되어 있어야 한다. win32all을 설치한다. 다음의 링크에서 파이썬 버전에 맞는 win32all을 설치한다. http://aspn.activestate.com/ASPN/Downloads/ActivePython/Extensions/Win32all 혹은 http://starship.python.net/crew/mhammond/win32/Downloads.html 다음과 같이 pyscript.py를 실행시킨다. 파이썬 2.1인 경우는 다음 디렉토리에 있다. (버전에 맞는 python.exe로 실행하는 것을 주의하라). 보안.. 더보기
파이썬 int 정수형을 string 문자열로 변환하는 함수 How to Convert Int to String in Python How to Convert Int to String in PythonBy Veronica Summers, eHow Contributor | updated May 22, 2011When programming in Python, avoid "TypeErrors" by converting an integer to a string. For example, by converting numbers into strings you can easily align the results into a table. Another example is to concatenate a number before a string to enumerate an item. You use the "str" function to convert a.. 더보기
MS-Sql 테이블 및 저장프로시저 목록 가져오기 MS-Sql 테이블 및 저장프로시저 목록 가져오기 1. 테이블 목록 가져오기 select distinct table_name from information_schema.columns 2. 저장프로시저 목록 가져오기 select distinct specific_name from INFORMATION_SCHEMA.PARAMETERS 3. 테이블 컬럼 목록 가져오기 select Column_Name from information_schema.columns where table_name = '테이블명' [출처] http://udt785.tistory.com/50 더보기
파이썬 메일 읽어오기 파이썬 메일 읽어오기[출처] 파이썬 메일 읽어오기|작성자 skyhigh1024 # ============================================================================= # -*- coding: euc-kr -*- # ============================================================================= # Title : Mail 가져오기 # ============================================================================= # 대용량 파일 가겨올때는 오류 발생한다 고쳐보기 귀찮아...# 필요하신분 가져다 사용하세요# 원본 출처 : http://w.. 더보기
파이썬 시작시 처리 사항 파이썬 시작시 처리 사항 1. 이 파이썬 파일이 euc-kr 페이지로 작성된 문서라는 표현 (꼭해줘야 된다.) : reload(sys); sys.setdefaultencoding('euc-kr') 생략 가능하지만 가끔 파일저장시에 가끔 오류 발생 문자 타입 변환시 오류 발생하므로 해주는게 좋다. #------------------------------------------------ # -*- coding: euc-kr -*- #------------------------------------------------import sys reload(sys); sys.setdefaultencoding('euc-kr') [출처] 파이썬 시작시 처리 사항|작성자 skyhigh1024 더보기
날짜시간처리 날짜시간처리[출처] 날짜시간처리|작성자 skyhigh1024 1. 과거 날짜 구하기 #!/usr/bin/python #! -*- coding: euc-kr -*- #! ------------------------------------------------ import os import time from datetime import * #현재 날짜를 구한다. tempDate = datetime.today() # 2일전날짜와 시간을 가져온다. tempTargetDate = tempDate - timedelta( days=2 )2. 오늘 년월일가져오기 (20110928) sCurrDate = time.strftime("%Y%m%d", time.localtime(time.time())) "%Y%m%d%H%M%S.. 더보기