1

How do you do indenting in python? I use notepad but I need smart indenting. Is it like this?

This is for socket server.
while True:
tab c, addr = s.accept()
tab tab print "Thank you for connection.",
tab tab tab c.close()

I hope I got the indents right.

Bitcoin Address:
1MeNca7h6m8du4TV3psN4m4X666p6Y36u5m

Thumbs up

2

Assuming "c, addr = s.accept()" is a variable declaration, then you are using too many indents. Indentation in Python is used to determine what lines are appart of a code block, so if those lines are all part of one single code block, in this case the while statement, then they should be all the same indentation. Adding code blocks within code blocks, such as with if statements or other functions, is when you'd start using deeper indentation. Example:

while True:
tab c, addr = s.accept()
tab print "Thank you for connection.",
tab if addr != None:
tab tab print "This IP address is: ", addr
tab c.close()
-BrushTone v1.3.1: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

Thumbs up