简体   繁体   中英

unicode error when reading fastq files - python 3.4.2

I am trying to read fastq files but I keep getting the following error:

(unicode error) 'unicodeescape' codec can't decode bytes in position 18 -19: truncated \\UXXXXXXXX escape

I used the following code:

file = open(r'C:\Users\jim\Documents\samples\3009_TGACCA_L005_R1_trimmed.fq\3009_TGACCA_L005_R1_trimmed.fq','r', newline = '' )

for i, line in file:
    if i < 5:
        print (line)

file.close()

Could I please get some advice on how I might be able to resolve this issue?

Thanks

尝试复制所有反斜杠\\ => \\\\不带r'前缀

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM