Paiza.io can access the network and handle files.
That means you can run libtrusterd via Python's ctypes!
As expected, wget-like things could be easily implemented in Python.
context = ssl.create_default_context()
conn = http.client.HTTPSConnection(host, 443, context=context)
conn.request('GET',path)
res = conn.getresponse()
f = open(libname, "wb")
f.write(res.read())
f.close()
Even https is easy ™
Well, it's OK if you bring this as well as libtrusterd.so.
@Phi, famous for tmlib.js, wrote a Python article I knew it for the first time at this time, but thanks to this article Successfully added the intended path to LD_LIBRARY_PATH.
os.environ["LD_LIBRARY_PATH"] = os.environ.get("LD_LIBRARY_PATH") + ":."
But it still doesn't work. ..
It seems that dlopen only looks at the environment variables when the process is started.
To make matters worse, paiza.io does not output any results at least when the process is restarted! Maybe there is a way to work with child processes, but lack of python experience Therefore, the code I wrote is NG. If the standard output of the child process is absorbed by the parent process I feel like I can go.
You can open the shared library as many times as you like, but it will not actually load after the second time. I feel like there was a description, which means that I remember the opened library.
Call the shared library that is said to be missing in advance with ctypes.CDLL, I ran libtrusterd.
dummy = ctypes.CDLL("./libevent-2.0.so.5")
dummy = ctypes.CDLL("./libevent_core-2.0.so.5")
dummy = ctypes.CDLL("./libevent_openssl-2.0.so.5")
--LD_LIBRARY_PATH is already late at dlopen even if it is rewritten in the code --In a situation where a child process or a process cannot be restarted, it is OK to dlopen a shared library that does not have a path.
-Introduction to node-ffi with Go and applying it using Electron -Calling the library made with Go from mruby on Windows and displaying the webcam image at the command prompt -How to write Cargo build.rs when using Go library with Rust
Recommended Posts