G
Guest
Hi,
Today is my first day of working on python. I want to execute python
script through C++ program. I found one very good article with example
at http://docs.python.org/ext/pure-embedding.html.
I followed the procedure as given, the code is compiled but while
running it is giving error like:
ImportError: No module named multiply
Failed to load "multiply"
Here are the steps I followed, please suggest where I am wrong and how
can I remove the above error.
Step 1: Copied the given C program into a file called test.cpp (using vi
editor)
Step 2: Compiled it using : g++ test.cpp /usr/lib/libpython2.4.so
(created a.out)
Step 3: Wrote the given script of multipication in a file named as
multiply (using vi editor)
Step 4: But while running the program using : ./a.out multiply
multiply 3 2
Getting this error: ImportError: No
module named multiply
Failed to
load "multiply"
Please help me out.
Thanks & Regards,
Prashant Burghate
Project Engineer,
Embedded Systems,
Wipro Technologies, Pune.
Tel: +91-20-22933700 Extn: 51570
Mob. # 9850428252
Email: (e-mail address removed)
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
www.wipro.com
Today is my first day of working on python. I want to execute python
script through C++ program. I found one very good article with example
at http://docs.python.org/ext/pure-embedding.html.
I followed the procedure as given, the code is compiled but while
running it is giving error like:
ImportError: No module named multiply
Failed to load "multiply"
Here are the steps I followed, please suggest where I am wrong and how
can I remove the above error.
Step 1: Copied the given C program into a file called test.cpp (using vi
editor)
Step 2: Compiled it using : g++ test.cpp /usr/lib/libpython2.4.so
(created a.out)
Step 3: Wrote the given script of multipication in a file named as
multiply (using vi editor)
Step 4: But while running the program using : ./a.out multiply
multiply 3 2
Getting this error: ImportError: No
module named multiply
Failed to
load "multiply"
Please help me out.
Thanks & Regards,
Prashant Burghate
Project Engineer,
Embedded Systems,
Wipro Technologies, Pune.
Tel: +91-20-22933700 Extn: 51570
Mob. # 9850428252
Email: (e-mail address removed)
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
www.wipro.com