#๐Ÿ”’ Preferences... New Learner

14 messages ยท Page 1 of 1 (latest)

warm wadi
#

I feel like an idiot because I've not even started learning programming and I'm already coming up with problems. I'm setting up VS code and I've been trying to get rid of the PS comments when I type: print(2 + 3 * 6)

It returns
PS C:\Users\Chris> & C:/Users/Chris/AppData/Local/Programs/Python/Python312/python.exe "d:/Learn to Code/Backend/Python/Learning Project 1.py"
20
PS C:\Users\Chris>

Looking on the internet it suggested
https://stackoverflow.com/questions/68068884/visual-studio-code-psneed-explanation-and-how-to-remove-it
Ctrl + Shift + P (Command Palette)
Type: Terminal: Select default profile and hit enter
Select Command Prompt from the options and that should remove the PS

I didn't see anything that matched this suggestion.

Then I found I should install an extension called code runner, which I did, and now I've got the same problem just with a different output.

[Running] python -u "d:\Learn to Code\Backend\Python\tempCodeRunnerFile.py"
20

[Done] exited with code=0 in 0.069 seconds

I just want it to say 20, I don't need to know where I've saved it, I know where it's saved. I also don't need to know it runs quickly, because I just saw it run quickly.
Is what I'm asking just impossible, and I'll just have to tolerate it?

Thanks in advance, apologies in advance for my ignorance.

upbeat riverBOT
#

@warm wadi

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

misty hollow
#

Is what I'm asking just impossible, and I'll just have to tolerate it?
Might be, yeah. I don't really see why you'd want this.

#

(I would say using code runner is a bad idea, it handles venvs worse than the python extension does.)

#

I guess what you could do is do os.system("cls||clear") at the start of your code; that'd erase the prompt and then the first thing you'd see would be the output.

warm wadi
#

Thanks for the response. I added this after reading the config in more depth and it did what I was looking for.

Could you explain why code runner is a bad idea, I'm sure the explanation you gave makes perfect sense but not to me currently, I know nothing about coding, I'm just trying to get set up?

warm wadi
#

Like if I run it normally, it looks like this

misty hollow
#

Could you explain why code runner is a bad idea
It's easy to get into a situation where you have one environment selected for this project, but code runner runs it with a different one, so you get confusing issues. Mostly, though, the reason I disrecommend it to people is because the Python extension can run code and typically makes Code Runner useless. If you prefer the format of the Code Runner's output, that's an okay reason to use it.

warm wadi
#

Well I'm not set on using code runner, whatever will make it give a clean output is what I want. I don't need the file paths and find it to be clutter is why I opted for code runner. It seemed without code runner I couldn't get a clean output.

Is there a non-code runner setting I can change to achieve the same result and won't end up confusing things like you say?

misty hollow
#

I looked into it a bit and didn't find any.

upbeat riverBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.