Closed Thread
Results 1 to 5 of 5

Thread: Python in C/C++?

  1. #1
    JewFro297's Avatar
    JewFro297 is offline Programming Professional
    Join Date
    Jan 2010
    Location
    New York
    Posts
    226
    Rep Power
    0

    Python in C/C++?

    Is there any way to include python code in a C/C++ program? for example write a C++ program that prints hello world then calls a python script thats been linked to the executable then returns back to the C++ code after it's finished?
    Yea Dat's right.
    Apple sucks

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Join Date
    Nov 2009
    Location
    I seem to be lost...
    Posts
    1,566
    Blog Entries
    1
    Rep Power
    22

    Re: Python in C/C++?

    This may help, it's the documentation for extending Python through C++.
    Knowledge: Intermediate C#, Beginner AS3, HTML, CSS, Binary, Hex, Octal.
    Science is only an educated theory, which we cannot disprove.

  4. #3
    JewFro297's Avatar
    JewFro297 is offline Programming Professional
    Join Date
    Jan 2010
    Location
    New York
    Posts
    226
    Rep Power
    0

    Re: Python in C/C++?

    Thanks, looks good
    Yea Dat's right.
    Apple sucks

  5. #4
    lthreed's Avatar
    lthreed is offline Newbie
    Join Date
    Mar 2010
    Posts
    18
    Rep Power
    0

    Re: Python in C/C++?

    Yes you can run the python script file by calling it from the command line within the C++ program

  6. #5
    manux's Avatar
    manux is offline Programming Professional
    Join Date
    Oct 2008
    Posts
    234
    Blog Entries
    1
    Rep Power
    14

    Re: Python in C/C++?

    You can also use distutils to compile C/C++ code and import it as a Python module(.pyd), and you can also call Python inside a C/C++ application and use the returned PyObjects* with the C Python API.

    basically... the link thegamemaker gave you

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Advanced Python, part 1: Extending Python with C
    By spyder in forum Python Tutorials
    Replies: 0
    Last Post: 07-31-2010, 09:36 AM
  2. Replies: 11
    Last Post: 07-31-2010, 12:52 AM
  3. Power Of Python - What Has Been Written In Python?
    By Raja Sekharan in forum Python
    Replies: 7
    Last Post: 02-02-2009, 11:55 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts