all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Line number problem in python-mode Errors
@ 2016-10-01 16:50 Amir Teymuri
  2016-10-02 11:04 ` Tomas Nordin
  0 siblings, 1 reply; 2+ messages in thread
From: Amir Teymuri @ 2016-10-01 16:50 UTC (permalink / raw)
  To: help-gnu-emacs

   Hello,

   i am using emacs in python mode. There is a problem with the line
   numbers each time the python interpreter shows an Error:

   each time an error occurs inside my file.py, the error message shows
   always the actual line number + 1. Here is an example:
# file.py
1 from tst import *

# the interpreter error message:
>>> Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/home/amir/programming/python/c_m/lern.py", line 2, in <module>

AttributeError: 'module' object has no attribute 'foo'

   How can i fix this problem?


   Kind regards,

   Amir


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Line number problem in python-mode Errors
  2016-10-01 16:50 Line number problem in python-mode Errors Amir Teymuri
@ 2016-10-02 11:04 ` Tomas Nordin
  0 siblings, 0 replies; 2+ messages in thread
From: Tomas Nordin @ 2016-10-02 11:04 UTC (permalink / raw)
  To: Amir Teymuri, help-gnu-emacs

Amir Teymuri <amirteymuri@gmx.de> writes:

>    Hello,
>
>    i am using emacs in python mode. There is a problem with the line
>    numbers each time the python interpreter shows an Error:
>
>    each time an error occurs inside my file.py, the error message shows
>    always the actual line number + 1. Here is an example:
> # file.py
> 1 from tst import *
>
> # the interpreter error message:
>>>> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "/home/amir/programming/python/c_m/lern.py", line 2, in <module>
>
> AttributeError: 'module' object has no attribute 'foo'
>

I don't understand properly what you are doing. But after this
traceback, if you go to the file lern.py, line 2, do you not find there
a reference to foo which is not defined?

A little tip also, if you are dealing with learning python, importing
things with the star import, like `from tst import *` is not
recommended. Makes it harder to read code later.

>    How can i fix this problem?
>
>
>    Kind regards,
>
>    Amir



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-02 11:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-01 16:50 Line number problem in python-mode Errors Amir Teymuri
2016-10-02 11:04 ` Tomas Nordin

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.