Indentation Error

Please , I would like to know why I am getting of indentation while using the editor of cloudquant. Below is the message error I am getting

Traceback (most recent call last):
File "run_simulation.py", line 558, in
main(sys.argv[1:])
File "run_simulation.py", line 442, in main
cls = extract_strategy_class(src_file)
File "run_simulation.py", line 66, in extract_strategy_class
execfile(filename, global_dict)
File "job/CQa7b06e53ef274ab2af39c350e2f9d341.py", line 79

self.inposition = 1
^

IndentationError: unexpected indent

Exception during results loading:

Comments

  • ptunneyptunney Posts: 246

    We cannot see your code so it is difficult to tell from just the error and one line of code..
    If you want to share a little more, privately, then send a message to customer_success@cloudquant.com
    with a few more lines surrounding the line creating the error I may be able to help!

  • Thanks, I solve it myself. It is about spacing and alignment inside your code. You can use notepad++ to help you about indentation

  • @lf263820 said:
    Thanks, I solve it myself. It is about spacing and alignment inside your code. You can use notepad++ to help you about indentation.

  • @lf263820 said:

    @lf263820 said:
    Thanks, I solve it myself. It is about spacing and alignment inside your code. You can use notepad++ to help you for your indentation, which is crucial in python.

  • As the error message indicates, you have an unexpected indent error. This error occurs when a statement is unnecessarily indented or its indentation does not match the indentation of former statements in the same block. Python not only insists on indentation, it insists on consistent indentation . You are free to choose the number of spaces of indentation to use, but you then need to stick with it. If you indent one line by 4 spaces, but then indent the next by 2 (or 5, or 10, or ...), you'll get this error. Whenever you have a situation with code inside of a statement, that inside code must be indented, and must be indented consistently. It is used by the interpreter to know how to delimit blocks of instructions.

Sign In or Register to comment.