سؤال

I'm newbie to python. As I start coding simple python code using windows Python 3.3.3 Shell, when I try to save webtest1.py, it automatically adds extra line below. While running the code, this automatically causes invalid syntax error.

I check the code online on http://pych.atomidata.com/code, it shows, 'Line: 8 Column: 1 W391 blank line at end of file'.

Any solution? Appreciated.

saving .py file with new line automatic addition error

هل كانت مفيدة؟

المحلول

You need to use brackets around print in python 3. print (htmltext) should solve your problem.

http://docs.python.org/3.3/library/functions.html#print

Edit: @Ashwini already stated that until I wrote this. I think you/he should write that in answers so it can be accepted.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top