DEV Community


Discussion on: Tips to use VSCode more efficiently

wpfan2099 profile image

hello dear Sebastian - is VScode only a editor or can we do more.

i am just diving into Python and i have started to code in Python literally 5 minutes ago. so do not bear with me - with this beginner question. Which is the right Editor for me to start.

Is Vscode capable to run code and to store the output of the code - eg. from the code below!?

I want to be able to export the data I have scraped as a CSV file. My question is how do I write the piece of code which outputs the data to a CSV?

the question is: can we run in VSCode the code below - and have a closer look at the output? does VSCode execute the code - and store the file somewhere on the machine!?

note - this is devinitly no coding question - those would fit on SO - no this is a superuserquestion that is aimed to get the right tool to start...

import csv ; import requests
from bs4 import BeautifulSoup

outfile = open('career.csv','w', newline='')
writer = csv.writer(outfile)
writer.writerow(["job_link", "job_desc"])

res = requests.get("
soup = BeautifulSoup(res,"lxml")
links = soup.find_all("a")

for link in links:
if "career" in link.get("href") and 'COPENHAGEN' in link.text:
item_link = link.get("href").strip()
item_text = link.text.replace("View Position","").strip()
writer.writerow([item_link, item_text])
print(item_link, item_text)

the question: We now should be able to run this in VSCode ( and yes: i do not think that we need a fully fledged IDE as PyCharm) and besides that we also should be able to run this in ATOM too- i guess that we can now open the py file and run it with the ATOM extension called script!?!?

What do you say -what do you think about this "extension called script or the other one called Hydrogen!?!?