-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates to folder organization and some of the python scripts.
- Loading branch information
1 parent
4bc72ed
commit d96638c
Showing
8 changed files
with
106 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,10 @@ | ||
import sys | ||
|
||
# Function to log messages | ||
def log_message(message): | ||
with open('D:/log.txt', 'a') as log_file: | ||
print(message, file=log_file, flush=True) | ||
|
||
log_message("Python script started.") | ||
|
||
# Check if the first command-line argument is None | ||
if len(sys.argv) >= 2: | ||
first_argument = sys.argv[1] | ||
if first_argument is None: | ||
log_message("The first argument is None.") | ||
# Check if any command-line arguments were provided | ||
if len(sys.argv) == 1: | ||
# No arguments were passed, print default coordinates | ||
print('12345', '54321') | ||
else: | ||
log_message("No arguments were provided.") | ||
print('12345', '54321') | ||
# Arguments were passed, print an error message to standard error | ||
print("Error: Unexpected arguments received.", file=sys.stderr) | ||
sys.exit(1) # Optionally exit with a non-zero status to indicate an error |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,15 @@ | ||
import sys | ||
|
||
# Function to log messages | ||
def log_message(message): | ||
with open('D:/log.txt', 'a') as log_file: | ||
print(message, file=log_file, flush=True) | ||
|
||
log_message("Python script started.") | ||
|
||
# Check if there are exactly two command-line arguments | ||
if len(sys.argv) == 3: | ||
try: | ||
# Parse the two arguments as doubles (X and Y) | ||
X = float(sys.argv[1]) | ||
Y = float(sys.argv[2]) | ||
log_message(f"X: {X}, Y: {Y}") | ||
print(f"X: {X}, Y: {Y}") | ||
except ValueError: | ||
log_message("Invalid arguments. Both X and Y must be doubles.") | ||
print("Invalid arguments. Both X and Y must be doubles.", file=sys.stderr) | ||
sys.exit(1) | ||
else: | ||
log_message("Usage: python script.py <X> <Y>") | ||
print("Expected two arguments, X and Y as doubles", file=sys.stderr) | ||
sys.exit(1) |
Oops, something went wrong.