Strange, I restart my system and then create a new module. I type on the first line if __name__ == '__main__': it still has the same error message, and then I type on the second line somevar = True and save the file, the error message suddenly disappear.
After all of these action, whatever I do, the error message no longer appear.
BTW, Pylint is disabled.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Humm, what could happen is that the 1st time the shell still wasn't started, so, pydev just goes on so that your system doesn't appear halted, so, the builtin vars are not available... and then on the 2nd request, with the shell started, the new request for analysis is able to gather those tokens.
Cheers,
Fabio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Do you have some error in your error log? -- that usually happens when there's some error when spawning the shell for dynamic analysis (the usual cause is having a firewall enabled that's blocking communication).
Cheers,
Fabio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I always get the following problems
Description Resource Path Location Type
Undefined variable: __name__ example.py test/src/root/nested line 0 PyDev Problem
for every module I have:
if __name__ == '__main':
DoTestCode()
But Pydev Extensions say Undefined variable: __name__
How can I fix that?
Strange, __name__ should be gotten from builtins as other tokens such as False, True, etc.
Do you have some error in your error log? Other names such as 'True', 'False' are correctly found?
Cheers,
Fabio
Strange, I restart my system and then create a new module. I type on the first line if __name__ == '__main__': it still has the same error message, and then I type on the second line somevar = True and save the file, the error message suddenly disappear.
After all of these action, whatever I do, the error message no longer appear.
BTW, Pylint is disabled.
Humm, what could happen is that the 1st time the shell still wasn't started, so, pydev just goes on so that your system doesn't appear halted, so, the builtin vars are not available... and then on the 2nd request, with the shell started, the new request for analysis is able to gather those tokens.
Cheers,
Fabio
I just begin working with Eclipse and Pydev, and have the same problem:
__name__ is cataloged as undefined,
ans when I add somevar = True, I get
Undefined variable: True
For longer programs, range, None, Frame, etc. are taken as Undefined variables…
Anyway, the programs work all right (I tested some longer programs already tested with IDLE, I am working on a Mac PowerPC G5 )
I tried to restart, but with always the same result…
Do you have some error in your error log? -- that usually happens when there's some error when spawning the shell for dynamic analysis (the usual cause is having a firewall enabled that's blocking communication).
Cheers,
Fabio