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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -