From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tomas Nordin Newsgroups: gmane.emacs.help Subject: Re: Line number problem in python-mode Errors Date: Sun, 02 Oct 2016 13:04:51 +0200 Message-ID: <87r37z3tbg.fsf@debian.tompa.tv> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1475406327 17658 195.159.176.226 (2 Oct 2016 11:05:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 2 Oct 2016 11:05:27 +0000 (UTC) User-Agent: Notmuch/0.22 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) To: Amir Teymuri , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 02 13:05:23 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bqea4-0003Sj-LI for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Oct 2016 13:05:16 +0200 Original-Received: from localhost ([::1]:58890 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqea3-000833-8k for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Oct 2016 07:05:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqeZY-00082w-HA for help-gnu-emacs@gnu.org; Sun, 02 Oct 2016 07:04:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bqeZU-0004ID-A0 for help-gnu-emacs@gnu.org; Sun, 02 Oct 2016 07:04:43 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:40565) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqeZU-0004GY-3F for help-gnu-emacs@gnu.org; Sun, 02 Oct 2016 07:04:40 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id F3AA8209AF for ; Sun, 2 Oct 2016 13:04:29 +0200 (CEST) Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 3sn2PQ1YyQzyrx; Sun, 2 Oct 2016 13:04:26 +0200 (CEST) Original-Received: from tomas by debian with local (Exim 4.84_2) (envelope-from ) id 1bqeZf-0006cZ-1F; Sun, 02 Oct 2016 13:04:51 +0200 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 185.67.36.66 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111437 Archived-At: Amir Teymuri 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 "", line 1, in > File "/home/amir/programming/python/c_m/lern.py", line 2, in > > 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