I want to create a file and open it and write on it with f= open('out.txt', 'a')
then it got error:
File "m.py", line 10, in <module>
f=open('./out.txt', 'a')
IOError: [Errno 13] Permission denied: './out.txt'
What happened??
I am using opensuse and was using a user account to edit and run the m.py file
python2.6.4 version
from BeautifulSoup import BeautifulSoup
import re
import urllib2
file = urllib2.urlopen("http://www.tripadvisor.com/ShowUserReviews-g294217-d305813-r49043831-Langham_Place_Hong_Kong-Hong_Kong_Hong_Kong_Region.html#REVIEWS")
soup = BeautifulSoup(file)
tag=soup.findAll(id=re.compile("^review"))
f=open('out.txt', 'a')
str = tag[1].contents
f.write(str)