Skip to content

Commit 7c13294

Browse files
authored
Updated to Python 3 work_connect
Updated print statements to Python 3
1 parent 059aa7a commit 7c13294

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Diff for: work_connect.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@
2323
-d to disconnect''' # Text to display if there is no argument passed or it's an invalid option - 1.2
2424

2525
if len(sys.argv) < 2: # Check there is at least one option passed to the script - 1.2
26-
print text # If not print the text above - 1.2
26+
print(text) # If not print the text above - 1.2
2727
sys.exit() # Exit the program - 1.2
28-
29-
if '-h' in sys.argv or '--h' in sys.argv or '-help' in sys.argv or '--help' in sys.argv: # Help Menu if called
30-
print text # Print the text, stored in the text variable - 1.2
31-
sys.exit(0) # Exit the program
28+
29+
if '-h' in sys.argv or '--h' in sys.argv or '-help' in sys.argv or '--help' in sys.argv: # Help Menu if called
30+
print(text) # Print the text, stored in the text variable - 1.2
31+
sys.exit(0) # Exit the program
3232
else:
3333
if sys.argv[1].lower().startswith('-c'): # If the first argument is -c then
34-
passwd = sys.argv[2] # Set the variable passwd as the second argument passed, in this case my login password
34+
passwd = sys.argv[2] # Set the variable passwd as the second argument passed, in this case my login password
3535
subprocess.Popen((r"c:\Program Files\Checkpoint\Endpoint Connect\trac.exe connect -u username -p "+passwd))
3636
subprocess.Popen((r"c:\geektools\puttycm.exe"))
3737
time.sleep(15) # Sleep for 15 seconds, so the checkpoint software can connect before opening mstsc
3838
subprocess.Popen([remote, conffilename])
3939
elif sys.argv[1].lower().startswith('-d'): # If the first argument is -d then disconnect my checkpoint session.
4040
subprocess.Popen((r"c:\Program Files\Checkpoint\Endpoint Connect\trac.exe disconnect "))
4141
else:
42-
print 'Unknown option - ' + text # If any other option is passed, then print Unknown option and the text from above - 1.2
42+
print('Unknown option - ' + text) # If any other option is passed, then print Unknown option and the text from above - 1.2

0 commit comments

Comments
 (0)