How to work with python on visual studio code


#1

Can somebody tell me how to work with python 3.6.5 on visual studio code?
Thank you


#2

Once you’re in Visual Studio Code, all you need to do is create a Python file in the editor. So, for example, create a file called demo.py

Code will recognise that you’re working with Python, and the first time you do this you’ll be prompted to install the Python extension (which allows Code to understand the syntax of the language) as well as the linter which is required if you want it to do auto-complete typing when you’re working with variables and functions etc.

Keep in mind, though, that Visual Studio Code is just a code editor and not an IDE. You won’t be able to run your Python scripts through it, only edit them. If you want to run your code, you’ll need to install Python.


#3

define work with?

There is a guide for this:

https://code.visualstudio.com/docs/languages/python

what is it your struggling with? You might need to learn how to execute python scripts written with VScode, given codecademy offers a nice run button for it, maybe VScode offers this as well, but you need to learn how to use it


#4

I have dislodges python’s latest version
Style it does not work. What can I do.


#5

style what does not work? Given the problems are with an editor on your computer, its really difficult to get a clear picture. Please try to be descriptive and brief, use screenshots to show the problem.


#6

I am very sorry for that reply. There are some typing errors which I didn’t notice while typing.
The rectified reply is written below-

I have already downloaded python (the latest version). Still the code is not working. Also if I debug, it shows an error.

It is my humble request to you to help me resolve this problem.

Thank you


#7

but what errors? From what code? I can’t guess what errors and/or code you might have

also, if you downloaded python3, ensure that all code is updated to python3. The course teaches python2


#8

Can you be a bit more specific about what error you’re getting, and from where? Ideally, either post the text of the error or a screenshot so we can see what you’re looking at. Will help figure out what’s broken.


#9

The second image:

After entering the any word the console quickly gets closed.

What can I do?

Thank you


#10

i think the error is pretty useful? greater then (>) isn’t allowed between string (original) and integer (0)

What you want to do, is check that the length of original is greater then zero. Given the length is also an integer, comparing integer with greater then operator is fine


#11

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.