0
with open(filename, "r+b") as reviewfile:
    with open('database_set.txt', "wb") as aprior:
        reviewfile.write("\n \t \t \t \t \t" + titlelist[user_choice - 1])
        reviewfile.write("\n \n \t \t \t \t \tAverage rating " +
                         str(avg_rating) + " based on " + str(total_no_ratings) + " ratings")

I am trying to retrieve product reviews from website,but its showing this error.

Mahek
  • 552
  • 2
  • 7
  • 28
  • Can you add the error stack trace? – bastelflp Feb 14 '16 at 09:11
  • Traceback (most recent call last): File "E:\flip.py", line 138, in with open(filename, "r+b") as reviewfile: FileNotFoundError: [Errno 2] No such file or directory: 'Lenovo_Sisley_S60_(Graphite_Grey,_8_GB)_reviews.txt' – Mahek Feb 15 '16 at 03:34
  • The file `filename` =`Lenovo_Sisley_S60_(Graphite_Grey,_8_GB)_reviews.txt` is opened to read, but does not exist. Check, if it exists, before you open it. – bastelflp Feb 15 '16 at 07:10
  • Add your error stack trace to the question (via `edit`). And read: http://stackoverflow.com/a/82852/5276734 for how to check if a file exists. – bastelflp Feb 15 '16 at 12:04

0 Answers0