0

I've been searching a lot for this problem, but I didnt find any valuable answer.

I want to make a script (lets say it is a library) which runs some functions at reboot. Inside my library, there will be a function like

def randomfunction():
 print("randomtext")

After loading this function, everytime a call for randomfunction() in any python run (I will .py as cgi scripts) will return me "randomtext".

Is that possible or I miss something?


It is working on python idle if I use exec, but I want this exec to be on system. That would be for a linux OS.

asked Jun 6, 2017 at 8:42

1 Answer 1

0

Don't you need some kind of Interprocess Communication for this?

Might be worth taking a look at these docs: Python IPC

Also, this SO post might help you. I think it offers a solution to what you are looking for.

answered Jun 6, 2017 at 8:51
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.