Read File #r,w,rb,wbf=open(filename,'r') #read all Stringfile=f.read() #read lineline=f.readline() #print 5 line for i in range(5):print line #get line examplewith open('somefile') as openfileobject: for line in openfileobject: do_something() Modify Filefile_data=[] with open(file_name,'r+') as file: del file_data[:]for line in file:file_data.append(line.replace("aaaa","bbbb"))file.seek(0)file.w..
python 문자열 수정 a.strip() : 문자열 a의 양쪽 공백을 지운다. a.lstrip() : 문자열 a의 왼쪽 공백을 지운다.a.rstring() : 문자열 a의 오른쪽 공백을 지운다. a.replace(s , r) : s를 r로 바꾼다. a.split(s) : 문자열 a를 s를 구분자로해서 나눠준다. 문자열 함수ord() 아스키 문자를 아스키 코드 번호로 변환해주는 함수이다. 예를 들어 ord("a") 라면 a의 아스키 번호에 해당하는 97을 반환한다. chr()숫자를 다시 문자열로 바꿔준다. 문자열 탐색 find offset = a.find(string) 리턴 -1 : 발견하지 못함 발견하면 해당 부분의 오프셋을 반환 문자열 비교 string == stirng 형식으로 비교하면 끝이다. B..
foreach문 위의 예제를 설명드리면 먼저 Get-Serivce 명령어를 이용해서 모든 Service를 받아오며 자동으로 배열로 service 변수에 들어갑니다. 그 이후 service 라는 변수에 services 로부터 하나씩 받아와서 write를 합니다. 출력 결과는 모든 service가 되겠습니다. for문사실 상 C와 동일하다고 볼 수 있습니다. -lt 옵션에 대해서는 이 글을 참조 부탁드립니다. while 문 while(){ } http://oulth.tistory.com/110
기본적인 switch 일단 기본적인 switch 문입니다. C를 하셨다고 가정하고 금방 이해하실 것이라고 봅니다 ㅋㅋ $computername = read-host 'Enter computer name'switch($computername){'com1'{write "aaaa"}'com2'{write "bbbb"}default {write 'cccc'}} wildcard switch 두 번째는 와일드 카드를 옵션을 넣은 swtich 문입니다. * 의 의미는 대부분 아실 것이라 생각됩니다. 간단히 모든 것이라는 의미인데wildcard 옵션을 주고나서 *을 붙여주면 aaa로 시작되는 모든 것을 case로 인식합니다. $computername = read-host switch -wildcard($computer..
- Total
- Today
- Yesterday
- DriverEntry
- 루트킷
- 디바이스
- 드라이버
- Intel
- VMware
- gdb 명령어
- 변환
- BP
- 리눅스 모듈
- gdb intel 변환
- module
- rootkit
- backdoor
- gdb intel
- GDB
- vmware cannot connect to the virtual machine
- 모듈
- IRP
- PNP 드라이버
- gdb명령어
- breakpoint
- LKM
- 백도어
- vmware 오류
- 레거시 드라이버
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |