emacs - Indentation error in simple python -


update: original question posted using c-ret run lines, produces error. no such error using menu python > eval region, evaluates script.

however, using menu every execution annoying, , can't run present line alone method. problem remains.


forgive me if i'm missing obvious, can't figure out.

this code giving me indentationerror. can't imagine what's going on.

for x in range(0, 3):     print "we're on time %d" % (x) 

enter image description here

here's related python in emacs.el

;; elpy (add-to-list 'package-archives              '("elpy" . "http://jorgenschaefer.github.io/packages/")) (package-initialize)  (elpy-enable) 

you've mixed tabs , spaces. can lead confusing errors.

i'd suggest using tabs or spaces indentation.

using spaces easier choice. editors have option automatically converting tabs spaces. if editor has option, turn on. can paste code in notepad see.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -