python - html text area default value messing with page -


i have python cgi script creates text area , fills default value contents of file. used work noticed change in content on file ;the html rendered incorrectly , submit button , parts of file contents shown in text area(as default content) etc missing or messing total page's html

 print('<form action="x.cgi" method="post">')         print('<textarea name="textcontent" cols="120" rows="50">')         open('somefile', 'r') content_file:             content = content_file.read()         content_file.close()         print(content)         print('</textarea>')         print('<hr>')         print('<input type="submit" value="submit" />')         print('</form>') 

what can done contents of somefile doesnt mess html form . note somefile configuration file , need in file printed such user can make necessary change , submit it


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -