@[email protected]
Python's choice to use whitespace for blocks is an absolutely unforgivable one.
Programming
A magazine created for the discussion of computer programming-related topics.
Rules
Please keep submissions on topic and of high quality. No image posts, no memes, no politics. Keep the magazine focused on programming topics not general computing topics. Direct links to app demos (unrelated to programming) will be removed. No surveys.
@atzanteol @rasterweb Indents as syntax does mean you’ll have trouble hacking at a Python script in a random text editor but it also means I have never have to worry about where I put closing brackets to try to make things look pretty.
@jim @atzanteol I come from the land of Perl! I seem to have more issues with white space, tabs,and spaces than I do with brackets and semicolons.
@[email protected] This is good criticism and you've found the solutions (force spaces in editors and virtualenv).
Along with virtualenv, pipx is really good at managing things like platformio, or miniterm.py, where you only want the packages for the executable. You should also get a good bash prompt that recognizes when you are in a virtualenv. I use bash-it.
@[email protected] Yeah, I think I just need to fix my editor (I'm using Pulsar) and get used to the virtualenv stuff. I didn't seem to need to worry about things 5 years ago, the last time I dove into Python, but hey, things change!
-
Are you copying and pasting code chunks from online sources? If you're using spaces and you copy in code with tabs or vice versa, easy problem to run into.
-
Are you using pip? If not, start using it. It's by far the easiest way to go about it. Assuming you're on Mac from the homebrew mention, here's a guide.