Code: Select all
Timer = timing.Timer"
When you changed the code in the files over to
Code: Select all
import timing
Timer = timing.Timer
Moderator: Oberlus
Code: Select all
Timer = timing.Timer"
Code: Select all
import timing
Timer = timing.Timer
Code: Select all
2014-09-08 16:58:16,717 ERROR AI : File "/home/gvdm/freeorion-code/FreeOrion/default/AI/InvasionAI.py", line 16
2014-09-08 16:58:16,717 ERROR AI : Timer = timing.Timer"
2014-09-08 16:58:16,717 ERROR AI : ^
2014-09-08 16:58:16,717 ERROR AI : SyntaxError: EOL while scanning string literal
Code: Select all
>>> import timing
>>> Timer = timing.Timer"
File "<stdin>", line 1
Timer = timing.Timer"
^
SyntaxError: EOL while scanning string literal
Code: Select all
>>> Timer = timing.Timer
>>> help(Timer)
ah yeah, the ' " ' at the end of the line was a typo, sorry about the confusion.gvdm wrote:But without the " it works fine,Code: Select all
>>> Timer = timing.Timer >>> help(Timer)
I had looked into that, there are no standard modules named 'timing', and the search priorities are (at least if there is not a 'builtin' module by that name) to search the local directory before anywhere else.Geoff the Medio wrote:Is there another "timing.py" somewhere in the path?
Hmm, I think not necessarily the same version -- I think the the version invoked by FO is controlled by the build process.Chriss wrote:Is the python which runs the AI from within FO the same python that gets accessed from the command line? Are there multiple on Fedora? Python2 vs python3?
Code: Select all
from timing import Timer
Code: Select all
import pydoc
import timing
print pydoc.render_doc(timing)
Timer = timing.Timer
Code: Select all
2014-09-08 23:05:36,111 DEBUG AI : Python module search path: /usr/lib64/python27.zip:/usr/lib64/python2.7/:/usr/lib64/python2.7/plat-
linux2:/usr/lib64/python2.7/lib-tk:/usr/lib64/python2.7/lib-old:/usr/lib64/python2.7/lib-dynload
2014-09-08 23:05:36,111 DEBUG AI : Initializing C++ interfaces for Python
2014-09-08 23:05:36,467 DEBUG AI : Python stdout and stderr redirected
2014-09-08 23:05:36,683 DEBUG AI : Python Library Documentation: module timing
2014-09-08 23:05:36,684 DEBUG AI :
2014-09-08 23:05:36,684 DEBUG AI : NAME
2014-09-08 23:05:36,684 DEBUG AI : timing
2014-09-08 23:05:36,684 DEBUG AI :
2014-09-08 23:05:36,684 DEBUG AI : FILE
2014-09-08 23:05:36,685 DEBUG AI : /usr/lib64/python2.7/lib-dynload/timingmodule.so
2014-09-08 23:05:36,685 DEBUG AI :
2014-09-08 23:05:36,685 DEBUG AI : FUNCTIONS
2014-09-08 23:05:36,685 DEBUG AI : finish(...)
2014-09-08 23:05:36,685 DEBUG AI :
2014-09-08 23:05:36,685 DEBUG AI : micro(...)
2014-09-08 23:05:36,685 DEBUG AI :
2014-09-08 23:05:36,685 DEBUG AI : milli(...)
2014-09-08 23:05:36,688 DEBUG AI :
2014-09-08 23:05:36,688 DEBUG AI : seconds(...)
2014-09-08 23:05:36,688 DEBUG AI :
2014-09-08 23:05:36,688 DEBUG AI : start(...)
2014-09-08 23:05:36,688 DEBUG AI :
2014-09-08 23:05:36,688 DEBUG AI :
2014-09-08 23:05:36,689 ERROR AI : Traceback (most recent call last):
2014-09-08 23:05:36,689 ERROR AI : File "/home/gvdm/freeorion-code/FreeOrion/default/AI/FreeOrionAI.py", line 11, in <module>
2014-09-08 23:05:36,690 ERROR AI : import AIstate
2014-09-08 23:05:36,690 ERROR AI : File "/home/gvdm/freeorion-code/FreeOrion/default/AI/AIstate.py", line 5, in <module>
2014-09-08 23:05:36,690 ERROR AI : import AIFleetMission
2014-09-08 23:05:36,690 ERROR AI : File "/home/gvdm/freeorion-code/FreeOrion/default/AI/AIFleetMission.py", line 3, in <module>
2014-09-08 23:05:36,691 ERROR AI : import AIFleetOrder
2014-09-08 23:05:36,691 ERROR AI : import MoveUtilsAI
2014-09-08 23:05:36,691 ERROR AI : File "/home/gvdm/freeorion-code/FreeOrion/default/AI/MoveUtilsAI.py", line 7, in <module>
2014-09-08 23:05:36,692 ERROR AI : import ColonisationAI
2014-09-08 23:05:36,692 ERROR AI : File "/home/gvdm/freeorion-code/FreeOrion/default/AI/ColonisationAI.py", line 10, in <module>
2014-09-08 23:05:36,692 ERROR AI : import ProductionAI
2014-09-08 23:05:36,692 ERROR AI : File "/home/gvdm/freeorion-code/FreeOrion/default/AI/ProductionAI.py", line 9, in <module>
2014-09-08 23:05:36,692 ERROR AI : import PriorityAI
2014-09-08 23:05:36,693 ERROR AI : File "/home/gvdm/freeorion-code/FreeOrion/default/AI/PriorityAI.py", line 8, in <module>
2014-09-08 23:05:36,693 ERROR AI : import InvasionAI
2014-09-08 23:05:36,698 ERROR AI : File "/home/gvdm/freeorion-code/FreeOrion/default/AI/InvasionAI.py", line 17, in <module>
2014-09-08 23:05:36,698 ERROR AI : Timer = timing.Timer
2014-09-08 23:05:36,698 ERROR AI : AttributeError: 'module' object has no attribute 'Timer'
Code: Select all
from FO_timing import Timer