Skip to content

Commit 9e2460b

Browse files
committed
update
1 parent 4cb7f85 commit 9e2460b

File tree

4 files changed

+40
-1
lines changed

4 files changed

+40
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Cargo.lock
33

44
**/*.rs.bk
55
.cargo
6+
.py
67

78
# node configuration files
89
/config/

src/loopfil2.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import os
2+
3+
directory = os.getcwd()
4+
for filename in os.listdir(directory):
5+
if filename.endswith(".rs") or filename.endswith(".png"):
6+
print(os.path.join(directory, filename))
7+
8+
#remove last line from a text line in python
9+
fd=open(filename,"r")
10+
d=fd.read()
11+
fd.close()
12+
m=d.split("\n")
13+
s="\n".join(m[:-1])
14+
fd=open(filename,"w+")
15+
for i in range(len(s)):
16+
fd.write(s[i])
17+
fd.close()
18+
19+
else:
20+
continue

src/loopfiles.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import os
2+
3+
directory = os.getcwd()
4+
for filename in os.listdir(directory):
5+
if filename.endswith(".rs") or filename.endswith(".png"):
6+
print(os.path.join(directory, filename))
7+
8+
with open(filename, "a+") as file_object:
9+
# Move read cursor to the start of file.
10+
file_object.seek(0)
11+
# If file is not empty then append '\n'
12+
data = file_object.read(100)
13+
if len(data) > 0 :
14+
file_object.write("\n")
15+
# Append text at the end of file
16+
#file_object.write("hello hi")
17+
18+
else:
19+
continue

src/zero.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
1

0 commit comments

Comments
 (0)