Comments (9)
you can show a flow diagram like the above picture(consider try and except like if and else statements)
from pyflowchart.
You are doing great @cdfmlr.
from pyflowchart.
from pyflowchart.
x=0
try:
print(x)
except:
print("An exception occurred")
Diagram Code :
op2=>operation: try:
print(x)
except:
print('An exception occurred')
from pyflowchart.
it's simple example of try and exception in python
from pyflowchart.
Diagram Code :
op2=>operation: try:
print(x)
except:
print('An exception occurred')
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.
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:
- as your illustration, missing start of try:
- 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):
- to express what a try-except do clearly, I have to make it complex:
And we are not even considering the multi-excepts cases which will make things increasingly complex.
from pyflowchart.
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.
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)
- aa HOT 1
- When running pyflowchart, an error is displayed and the flowchart code cannot be found. HOT 5
- How can a ConditionNode deal with 3 conditions HOT 2
- ConditionNode alignment support HOT 5
- Parallel node support HOT 3
- CLI running `python3 -m pyflowchart simple.py` got no outputs HOT 1
- How to save the svg? HOT 1
- 大佬可以增加一下对于类中的方法的流程解析嘛 HOT 4
- How about targetting diagrams library too? HOT 1
- Please add `scroll to zoom` functionality if possible. HOT 2
- Cannot read properties of null HOT 2
- Is there an option to create a heatmap? HOT 1
- Chinese README is not updated. 更新中文文档
- TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' HOT 3
- Support for match-case statement: AttributeError: 'Unparser' object has no attribute '_Match' HOT 11
- Nodes: white spaces and shpes HOT 1
- windows: UnicodeDecodeError: 'gbk' codec can't decode HOT 11
- TODO Items HOT 4
- for loop rendered as an operation not a loop HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyflowchart.