A script that only works in your session

While testing a strain conversion, you typed gauge_factor = 2.12 in the IDE console. Your saved script strain.py uses gauge_factor but never assigns it. Your IDE is set to execute Run file inside the existing console session, and all afternoon Run file gave sensible strains.


A colleague runs python strain.py in a terminal, using a byte-identical copy of the file and the same Python and package versions. They get:


NameError: name 'gauge_factor' is not defined


Which explanation best fits this evidence?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Integrated Development Environment (IDE) Questions: