Skip to content

Commit

Permalink
Create py_dummydoc.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelSNelson committed Dec 5, 2023
1 parent 359fa34 commit 8aaf8d6
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions py_dummydoc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import os
import sys

def find_next_filename():
counter = 1
filename = f"dummy{counter}.txt"
while os.path.exists(filename):
counter += 1
filename = f"dummy{counter}.txt"
return filename

def create_file(filename, args):
with open(filename, 'w') as file:
file.write("Arguments passed:\n")
for arg in args:
file.write(f"{arg}\n")

# Find the next available filename
next_filename = find_next_filename()

# Get command line arguments (excluding the script name)
arguments = sys.argv[1:]

# Create the file and write the arguments to it
create_file(next_filename, arguments)

0 comments on commit 8aaf8d6

Please sign in to comment.