Home > Back-end >  How to fix "name error '_' not defined in powershell terminal while trying to run a p
How to fix "name error '_' not defined in powershell terminal while trying to run a p

Time:09-02

I'm trying to make a bot for discord and am running into problems getting it to run. I have no experience in coding.
I copied the scripts into visual studio for a test to see if I can get it to work, and I think I copied it right. I just don't know what I'm doing wrong when trying to run it in the terminal.

pic of my visual studio

CodePudding user response:

You have to type python Donnie.py in the terminal and hit enter.

Welcome to programming :)

CodePudding user response:

The vscode terminal uses the power shell built into Windows.

If you type python in the terminal and press enter, the python executable will be executed and the python interactive window will open.

Here, you can directly type python language and run, such as print("hello").

enter image description here

If what you want to run is a python script file. Then you should use the play button at the top right of the interface and select Run Python File.

enter image description here

If you want to run with the command, use python youfilename.py command in the terminal to run the entire script file.

enter image description here

  • Related