I am trying to schedule my python code (.py) to run in Windows 10 using task scheduler. In order to do so, I need to indicate where my python.exe file is located.
I downloaded the latest Anaconda to my Windows 10 machine and run my code in jupyter notebook successfully so I should have python.exe somewhere.
I cannot find where the "python.exe" file path is stored in my computer. Thoughts?
Please see sample example below:

You can get it quite easily using the os module:
First open a Python interpreter, not through terminal but directly (there should be a shortcut on your start menu).
Next get the os module:
import os
And use the getcwd() method to find it:
os.getcwd()
The better way to do it. If Python is added to path.
Open a command prompt window. Not the Python interpreter or open Power Shell and type:
where python
Another way to do it is to type python.exe in the file explorer search bar at C:.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With