Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5346

Python • Re: Pylance: can import csv, but NOT sys OR os modules ... WTHey?

$
0
0
You don't need to remove or reinstall Python.

If vscode and extensions got cleared up by the reinstall, which sounds like it did, then the rest is probably something you have in your code that might be off.
Yes, you are correct, suh! (No, I don't have a 19th Century Southern US accent.) Even with zero Python experience, I've caught some bugs in the snippets ChatGPT has handed me. The biggie was the format of the 'import' directive, i.e. I was failing miserably
with ChatGPT's loo-HOO-zer example:

from <path> import <module_name>

But now I'm sailing fast with:

from <module_name> import *

^^^^allows me to call/reference all funcs declared in module directly, short-form i.e. func(a,b) withOUT preceding
module name, i.e. no need for long-form: module_name.func(a,b)


There remains only 1 question: Would it be "bad form" to erase this whole thread to conceal my ig-nernce? :lol: :oops: :oops:

Statistics: Posted by Fixizin — Fri Dec 22, 2023 7:15 am



Viewing all articles
Browse latest Browse all 5346

Trending Articles