Reading txt file script how to?

i got an old 2.7 file and trying to run it in 2.79

and it is refusing to open the file
error on name


fname = ‘11K_500m_trim.txt’
fo = open(‘H:\Users\richa\ST-Laurent-3D1\st-laurent1\fname’ , ‘r’)

got the right path and file name

tried with name like fname = “11K_500m_trim.txt”
and still not working !

can someone help to correct this line

also hope this can also work in latest BL 3.5 !

after this line i use the lineread to read each line and get the data’s

thanks for feedback

happy bl

i found another method using the local folder with API

blendfilepath =

but i would like to know if the other method still work in latest bl 2.79 or BL 3.5

happy bl

This is more a python syntax issue rather then a Blender issue.
You’ve included your ‘fname’ variable as a string.
fo = open('H:\Users\richa\ST-Laurent-3D1\st-laurent1\' + fname , ‘r’)

what about these double backslah
is it still use in latest built ?
or deprecated ?

as i said found another way to use local folder more flexible i think
then absolute path

happy bl