Passing and returning values from outside program

This forum is currently in read-only mode.
From the Asset Store
Assets for creating mountains and ravines environments
  • The Python features aren't documented well, so its hard to determine exactly what you can do with them. However, what I would like to do is find a way to pass some text to an outside program (python or whatever) for processing and then have the result stored back into a global variable. The execfile function will run an external python script, but I don't believe execfile returns anything.

    Any ideas on the best way to do this?

  • You could have the out side program write into a text file and then read the text file to get the return. then just delete the text file.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • great idea! I'll have to give it a shot.

    I'd still love to see one of the developers show a simple example of how the python scripting additions are useful. I have programmed in Python before (lots of Pygame especially) so its not like I don't know what Python can do. The only value I see in scripting is doing things that you can't do in events. I'll mess around with it more as well and if I come up with anything interesting I'll let you know.

  • seconded.

    We need a Python API section on the wiki.

    Im not sure if there is one already, Sourceforge is being slow again. Grr.

  • The python documentation is a complete reference to the python API, and has code examples.

  • The python documentation is a complete reference to the python API, and has code examples.

    I agree, we don't need a Python API. I was thinking more of a Python Construct API. Maybe they are one and the same. If so are you saying then that I can use ANY Python code in Construct? Any Python API can be imported and used? If that is the case it is not clear from the scripting interface. Like I said before I have programmed many Python programs and have plenty of Python code examples. What I would like to know is if there is any limitation to what Python code can be used with Construct and if so generally what is it.

    I would be more than happy to help show Python scripting examples with Construct, but it would be nice to have one reference on how it would be helpful is all I'm saying...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)