This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[python] Python plasmoid with more than one source file

Tags: None
(comma "," separated)
sherwoodinc
Registered Member
Posts
1
Karma
0
OS
Greetings.
I'm developing a python plasmoid and I have the minimal directory structure:

Code: Select all
contents/
contents/code/main.py
contents/code/startServer.py
contents/ui/
metadata.plasmoid


I want to run from main.py a new python interpreter using subprocess.Popen().
It worked flawlessly for an interpreter running a builtin python module (SimpleHTTPServer) but now I want to do the same with my custom script "contents/code/startServer.py", but I don't know what relative path to the file should I use from inside main.py.
In my tests I was using "contents/code/startServer.py" which worked when tested using "plasmoidviewer ." from inside the plasmoid directory. But, after creating the .plasmoid and installing it, that no longer works.

Any ideas?
toyg
Registered Member
Posts
2
Karma
0
OS
applet.package().path() + "contents/code/startServer.py"

But it'd be cleaner to just import the module (simply "import startServer") and then start a different process from the code.


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient