Ampersand (&) character inserted during Run Python File in Terminal. (latest update).
See original GitHub issueEnvironment data
- VS Code version: 1.52
- Extension version (available under the Extensions sidebar): 2021.1.502429796 (just got upgraded from 2020.12.424452561)
- OS and version: Windows 10
- Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.9 (default, Aug 31 2020, 17:10:11) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32, conda 4.9.2
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): conda
- Relevant/affected Python packages and their versions: XXX
- Relevant/affected Python-related VS Code extensions and their versions: Python v2021.1.502429796, Pylance v2021.1.2
- Value of the
python.languageServer
setting: XXX
[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (python.languageServer: 'Microsoft'
), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]
Expected behaviour
Python file runs in terminal cmd.exe.
Actual behaviour
F:\Code\test>conda activate stan_env
(stan_env) F:\Code\test>& C:/Anaconda3/envs/stan_env/python.exe f:/Code/test/test.py & was unexpected at this time.
Steps to reproduce:
Run Python File in Terminal with cmd.exe terminal with workspace settings like below.
workspace settings
{
"folders": [
{
"path": "."
}
],
"settings": {
"python.pythonPath": "C:\\Anaconda3\\envs\\stan_env\\python.exe",
"python.terminal.activateEnvironment": true,
"python.condaPath": "C:\\Anaconda3\\Scripts\\conda.exe",
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe"
}
}
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
XXX
Issue Analytics
- State:
- Created 3 years ago
- Comments:10
Top Results From Across the Web
Ampersand "&" syntax error running any Python script in ...
I was able to resolve the issue by downgrading my version of the Python extension to the previous version. It seems like their...
Read more >using ampersand in set in python - You.com | The AI Search ...
Answer: No, the ampersand is a bitwise 'and' operator in Python, the operator will be parsed out of the name. In general, Python...
Read more >Using SnowSQL - Snowflake Documentation
This topic describes how to use SnowSQL, including starting/stopping the client, using commands and variables within the client, and other general usage ...
Read more >Jelly escaping types - Product Documentation | ServiceNow
You use different methods when escaping characters in JavaScript and HTML. ... the backslash character, and HTML uses the ampersand character.
Read more >__main__ — Top-level code environment — Python 3.11 ...
If you're new to Python modules, see the tutorial section Modules for an introduction. __name__ == '__main__' ¶. When a Python module or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry, I tried that after, but forgot to restart the shell when testing haha. Yeah it’s back to normal now, thanks 😃
@kimadeline, will try out tomorrow and report back!