>> import py_compile
>> py_compile.compile('test.py')
>> quit
'CODE 작성 요청' 카테고리의 다른 글
[CODE] 하위디렉토리 리스트 구하기 (1) | 2012.10.19 |
---|---|
[서버의 hostname을 가져오는 코드를 만들어주세요] (0) | 2012.09.24 |
>> import py_compile
>> py_compile.compile('test.py')
>> quit
[CODE] 하위디렉토리 리스트 구하기 (1) | 2012.10.19 |
---|---|
[서버의 hostname을 가져오는 코드를 만들어주세요] (0) | 2012.09.24 |
너무 간단한가요??
import socket
socket.gethostbyname(socket.getfqdn())
[CODE] 파이썬 외부 명령어 설행(subprocess) (0) | 2012.10.04 |
---|---|
[CODE] 파이썬 외부 명령어 설행(os.system) (0) | 2012.10.04 |
[CODE] 현재 사용중인 interface name 가져오기 (0) | 2012.09.27 |
[CODE] Port Scanner 예제 (0) | 2012.09.26 |
[CODE] TKINTER 메뉴 만들기 (0) | 2012.09.24 |
import commands
ETHER_NAME=0
HEADER=2
result=commands.getoutput('netstat -ni').split('\n')[HEADER:]
ether_name=[]
for line in result:
ether=line.split()[ETHER_NAME]
if ether != 'lo':
ether_name.append(ether)
print ether_name
['eth0', 'eth1']
[CODE] 파이썬 외부 명령어 설행(os.system) (0) | 2012.10.04 |
---|---|
[CODE] host에 할당된 기본 IP 찾아내기 (0) | 2012.09.27 |
[CODE] Port Scanner 예제 (0) | 2012.09.26 |
[CODE] TKINTER 메뉴 만들기 (0) | 2012.09.24 |
[CODE] 시스템 정보 가져오기 (0) | 2012.09.24 |