This forum is in archive mode. You will not be able to post new content.

Author Topic: [C/Python-API] Import Modules  (Read 1408 times)

0 Members and 1 Guest are viewing this topic.

Offline flowjob

  • Knight
  • **
  • Posts: 327
  • Cookies: 46
  • Pastafarian
    • View Profile
[C/Python-API] Import Modules
« on: June 03, 2012, 10:44:47 AM »
Hey,

I'm useing the C/Python-API in one of my programs,but I've problems importing modules:
I can compile the code successfully,but when I try to run it,it says
Code: [Select]
ImportError: No module named foobar
So I put it into the directory of my python modules,and it imported everything.
So it seems that the program does import the modules at runtime,but I want them to be imported when compiling,so I have no additional files...

Has anyone an idea how that could be done,except checking what modules are imported,and then adding their source code to the program?


Add. Info:
The script runs with "PyRun_SimpleString".
I tried importing the modules with "PyImport_ImportModule" and writing "import foobar" in the script wich's executed with "PyRun_SimpleString"
Quote
<phil> I'm gonna DDOS the washing machine with clothes packets.
<deviant_sheep> dont use too much soap or youll cause a bubble overflow

 



Want to be here? Contact Ande, Factionwars or Kulverstukas on the forum or at IRC.