0

The program maws.py was developed by students in 2015 at Uni-Heidelberg but I could not contact the developer. I checked maws.py with PyCharm and the many indentation problems were solved, I hope. However, running maws.py (program has 1615 lines, so only a few lines are shown):

def gen_range(lower, upper, step):
    start = lower
while start < upper:
    yield start
    start += step

etc...

I get the following error:

 yield start
    ^
SyntaxError: 'yield' outside function

Process finished with exit code 1

I do not know how to solve this as I am a python user and know almost nothing about programming.

wjandrea
  • 28,235
  • 9
  • 60
  • 81
Bruno
  • 49
  • 2
  • 1
    That indentation is not correct, so I linked you a question that explains how indentation works in Python and how to fix problems like this. That said, why were there "many indentation problems" in the first place? I can't imagine it was published like that. Maybe the file got corrupted somehow. – wjandrea Mar 25 '22 at 17:34
  • 1
    Looking at the [source code](https://github.com/igemsoftware/Heidelberg_15/blob/master/MAWS.py) (found by googling), that function looks ok. Maybe you need to re-download it. – 001 Mar 25 '22 at 17:40
  • 1
    @Johnny Exactly what I was going to say. [Here's the direct link to the function](https://github.com/igemsoftware/Heidelberg_15/blob/master/MAWS.py#L27-L31) btw. Although, the number of lines doesn't match -- OP says 1615 but GH says 1218. – wjandrea Mar 25 '22 at 17:40

0 Answers0