Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #41347 > unrolled thread

How to automatically get the indent level from code?

Started byPeng Yu <pengyu.ut@gmail.com>
First post2013-03-16 23:52 -0500
Last post2013-03-16 23:52 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  How to automatically get the indent level from code? Peng Yu <pengyu.ut@gmail.com> - 2013-03-16 23:52 -0500

#41347 — How to automatically get the indent level from code?

FromPeng Yu <pengyu.ut@gmail.com>
Date2013-03-16 23:52 -0500
SubjectHow to automatically get the indent level from code?
Message-ID<mailman.3382.1363495970.2939.python-list@python.org>
Hi,

I want to get the indent level within the code. For example, I want to
print 1 within the while loop as the line is indented 1 level. Is it
possible to get it within python?

while 1:
   #print the level of indent, which is 1 here.

-- 
Regards,
Peng

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web