Skip to content

Commit 09661b3

Browse files
Merge pull request #45 from ilovecode1/reset
Reset
2 parents 7fe1cda + 8c22fcc commit 09661b3

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

pyfancy/demo.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@
1313
pyfancy().cyan_bg("Cyan background").output()
1414
pyfancy().black().gray_bg("Gray background").output()
1515
pyfancy().read("pyfancy/demo/import.txt").output()
16+
pyfancy().red("This should not be seen!").reset().output()
1617
print(pyfancy().red("Hello").raw(", ").blue("world!").strip())

pyfancy/pyfancy.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,17 @@ def output(self):
8585
# Adds new text without changing the styling
8686
def add(self,addition):
8787
self.out += addition;
88-
return self;
88+
return self
8989

9090
def read(self,file):
9191
f = open(file, 'r')
9292
self.out += f.read()
9393
f.close()
9494
return self
95+
96+
def reset(self):
97+
self.out = ""
98+
return self
9599

96100
#Alternate between all the colours of the rainbow
97101
#No orange, replaced with lightRed

0 commit comments

Comments
 (0)