"SyntaxError: unexpected EOF while parsing " IN PYTHON 3.7
1
0
Entering edit mode
4.6 years ago

E_VALUE_THRESH = 0.04

for alignment in b_record.alignments:
    for hsp in alignment.hsps:
        if hsp.expect < E_VALUE_THRESH:
            print '****Alignment****'
            print 'sequence:', alignment.title
            print 'length:', alignment.length
            print 'e value:', hsp.expect
            print hsp.query[0:75] + '...'
            print hsp.match[0:75] + '...'
            print hsp.sbjct[0:75] + '...'

[PYTHON 3.7] THIS OCCUR NOT ONLY IN CASE OF THIS CODE. HAPPENS FREQUENTLY WHENEVER I AM EXECUTING FOR , WHILE LOOP IN THE PROGRAM

PYTHON • 67k views
ADD COMMENT
0
Entering edit mode

If you're running this in Py3.x, you need to use print("xyz") with the brackets (and its generally a good idea to do that anyway).

ADD REPLY
1
Entering edit mode
4.6 years ago
warrenfelsh ▴ 10

The SyntaxError: unexpected EOF while parsing means that the end of your source code was reached before all code blocks were completed. A Python code block starts with a statement like for i in range(100): and requires at least one line afterwards that contains code that should be in it.

Also, this can simply mean you are missing or have too many parenthesis. For example this has too many, and will result in unexpected EOF.

ADD COMMENT

Login before adding your answer.

Traffic: 2373 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6