+ 1

Python3: What is "bandit(B322)" problem in VSCode?

When I code an "input" in my program, Visual Studio Code shows an error or something in "Problems" tab. I donno how to fix this. The message is: " The input method in Python 2 will read from standard input, evaluate and run the resulting string as python source code. This is similar, though in many ways worse, then using eval. On Python 2, use raw_input instead, input is safe in Python 3. bandit(B322)"

5th Oct 2019, 12:58 AM
Daniel Amini
Daniel Amini - avatar
9 Answers
+ 2
Unfortunately I change my interpreter to python 3.7.4 but the problem is still there...!
5th Oct 2019, 2:52 AM
Daniel Amini
Daniel Amini - avatar
+ 1
I couldn't understand yet. How to solve the problem...? Should I update something? What is the solution?
5th Oct 2019, 2:18 AM
Daniel Amini
Daniel Amini - avatar
+ 1
I installed python 3! raw_input is for python 2
5th Oct 2019, 2:23 AM
Daniel Amini
Daniel Amini - avatar
+ 1
Oh, ok, then it must be a vscode problem, maybe it thonks that you're using Python 2 instead of Python 3, try to look in the settings, or the Python exception
5th Oct 2019, 2:34 AM
alvaro.pkg.tar.zst
alvaro.pkg.tar.zst - avatar
+ 1
Do you use windows? If so check if typing "python" in cmd executes the Python 2 interpreter or the Python 3 interpreter
5th Oct 2019, 10:11 AM
alvaro.pkg.tar.zst
alvaro.pkg.tar.zst - avatar
+ 1
Yeah I use widows... i checked everything about python 3! it's python 3...I'm sure! maybe I have to change my widows.... I didn't change it about a year!
6th Oct 2019, 11:16 AM
Daniel Amini
Daniel Amini - avatar
0
Here's a very brief and easy to understand explanation https://stackoverflow.com/a/4915408
5th Oct 2019, 2:05 AM
alvaro.pkg.tar.zst
alvaro.pkg.tar.zst - avatar
0
Instead of using input(), use raw_input()
5th Oct 2019, 2:21 AM
alvaro.pkg.tar.zst
alvaro.pkg.tar.zst - avatar
0
Probably you installed a wrong Python extension or it's just bugged
6th Oct 2019, 11:22 AM
alvaro.pkg.tar.zst
alvaro.pkg.tar.zst - avatar