Skip to content

Commit 90b4cf4

Browse files
committed
Different method of opening files.
Windows: opens in default text editor. Uses different method to open files. This results in the file being opened without the command line having to wait for the text editor to close before executing another command.
1 parent 609c8e5 commit 90b4cf4

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

diary.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,9 @@ def open_diary():
8181
print ("Opening diary:", diary_file())
8282

8383
if os.name == "nt":
84-
call(["notepad", diary_file()])
84+
os.system("start " + diary_file())
8585
else:
86-
call(["open", diary_file()])
87-
88-
def open_diary():
89-
print ("Opening diary:", diary_file())
90-
91-
if os.name == "nt":
92-
call(["notepad", diary_file()])
93-
else:
94-
call(["open", diary_file()])
86+
os.system("open " + diary_file())
9587

9688
if args.open == True or args.command == "o":
9789
open_diary()

0 commit comments

Comments
 (0)