May-23-2017, 04:21 PM
(May-23-2017, 01:45 PM)harun2525 Wrote: @volcano63
can you write a function like function (get_module_from_name_psace) in my first reply
Took me about 5 minutes to figure out -
In [1]: import importlib In [2]: import robot In [3]: importlib.import_module('robot.errors') Out[3]: <module 'robot.errors' from '/usr/local/lib/python3.4/dist-packages/robot/errors.py'> In [4]: robot.__name__ Out[4]: 'robot'you most probably don't have
robot
package, but the principle applies, errors
is a module of the robot
package
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.