Skip to content

Commit d1d5f83

Browse files
add a simple CSV file processing example
1 parent a718527 commit d1d5f83

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: hello.py

+14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# How to run this program:
22
# In terminal, run $python3 hello.py
3+
4+
35
import functools, os
46

57
print("Hello world!")
@@ -37,3 +39,15 @@ def add(a, b):
3739

3840
print(__file__) # this prints out the absolute path of this current file on this machine.
3941
print(os.path.abspath(__file__))
42+
43+
44+
def main():
45+
print("Hello World!")
46+
file_content = "72324970,abc,def\n72324990,ghi,123\n"
47+
lines = file_content.splitlines()
48+
for i, line in enumerate(lines):
49+
print('line[{}] = {}'.format(i, line))
50+
51+
52+
if __name__ == "__main__":
53+
main()

0 commit comments

Comments
 (0)