Using DRAKON with python try: except: exceptions

Anyone familiar with DRAKON?

I really like the idea of ​​the DRAKON visual editor and play with it using Python - more information: http://drakon-editor.sourceforge.net/python/python.html p>

The only thing I have encountered so far is python: except: exceptions attempt. The only way I tried to use this is to use branches, and then define try: and with the exception of: as separate actions below the branch. The only thing that is connected with this is that DRAKON does not pick up the attempt: and the exception code automatically retreats.

Is there a way to handle try: other than: visually in DRAKON, or maybe you've heard of another visual editor project for python?

Thank.

+5
source share
2 answers

You can put the entire "try: except:" construct inside a single "Action" icon as follows:

Catching exceptions in DRAKON-Python

Both spaces and tabs can be used for indentation within the icon.

+3
source

There are limitations in Drakon because it is a code generator, but you can do as much as possible to rebuild the code and populate it inside the action block:

try:
   function_1 ()
   function_2 ()
except:
   function_3 ()

The dragon works best if you follow the proposed rules (twirl, happy route, fork, etc.).

Once you build the base of algorithms, it will help you quickly solve complex problems.

Hope this helps.

+1
source

All Articles