태그 : python 요약보기전체보기목록닫기
- Windows, UNIX 간 text file format 변환하기(0)2009.03.17
- 용어 정리(0)2009.03.17
- encodeURI(0)2009.03.14
- [python] sum() 가변인수(0)2009.03.06
- [python] List Comprehension(리스트 내장)(0)2009.03.06
- [python] sort(0)2009.03.06
- [python] join(0)2009.03.06
1
- tip&tech
- 2009/03/17 14:42
FTP는 ASCII 모드로(Binary mode로 올렸다가 cgi 에러 나서 삽질..),
Notepad++ 에 Format > Convert to UNIX Format 메뉴도 있다.
나머지는 아래 링크 참조.
How do I convert between Unix and Windows text files?
WSGI - Web Server Gateway Interface
PEP - Python Enhancement Proposals
javascript의 encodeURI()
python은 urllib.quote()
javascript
url = "http://localhost/search?q="+encodeURI(q);
python
import urllib
url = "http://localhost/search?q="+urllib.quote(q)
- tip&tech
- 2009/03/06 15:21
넘겨준 값을 모조리 더한다. 갯수에 상관없이
>>>sum(1,2)
3
>>> sum(1,2,3,4)
10
def sum(*args): s = 0 for x in args: &nbs...
- tip&tech
- 2009/03/06 10:16
s = ' first item : second item : third item '
공백을 없애고, ':' 기준으로 분리하여 리스트로 만들기
L = ['first item', 'second item', 'third item']
>>> L = [x.strip() for x in s.split(':')]
s.split(':')&...
- tip&tech
- 2009/03/06 10:01
대소문자 구분없이 sort 하려면?
s1 = ['Spam', 'egg', 'Ham']
>>>s1. sort() # 대문자 먼저 나온다.
['Ha...
- tip&tech
- 2009/03/06 09:35
S = 'Sometimes I feel like a motherless child'
가) 단어의 순서 바꾸기 : 'child motherless a like feel I Sometimes'
' '.join(S.split(' ')[::-1])
>>>S.split(' ')
['Sometimes', 'I', 'fee...
1



최근 덧글