Python Forum

Full Version: Indentations
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Im on Mac in VSCode.

When I try to import function from another file and do from x import y all I get is red underline under import and error saying:
Quote:Cannot import 'loginServices' due to syntax error 'unindent does not match any outer indentation level (<unknown>
. Well, seems fair. At first glance

After doing heavy research, I found that, in accordance with this one cannot mix tabs and spaces.

My question is whats the difference? Tabs are simply group of spaces (4) right? Why is this introduced?
(Apr-27-2020, 08:59 AM)macfanpl Wrote: [ -> ]Tabs are simply group of spaces (4) right?
Nope, tab (ASCII code 9) is different from 4 spaces (4 times ASCII 32). Also it depends on if you are on python2 or python3. Python3 will always produce error if you mix tab and spaces. https://stackoverflow.com/a/2034527/4046632
However you can set any editor to auto convert tab to 4 spaces.
And please, watch language!
Quote:Nope, tab (ASCII code 9) is different from 4 spaces (4 times ASCII 32).
Programmatically yes, correct, but visually who can tel difference?
What is the rationale behind Python3 producing an error on this?
Also, is this forum official Python forum?
(Apr-27-2020, 09:35 AM)macfanpl Wrote: [ -> ]Programmatically yes, correct, but visually who can tel difference?
are you coding or painting?

(Apr-27-2020, 09:35 AM)macfanpl Wrote: [ -> ]Also, is this forum official Python forum?
https://python-forum.io/misc.php?action=help&hid=48
@buran why are you being sarcastic?
(Apr-27-2020, 09:35 AM)macfanpl Wrote: [ -> ]Programmatically yes, correct, but visually who can tel difference?
Actually, I can. I also use VS code on mac, and it's pretty important to understand the difference between tabs and spaces, especially in times of indentation during for loops, if statements, etc. Also, fault language is not tolerated here
Very unfriendly community here. Just like official python infrastructure.
Python sucks heavily at design level.

Delete my account and lets forget about each other
(Apr-27-2020, 10:47 AM)macfanpl Wrote: [ -> ]Very unfriendly community here. Just like official python infrastructure.
Python sucks heavily at design level.

Delete my account and lets forget about each other
We can be very friendly, if you follow the forum rules. This post shall be reported. You don' t like python, all right don't. And, as a matter of fact, python is one of the languages at design level
(Apr-27-2020, 10:47 AM)macfanpl Wrote: [ -> ]Very unfriendly community here.
Actually, you went on the wrong foot from the start with excessive fault language from the post#1.
(Apr-27-2020, 10:55 AM)buran Wrote: [ -> ]
(Apr-27-2020, 10:47 AM)macfanpl Wrote: [ -> ]Very unfriendly community here.
Actually, you went on the wrong foot from the start with excessive fault language from the post#1.

Yea yea yea ..... something more constructive maybe? You are in-love with Python which is extremely buggy one, without plain strategy (2.7/3.x mixed together, tied as if unpinnable) so its quite normal for you to defend your lover. Grow up and leave.

One of picure of inmaturity of Python is what I describe in post #1. Its faulted no matter how many times you try to say that it isnt.
Pages: 1 2