Created
March 4, 2017 02:43
-
-
Save mzaini30/24a6947bbad6642151ec3061957e52ff to your computer and use it in GitHub Desktop.
Konversi tabel ke list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
lokasi = "/sdcard/python/tabel/" | |
data = open(lokasi+"data.txt").read().splitlines() | |
nama=[] | |
jabatan=[] | |
usia=[] | |
print data | |
for n, x in enumerate(data): | |
data[n] = data[n].split("\t") | |
nama.append(data[n][0]) | |
jabatan.append(data[n][1]) | |
usia.append(data[n][2]) | |
print data | |
print nama | |
print jabatan | |
print usia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nama jabatan usia | |
zaini cto 25 | |
ati user experience 26 | |
rahman designer 21 | |
andre bussiness strategies 23 | |
rey ceo 29 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d/0/python/tabel/.last_tmp.py" && exit < | |
['nama\tjabatan\tusia', 'zaini\tcto\t25', 'ati\tuser experience\t26', 'rahman\tdesigner\t21', 'andre\tbussiness strategies\t23', 'rey\tceo\t29'] | |
[['nama', 'jabatan', 'usia'], ['zaini', 'cto', '25'], ['ati', 'user experience', '26'], ['rahman', 'designer', '21'], ['andre', 'bussiness strategies', '23'], ['rey', 'ceo', '29']] | |
['nama', 'zaini', 'ati', 'rahman', 'andre', 'rey'] | |
['jabatan', 'cto', 'user experience', 'designer', 'bussiness strategies', 'ceo'] | |
['usia', '25', '26', '21', '23', '29'] | |
#[QPython] Press enter to exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment