Python Forum
need help in Anaconda Prompt
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
need help in Anaconda Prompt
#1
Hi,

I have a python script(.py). It purpose is to download several video. However, this python script need to pass 2 arguments (name_of_video and Target_directory). May I know what is the correct python to use to execute the python(.py) script by passing the 2 arguments in ANACONDA PROMPT????

Thank you
Regards,
Philip
Reply
#2
Which OS?
On windows click Start.
In search window type anaconda
choose Anaconda Prompt from list
Reply
#3
Anaconda Prompt is just a cmd version that always point to the python version in your Anaconda installation.
(base) C:\Users\Tom>python -V
Python 3.6.5 :: Anaconda custom (64-bit)

(base) C:\Users\Tom>python -c "import sys; print(sys.executable)"
G:\Anaconda3\python.exe
If place the file in any folder,
Anaconda Prompt will always use own python version to execute script as shown over.
Simple example of a scripts that take command line argument.
# foo.py
from sys import argv

script, video, path, = argv
print(f'Movie name is: {video}')
print(f'Path is: {path}')
Anaconda Prompt:
(base) C:\bar>python foo.py Seven C:/my_path
Movie name is: Seven
Path is: C:/my_path
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Running script from Anaconda prompt acollins555 0 2,594 Jun-15-2020, 03:40 AM
Last Post: acollins555
  run script from anaconda command prompt iFunKtion 2 69,354 Dec-08-2016, 05:34 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020