I just started using VSC. I have created a .py file with the line print('Hola mundo')
. When I run the line (Mayus+Intro in Linux at least), it works fine.
>>> print('Hola mundo') Hola mundo
But then I try to Run the file (with the play button), and this errors raises:
>>> /home/tidop/anaconda3/envs/snappy/bin/python /home/tidop/Documentos/vs_folder/Hello_World.py
File "<stdin>", line 1
/home/tidop/anaconda3/envs/snappy/bin/python /home/tidop/Documentos/vs_folder/Hello_World.py
^
SyntaxError: invalid syntax
I have enter exit()
in that terminal, so a normal linux terminal is used now. Here, I use the Run file button without problems.
(snappy) tidop@tidop-System-Product-Name:~/Documentos/vs_folder$ /home/tidop/anaconda3/envs/snappy/bin/python /home/tidop/Documentos/vs_folder/Hello_World.py Hola mundo
But now I can't run just a line in here, cause it causes a bash error.
Question: How can I run indifferently lines and files in VSC?
I use Spyder and this problem does not exist...