Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You asked:</p> <blockquote> <p>Error message is still pointing to a line 88 in code which is not there any more. Module import/reloading issue?</p> </blockquote> <p>Yes. The traceback (error messages) will show the current (newest saved) file, even if you haven't run it yet. You must reload/reimport to get the new file.</p> <p>The discrepancy comes from the fact that traceback printouts read from the script file (scriptname.py) saved on your drive. However, the program is run either from the module saved in memory, or sometimes from the .pyc file. If you fix an error by changing your script, and save it to your drive, then the same error will still occur if you don't reload it.</p> <p>If you're running interactively for testing, you can use the <code>reload</code> function:</p> <pre><code>&gt;&gt;&gt; import mymodule &gt;&gt;&gt; mymodule.somefunction() Traceback (most recent call last): File "mymodule.py", line 3, in somefunction Here is a broken line OhNoError: Problem with your file </code></pre> <p>Now, you fix the error and save mymodule.py, return to your interactive session, but you still get the error, but the traceback shows the fixed line</p> <pre><code>&gt;&gt;&gt; mymodule.somefunction() Traceback (most recent call last): File "mymodule.py", line 3, in somefunction Here is the fixed line OhNoError: Problem with your file </code></pre> <p>So you have to reload the module:</p> <pre><code>&gt;&gt;&gt; reload(mymodule) &lt;module 'mymodule' from '/path/to/mymodule.py'&gt; &gt;&gt;&gt; mymodule.somefunction() Success! </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload