A simple Python evaluator: (Kylix ready)
- Create a new Form
- Drop a TMemo (or a TRichEdit)
- Drop a TPythonGUIInputOutput for displaying Python's messages
- Drop a TMemo for the source code
- Drop a TPythonEngine
- Connect the attribute IO of the TPythonEngine to the TPythonGUIInputOutput.
- Connect the attribute Output of TPythonGUIInputOutput to the TRichEdit.
- Drop a TButton and call it "Execute script"
- Double-click on the button and add:
- That's all !
- Compile and execute.
- Write in the Memo1: print 2+2
- Click on the Execute button
- You should see in the Output window: 4
Comments (0)
You don't have permission to comment on this page.