Is there functions like the luaL_loadfile and luaL_loadbuffer in lua source to dump the lua scripts in Python's source?

Dave Angel davea at davea.name
Tue Apr 14 14:30:40 CEST 2015


On 04/14/2015 08:07 AM, zhihao chen wrote:
> HI,I  want to dump the python script when some application(android's app)
> use the python engine.they embedding python into its app.
> <https://docs.python.org/2/extending/embedding.html>
>
>   I can dump the script from an app which use the lua engine through the
> luaL_loadbuffer or luaL_loadfile (just hook this function,and dump the lua
> script by the (char *)buffer and size_t )
>
> And,I want to know that:
>
> Is there functions like the luaL_loadfile or luaL_loadbuffer on python's
> source to read the python's file,so I cann't through this function to get
> the (char *)buffer and size so to get the *.py or *.pyc ?
>
> In other words,which C/C++ function contribute to load the all python's
> script or pyc,I want to dump the scripts in that.


I know nothing about lua, but the __file__ attribute on most user 
modules will tell you the filename it's loaded from.  Naturally, that 
assumes it actually came from a file, and a few other things.


-- 
DaveA



More information about the Python-list mailing list