Skip to content

Commit d3c6b4c

Browse files
AdministratorAdministrator
Administrator
authored and
Administrator
committed
demo files
1 parent b1b716f commit d3c6b4c

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target/

src/main/python/demo_files.py

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env python3
2+
3+
'''
4+
'''
5+
6+
movies = "A list of movies..."
7+
8+
import os
9+
10+
def main():
11+
12+
pythonfileDir = os.path.dirname(__file__)
13+
14+
filename = os.path.normpath(pythonfileDir + r'/../../../target/movies.txt')
15+
16+
target_dir = os.path.dirname(filename)
17+
if not os.path.exists(target_dir):
18+
os.mkdir(target_dir)
19+
20+
with open(filename, 'w') as fh:
21+
fh.write(f"{movies}")
22+
23+
24+
with open(filename) as fh:
25+
print(fh.read())
26+
27+
28+
29+
if __name__ == "__main__":
30+
main()

0 commit comments

Comments
 (0)