Posts: 22
Threads: 5
Joined: Apr 2020
Apr-27-2020, 08:59 AM
(This post was last modified: Apr-27-2020, 09:07 AM by buran.)
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?
Posts: 8,160
Threads: 160
Joined: Sep 2016
Apr-27-2020, 09:14 AM
(This post was last modified: Apr-27-2020, 09:15 AM by buran.)
(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!
Posts: 22
Threads: 5
Joined: Apr 2020
Apr-27-2020, 09:35 AM
(This post was last modified: Apr-27-2020, 09:35 AM by macfanpl.)
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?
Posts: 8,160
Threads: 160
Joined: Sep 2016
(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
Posts: 22
Threads: 5
Joined: Apr 2020
@ buran why are you being sarcastic?
Posts: 353
Threads: 13
Joined: Mar 2020
(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
Posts: 22
Threads: 5
Joined: Apr 2020
Apr-27-2020, 10:47 AM
(This post was last modified: Apr-27-2020, 10:48 AM by macfanpl.)
Very unfriendly community here. Just like official python infrastructure.
Python sucks heavily at design level.
Delete my account and lets forget about each other
Posts: 353
Threads: 13
Joined: Mar 2020
(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
Posts: 8,160
Threads: 160
Joined: Sep 2016
(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.
Posts: 22
Threads: 5
Joined: Apr 2020
(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.
|