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
125
S
43
G
17
Posts: 2,232
Reputation: 20,026

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
125
S
43
G
17
Posts: 2,232
Reputation: 20,026

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
94
S
33
G
114
Posts: 5,360
Reputation: 73,781


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 1 guest