Re: [Pythonmac-SIG] Mac PyImport_ImportModule("modulename")

2005-12-13 Thread Zhi Peng
Thanks [EMAIL PROTECTED] wrote: (snip) PyRun_SimpleString("sys.path.append('.\')\n");(snip)I try to throw in my 5 Cent: The backslash (Windows path separator?) following the dot might be the problem. So let me guess, the program runs on Windows, but not on Unix.(Sorry for my silly quoting, but

Re: [Pythonmac-SIG] Mac PyImport_ImportModule("modulename")

2005-12-13 Thread matthias . oberlaender
(snip) PyRun_SimpleString("sys.path.append('.\')\n"); (snip) I try to throw in my 5 Cent: The backslash (Windows path separator?) following the dot might be the problem. So let me guess, the program runs on Windows, but not on Unix. (Sorry for my silly quoting, but Lotus Notes is a pain!)

Re: [Pythonmac-SIG] Mac PyImport_ImportModule("modulename")

2005-12-12 Thread Zhi Peng
Hi! Bob As I said, I can import it from command line by >pythonw >import StringModule > By the way, the StringModule has been installed in the MacPython system as I do a setup. The sys.path print out as following: = zhi-pengs-power-mac-g5:~/Desktop/zhiyong/ScriptSupport zpeng

Re: [Pythonmac-SIG] Mac PyImport_ImportModule("modulename")

2005-12-12 Thread Bob Ippolito
If sys.path is correct, then it would import. I don't believe you, show the sys.path from the python interpreter and show it from your program. -bob On Dec 12, 2005, at 9:40 AM, Zhi Peng wrote: > > Hi! Bob > > Following is the main code that I used for test. The > sys.path seems correct bec

Re: [Pythonmac-SIG] Mac PyImport_ImportModule("modulename")

2005-12-12 Thread Zhi Peng
Hi! Bob Following is the main code that I used for test. The sys.path seems correct because I can import when I use pythonw and import SringModule. Everytime I run the program, it said "can not import StringModule". One might use a simple module with only one sentance inside as a "StringModule.

Re: [Pythonmac-SIG] Mac PyImport_ImportModule("modulename")

2005-12-09 Thread Bob Ippolito
Well I have no idea whether you're extending or embedding Python.. and if you are embedding, I have no idea what steps you've taken to initialize the interpreter... so I'm not sure. Like I said before, what you need to do is make absolutely sure you're using the correct Python interpreter, f

Re: [Pythonmac-SIG] Mac PyImport_ImportModule("modulename")

2005-12-09 Thread Zhi Peng
Hi! Bob   I have not tried to append current directory in sys.path. Maybe I need to do sth sys.path.append("./") and then do import. The module is installed in MacPython package. The os module is in python23.dylib so it can find it and import it. But my module is just a py file.   Thanks  

Re: [Pythonmac-SIG] Mac PyImport_ImportModule("modulename")

2005-12-09 Thread Bob Ippolito
On Dec 9, 2005, at 4:41 PM, Zhi Peng wrote: > In my c code, I have used myMod=PyImport_ImportModule("moduleName") > and run on Mac, but it just can not import the "moduleName" for > some unknown reason. > > I am sure I install the "moduleName" by "pythonw setup install". > And I can import

[Pythonmac-SIG] Mac PyImport_ImportModule("modulename")

2005-12-09 Thread Zhi Peng
Hi! All   In my c code, I have used myMod=PyImport_ImportModule("moduleName") and run on Mac, but it just can not import the "moduleName" for some unknown reason.   I am sure I install the "moduleName" by "pythonw setup install". And I can import "moduleName" from command lines such as   >