File tree Expand file tree Collapse file tree 3 files changed +16
-8
lines changed
Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 11import sys
22import time
3+ from os import system , name
34
45def decor (func ):
56 def wrap ():
@@ -20,4 +21,12 @@ def load_b():
2021 sys .stdout .write (i )
2122 sys .stdout .flush ()
2223 time .sleep (0.3 )
23- print ('\n ' )
24+ print ('\n ' )
25+
26+ def clear ():
27+ # Windows
28+ if name == 'nt' :
29+ system ('cls' )
30+ # Mac and Linux
31+ else :
32+ system ('clear' )
Original file line number Diff line number Diff line change 11import time
2- import os
32import sys
4- from extras import load_a , load_b
3+ from extras import load_a , load_b , clear
54import caesar_encryption as ce
65import caesar_decryption as cd
76
@@ -10,7 +9,7 @@ def options():
109 print ()
1110 if option == '1' :
1211 time .sleep (1.5 )
13- os . system ( 'cls' )
12+ clear ( )
1413 ce .intro ()
1514 ce .note ()
1615 print ()
@@ -26,7 +25,7 @@ def options():
2625
2726 elif option == '2' :
2827 time .sleep (1.5 )
29- os . system ( 'cls' )
28+ clear ( )
3029 cd .intro ()
3130 cd .note ()
3231 print ()
@@ -42,7 +41,7 @@ def options():
4241
4342 elif option == '3' :
4443 time .sleep (1.5 )
45- os . system ( 'cls' )
44+ clear ( )
4645 msg = "Thank you! :)\n See you next time!"
4746 sys .exit (msg )
4847
Original file line number Diff line number Diff line change 11import time
22from option_validator import options
3- import os
3+ from extras import clear
44
55def redo ():
6- os . system ( 'cls' )
6+ clear ( )
77 print ('*******************************' )
88 print ('What would you like to do next?' )
99 time .sleep (1 )
You can’t perform that action at this time.
0 commit comments