[Python] 사전

dic1 = {“item1” : “123”, “item2” : 456, “item3” : “data”}dic2 = {}   #빈 사전 생성dic3 = dict()   #빈 사전 생성dic1[“item4”] = “data2” #키 추가del dic1[“item3”]       #키 삭제if “item2” in dic1:     #사전에 해당 키가 있는지 확인    i=dic1[“item2”]else:    i=0j=dic1.get(“item2”,0)   #위 if 문과 결과 동일keys=list(dic1) #키 목록 추출

[Python] 리스트

list1 = [“123″,”456″,”abc”]list1[0] #색인은 0부터 (0~2)list1.append(“new data”) #새 항목 추가list1.insert(1,”ins”) #idx 1위치에 항목 추가list1[1:2] #idx 1부터 idx 2 이전까지 (idx 1만 출력)list1[1:] #idx 1부터 끝까지list2=[] #빈 리스트 생성list3=list() #빈 리스트 생성

[Python] 반복문

data1 = range(1,10) #1~9의 값을 가지는 리스트 생성data2 = 0for i in data1:    print iwhile data2 < 10:    data2+=1    if data2 % 2:        print data2,    #홀수면 출력    else:        continue    #짝수면 아래 구문 무시하고 반복문 다시 진행    if data2 == 7:      ... Read more

[Python] 조건문

#조건문a=1b=2c=3d=4s=”show me the money” x=[1,2]y=[1,2]if a < b:    print “bbbb”elif b < a:    print “aaaa”else:    print “aabb”if a < b and b < c and not (d < c):    print “dddd”if “money” in s: # 좌측 문자열이 우측 문자열 또는 객체에 포함되어있는지 확인    print “money in string”if x is y:   ... Read more

[Python] 입출력 (stdin, stdout)

import sysi=0.5353s=”text”t=sys.argv[0]   #명령줄 인수를 읽어옴print “Hello World %.2f %d” % (i,2016)# 파이썬 3에서는 print 다음에 ()가 들어감 ex: print(“Hello World %.2f %d” % (i,2016))print “file name is %s” % (t)print format(i,”10.2f”),format(s,”20s”),”123″   #format 함수의 2번째 인자는 포맷지정자sys.stdout.write(“input : “)t=sys.stdin.readline()print tt= raw_input(“input : “)  # input(“input : “) #파이썬3print t

VBScript shell.run

shell.run strCommand, [intWindowStyle],[bWaitOnReturn] -strCommand : 실행할 명령 -intWindowStyle : 윈도우 스타일의 Int 값 -bWaitOnReturn : 스크립트를 계속 실행하기 이전에 명령이 완료되기를 기다릴지 여부의 boolean 값 Window Style value description 0 Hide the window and activate another window 1 Activate and display the window. (restore size and position) Specify this flag when displaying a window for … Read more

VBScript CreateTextFile 함수

object.CreateTextFile(filename[,overwrite[,unicode]])   -filename : 생성할 파일 경로 및 파일명 -overwrite : 기존에 파일이 존재할 겨우 덮어 쓸지 여부로 Boolean 값을 가진다. -unicode : 파일을 Unicode로 생성할지 여부로 Boolean 값을  가지며 false의 경우 ASCII로 생성된다.  

VBScript 파일 객체 속성 값

Constant Value Description Nomal 0 Nomal file. No attributes are set ReadOnly 1 Read only file. Attribute is read/write Hidden 2 Hidden file. Attribute is read/write System 4 System file. Attribute is read/write Volume 8 Disk drive volume label. Attribute is read only Directory 16 Folder or directory. Attribute is read only Archive 32 File … Read more

2011.09.30 Tacademy 안드로이드 10일차 메모

우리나라의 mms는 현재 세계 표준과 다르다. 요즘은 보안 문제로 제조사에서 sms 컨텐츠 프로바이더로의 접근을 막고 있다. Thinking in java 4/e 자바 고급 배터리 상태 접근은 BATTERY_STATS 퍼미션 필요 매니페스트 파일의 uses-feature 에 설정된 기능을 지원하지 않는 경우 설치가 되지 않도록 해줌 멀티미디어 prepare 동기식 prepareSync 비동기식 이미지버튼은 클릭 이벤트 보다는 터치 이벤트가 감지가 잘 된다.
바로가기