no access to lib dir

Trung Hoang thoa0025 at mail.usyd.edu.au
Sun Mar 24 15:18:15 EST 2002


Just a note,

Since i wish to run the script on a university server, i have no access to
where python keeps it's libraries for me to put my script there.

I still strive to believe there is a way - and that someone knows and can
help me.

Cheers

--
Trung Hoang
Final year Undergraduate of Computer Science and Technology
University of Sydney, Australia.


"Trung Hoang" <thoa0025 at mail.usyd.edu.au> wrote in message
news:Ooqn8.5968$EE4.23248 at news-server.bigpond.net.au...
> I've located the problem down to this. i have a file "xml.py" which has a
> function "getProjects()" which i would like to access from c. In the
> interpreter i execute the following commands:
>
>     Python 2.1.2 (#2, Jan 18 2002, 11:23:35)
>     [GCC 2.95.2 19991024 (release)] on sunos5
>     Type "copyright", "credits" or "license" for more information.
>     >>> modname = "xml"
>     >>> mod = __import__(modname)
>     >>> mod
>     <module 'xml' from 'xml.py'>
>     >>>
>
> so that says that the module is locatable by the interpreter. but when i
> compile and run the following program:
>
>     #include <Py/Python.h>
>
>     int main (int argc, char *argv[]) {
>             // declare variables
>             PyObject *modname = NULL;
>             PyObject *mod = NULL;
>
>             // init
>             Py_Initialize();
>
>             modname = PyString_FromString("xml");
>             mod = PyImport_Import(modname);
>             if (mod == NULL) printf("mod is null\n");
>
>             Py_XDECREF(mod);
>             Py_XDECREF(modname);
>             Py_Exit(0);
>     }
>
> it prints out "mod is null" meaning it cant find the module.
>
> Does anyone have a working example of Pure Embedding? It's for my personal
> private project - for fun, supposedly, well before it was, not my
> assignment.
>
> Please :(
> Cheeeeeeeeeeers
>
> --
> Trung Hoang
> Final year Undergraduate of Computer Science and Technology
> University of Sydney, Australia.
>
>





More information about the Python-list mailing list