syntaxerror: invalid syntax

python - else: SyntaxError: invalid syntax - Stack Overflow
Join Stack Overflow to learn, share knowledge, and build your career.
or sign in with
I will highly appreciate if any one could help me out here. I am new to PYTHON and can't figure out why I am getting INVALID SYNTAX ERROR at the else:
print len(ScoringMatrix), len(ScoringMatrix[0]), len(ScoringMatrix[0][0])
def AllignmentScore(seqA, seqB):
length = len(seqA)
while i & length:
if seqA[i] == '-':
while seqA[i] == '-':
s = s - (GapOpen + (l - 1) * GapExtend)
elif seqB[i] == '-':
while seqB[i] == '-':
s = s - (GapOpen + (l - 1) * GapExtend
s += CalcPAMscore(seqA[i], seqB[i])];
13.8k93558
You're missing the closing parentheses on the previous line.
s = s - (GapOpen + (l - 1) * GapExtend)
21.2k35581
Closing parenthesis is missing at the end of elif statement.
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Upcoming Events
Stack Overflow works best with JavaScript enabledAccess denied | www.archivum.info used Cloudflare to restrict access
Please enable cookies.
What happened?
The owner of this website (www.archivum.info) has banned your access based on your browser's signature (4010a2cea0b91431-ua98).python - SyntaxError: invalid syntax in dictionary - Stack Overflow
Join Stack Overflow to learn, share knowledge, and build your career.
or sign in with
This question already has an answer here:
Traceback (most recent call last):
File "./openerp-server", line 2, in &module&
import openerp
File "/home/tiny/Desktop/openerp/server/trunk/openerp/__init__.py", line 70, in &module&
import cli
File "/home/tiny/Desktop/openerp/server/trunk/openerp/cli/__init__.py", line 6, in &module&
from openerp.modules import module
File "/home/tiny/Desktop/openerp/server/trunk/openerp/modules/__init__.py", line 27, in &module&
from . import db, graph, loading, migration, module, registry
File "/home/tiny/Desktop/openerp/server/trunk/openerp/modules/graph.py", line 32, in &module&
import openerp.osv as osv
File "/home/tiny/Desktop/openerp/server/trunk/openerp/osv/__init__.py", line 22, in &module&
import osv
File "/home/tiny/Desktop/openerp/server/trunk/openerp/osv/osv.py", line 22, in &module&
from openerp.osv.orm import except_orm, Model, TransientModel, AbstractModel
File "/home/tiny/Desktop/openerp/server/trunk/openerp/osv/orm.py", line 2377
groupby_dict = {gb['groupby']: gb for gb in annotated_groupbys}
SyntaxError: invalid syntax
229k35339431
marked as duplicate by ♦, , , ,
This question has been asked before and already has an answer. If those answers do not fully address your question, please .
you have to create dict using
dict((gb['groupby'], gb) for gb in annotated_groupbys)
11.8k74781
were added to the language in version 2.7.
So you need to upgrade to Python 2.7. If you're stuck with 2.6, you could use
groupby_dict = dict((gb['groupby'], gb) for gb in annotated_groupbys)
229k35339431
Not the answer you're looking for?
Browse other questions tagged
Upcoming Events
Stack Overflow works best with JavaScript enabledSyntaxError: invalid syntax in Play Framework 1.1
follow, http://www.oschina.net/bbs/thread/9568
and play 1.1 was encountered SyntaxError: invalid syntax, why?
play-1.1]$ play~&&&&&&& _&&&&&&&&&&& _~& _ __ | | __ _ _& _| |~ | '_ \| |/ _' | || |_|~ |& __/|_|\____|\__ (_)~ |_|&&&&&&&&&&& |__/~~ play! 1.1, http://www.playframework.org~Traceback (most recent call last):& File &./play&, line 96, in ?&&& cmdloader = CommandLoader(play_env[&basedir&])& File &/projects/iv/play-1.1/framework/pym/play/cmdloader.py&, line 9, in __init__&&& self.load_core()& File &/projects/iv/play-1.1/framework/pym/play/cmdloader.py&, line 15, in load_core&&& mod = load_python_module(name, self.path)& File &/projects/iv/play-1.1/framework/pym/play/cmdloader.py&, line 39, in load_python_module&&& return imp.load_module(name, mod_desc[0], mod_desc[1], mod_desc[2])& File &/projects/iv/play-1.1/framework/pym/play/commands/modulesrepo.py&, line 106&&& done = self.proc(bits, filesize) if bits != filesize else 100&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ^SyntaxError: invalid syntax
好像是python版本太低,为什么官方网上不说用什么版本的python?
python -VPython 2.4.3
是python的版本太低,play1.1需要python2.5以上的版本。推荐这篇日记的豆列
&&&&&&&&&&&&

我要回帖

更多关于 Python file 的文章

 

随机推荐