I have a python script (p.py)with a text like this
print "Hello"+"\n"
print "World"
I am running this file in wamp under php / apache
<?php
$output = system("C:\\python27\\python.exe p.py")
?>
I get the following on my browser
Hello World
without new line
How do I make sure the new line character appears.
I also tried "\r\n"
You will need to wrap this in <pre> tags, or use <br/>.
Try viewing something like:
<p>
This is
a test
</p>
In a web browser. You will get no newline. That's because HTML pretty much ignores newlines. You will have to use the <br/> tag for this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With