how to use python

New releases and general discussions.

Post » Tue Feb 25, 2014 4:11 am

I want to write a script in python but everytime I do so it always gives me an error. I followed everything but an error persists. Is there any solution to this?
B
14
S
2
G
1
Posts: 46
Reputation: 1,144

Post » Tue Feb 25, 2014 4:48 pm

B
116
S
41
G
17
Posts: 2,204
Reputation: 19,545

Post » Wed Feb 26, 2014 1:35 am

I got it to work. How can you make these functions print() and input() to work. I got no other idea for this.
B
14
S
2
G
1
Posts: 46
Reputation: 1,144

Post » Wed Feb 26, 2014 6:45 am

Sorry, not a Python user myself so I wouldn't know :(
B
116
S
41
G
17
Posts: 2,204
Reputation: 19,545

Post » Thu Feb 27, 2014 6:46 pm

You can redirect print() to output to an editbox by running this script at the start of the layout:
Code: Select all
class output(object):
   def write(self, message):
      EditBox.AppendText(message)
sys.stdout = output()


Input could be done similarly but it's more complicated since you need a way to get input. AKA no simple solution exists.
B
92
S
32
G
107
Posts: 5,280
Reputation: 69,971


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 3 guests