Coder Social home page Coder Social logo

Comments (9)

nikhiltree avatar nikhiltree commented on May 14, 2024 1

image
you can show a flow diagram like the above picture(consider try and except like if and else statements)

from pyflowchart.

nikhiltree avatar nikhiltree commented on May 14, 2024 1

You are doing great @cdfmlr.

from pyflowchart.

cdfmlr avatar cdfmlr commented on May 14, 2024

from pyflowchart.

nikhiltree avatar nikhiltree commented on May 14, 2024
x=0
try:
  print(x)
except:
  print("An exception occurred")

Diagram Code :
op2=>operation: try:
print(x)
except:
print('An exception occurred')

Actual Graph
Screenshot from 2022-08-05 10-50-31

from pyflowchart.

nikhiltree avatar nikhiltree commented on May 14, 2024

it's simple example of try and exception in python

from pyflowchart.

cdfmlr avatar cdfmlr commented on May 14, 2024

@nikhiltree

Diagram Code :
op2=>operation: try:
print(x)
except:
print('An exception occurred')

Actual Graph
Screenshot from 2022-08-05 10-50-31

I guess it’s the current running result. And by

And how would you express try-except statements in a flowchart? AFAIK, I’m afraid that there’s not a standard or well-known pattern for errors handling in flowcharts. So show me a example or I will keep this open until someone can figure it out.

I mean what’s your expected diagram (a correction) for it?

from pyflowchart.

cdfmlr avatar cdfmlr commented on May 14, 2024

say, an example:

foo = get_foo()
try:
    c = foo.read()
    print(c)
except:
    print("failed")
foo.close()

to express it in a flowchart, my options are:

  1. as your illustration, missing start of try:

1_missing_strat

  1. not clear for the transferring point (this looks pretty good, but I disapprove of it because I think it's misleading, for the fact that a program will not jump to the except scope from a "try" line):

2_try_line_to_except

  1. to express what a try-except do clearly, I have to make it complex:

3_complex

And we are not even considering the multi-excepts cases which will make things increasingly complex.

from pyflowchart.

nikhiltree avatar nikhiltree commented on May 14, 2024

Thanks, @cdfmlr for your explanation please let me know if you will update this library for solving this type of problem in the future. I am very glad to use this library.

from pyflowchart.

cdfmlr avatar cdfmlr commented on May 14, 2024

Thanks, I will do further research on it later, maybe later this month. And I guess a refactor is required to implement this feature (the early design of this lib is horrible 🤦‍♂️) which should take a bit of time.

from pyflowchart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.