powershell(ubuntu version)에서 python 호출하기
powershell(ubuntu version)에서 python 호출하기 1. class1.py #!/usr/bin/python3 import json # Define a class with a method that returns JSON class returnsjson: def method1(this): return json.dumps(['foo', { 'bar': ('baz', None, 1.0, 2), 'buz': ('foo1', 'foo2', 'foo3') }, 'alpha', 1,2,3]) c = returnsjson() print (c.method1()) 2. class1.ps1 # # Wrap Python script in such a way to make it easy to # consum..
2016. 8. 22.
file write ][ 랜덤하게 파일을 생성해서 임의 데이터 쓰기
file write ][ 랜덤하게 파일을 생성해서 임의 데이터 쓰기 import random data = "00000000" ascii_str1 = ['a', 'b', 'c', 'd', 'e' , 'f' , 'g' ,'h' , 'i' , 'j' ,'k', 'l' ,'m' ,'n' ] ascii_str2 = ['o', 'p', 'q', 'r', 's' , 't' , 'u' ,'v' , 'w' , 'x' ,'y', 'z' ] for t in range(1,100000000): rand_str1 = random.choice(ascii_str1) rand_str2 = random.choice(ascii_str2) filename = "d:\\test" + rand_str1 + rand_str2 + "%d.txt..
2016. 8. 8.