Python Forum
Thread Rating:
  • 2 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Indentations
#1
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?
#2
(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!
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

#3
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?
#4
(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
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

#5
@buran why are you being sarcastic?
#6
(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
pyzyx3qwerty
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs
#7
Very unfriendly community here. Just like official python infrastructure.
Python sucks heavily at design level.

Delete my account and lets forget about each other
#8
(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
pyzyx3qwerty
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs
#9
(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.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

#10
(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.


Possibly Related Threads…
Thread Author Replies Views Last Post
  comment indentations Skaperen 12 9,138 Jan-29-2017, 06:56 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020