Obsidian Age
New member
Hi there, I've just finished a rather complicated script in Python that prompts the user for a whole bunch of information and runs some calculations based on what they enter. The problem is, I just realised that to be embedded into a website, it needs to be in PHP.
I really don't want to have to re-write the entire code in PHP, so I'm wondering if I can include the Python script and call the variables somehow?
For instance:
Example.py:
text_1 = (raw_input("Text 1: "))
text_2 = (raw_input("Text 2: "))
text_3 = text_1 + text_2
Example.php:
<?php
include(Example.py);
printf(text_3);
?>
Is there any way to get something like this to work?
I really don't want to have to re-write the entire code in PHP, so I'm wondering if I can include the Python script and call the variables somehow?
For instance:
Example.py:
text_1 = (raw_input("Text 1: "))
text_2 = (raw_input("Text 2: "))
text_3 = text_1 + text_2
Example.php:
<?php
include(Example.py);
printf(text_3);
?>
Is there any way to get something like this to work?