# Running a Python script with c++

**URL:** <https://forums.unrealengine.com/t/running-a-python-script-with-c/114117>\
**Category:** Pipeline & Plugins\
**Tags:** Datasmith, unreal-engine\
**Created:** [July 25, 2018, 1:55pm UTC](https://forums.unrealengine.com/t/running-a-python-script-with-c/114117 "2018-07-25T13:55:58Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Elias\_Kremer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Elias\_Kremer](https://forums.unrealengine.com/u/Elias_Kremer)\
**Post date:** [July 26, 2018, 8:03am UTC](https://forums.unrealengine.com/t/running-a-python-script-with-c/114117/4 "2018-07-26T08:03:35Z")

</div>

Hey,  
Thank you for your reply! The writing to the command line works now.  
Your second solution seems to be even better. But I have a problem with implementing it. I could implement the first part and the build succeeded but if I try to use this function on my plugin, it fails to build just after adding #include “PythonBridge.h”. Is it important where the code/script is placed? I just created it by right-clicking and then choosing New C++ Class. Can you explain how to create a base-class?

Is it also possible with your second approach to feed variables to python as you can do to regular c++ functions?

Best regards

---

_[View the full topic](https://forums.unrealengine.com/t/running-a-python-script-with-c/114117)._
