• Advertisement
Sign in to follow this  

Need help with Python (blocks)

This topic is 975 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys

Im using Python 3 and im struggling with blocks, i know it may sound a bit weird but is there a way to make Python

mark blocks with colored squares? Its just that sometimes with many different blocks and with all the lines of code i just loose myself.

Like when i start a block, it will appear under the line of code such a "while" and in a colored square

 

image002.jpg

Edited by r3dt4g

Share this post


Link to post
Share on other sites
Advertisement
Do you use an editor to enter Python code?
If not, by all means do that, the interactive mode isn't intended to write more than 4 lines of code, for testing!

If you do use an editor, the editor would do such functionality, Python itself can only 'run' code, the Python-editor (which is a separate program) shows the code, and let's you edit save and load it.
Unfortunately, I have never seen any editor that does what you want.

In what way do you get lost? Maybe you can figure out a way to setup your code in a less confusing way?

One option that should work is to add "# end if" lines or "#end while" lines with the correct indentation.
The disadvantage of that solution is that nobody else does that afaik, so you'd still get lost with code by others.

Share this post


Link to post
Share on other sites

If you don't like how Python is dependant on whitespace and find it unreadable, why have you choosen this language?

There are many editors, which might help you with this, but maybe you'd be better off learning a comparable language with sane syntax, like Ruby?

Share this post


Link to post
Share on other sites


If you do use an editor, the editor would do such functionality, Python itself can only 'run' code, the Python-editor (which is a separate program) shows the code, and let's you edit save and load it.
Unfortunately, I have never seen any editor that does what you want.

 

Building on this response, I've also not seen an editor that highlights blocks quite like this.  The most similar thing I have seen are "indentation guides" -- lines or colored columns placed at each level of indentation.  You can see if there are settings or plugins that enable indentation guides in the editor of your choice.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement