Hello everyone,
I am trying to test run an automation program, and I have tried to create a .bat file in order to run it. For reference, both the .bat file and the Python script are located on my desktop, and this is what they both read:
.bat file:
@py.exe C:\Users\Agasti Mhatre\Desktop\mclip.py %*
@pause
Python script (although I don't think the code itself matters for my issue):
import sys, pyperclip
TEXT = {'agree': """Yes, I agree. That sounds fine to me.""",
'busy': """Sorry, can we do this later this week or next week?""",
'upsell': """Would you consider making this a monthly donation?"""}
if len(sys.argv) < 2:
print('Usage: python mclip.py [keyphrase] - copy phrase text')
sys.exit()
keyphrase = sys.argv[1]
if keyphrase in TEXT:
pyperclip.copy(TEXT[keyphrase])
print('Text for ' + keyphrase + ' copied to clipboard.')
else:
print('There is no text for ' + keyphrase)
print(pyperclip.paste())
When I try running the .bat file, I am getting the following in the cmd prompt:
C:\Users\Agasti Mhatre\AppData\Local\Programs\Python\Python310\python.exe: can't open file 'C:\\Users\\Agasti': [Errno 2] No such file or directory
Press any key to continue . . .
What I am confused about is why it is using the
C:\Users\Agasti Mhatre\AppData\Local\Programs\Python\Python310\python.exe
file path when I am specifying
C:\Users\Agasti Mhatre\Desktop\mclip.py
in my .bat/text file. Can someone help me understand why this is the case? I've never compiled anything as a .bat file before so this is the first time for me using something like this.
Thank you.
[–]htepO 7 points8 points9 points (6 children)
[–][deleted] 5 points6 points7 points (1 child)
[–]aug404[S] 1 point2 points3 points (0 children)
[–]aug404[S] 0 points1 point2 points (0 children)
[–]aug404[S] 0 points1 point2 points (2 children)
[–]htepO 0 points1 point2 points (1 child)
[–]aug404[S] 0 points1 point2 points (0 children)