Making a section in Python like Matlab
384 ビュー (過去 30 日間)
古いコメントを表示
Hello, I am a Matlab user and these days, I am working with Python. I don't know in which community that I should ask questions relating to this.
My questions is in Matlab, in a file, we can sectionalize by using '%%' and run each section separately. How do I sectionalize in Python and run the sections seperately?
Can someone answer this question. It will be a big help.
0 件のコメント
採用された回答
Al Danial
2023 年 6 月 10 日
Python IDEs such as Spyder also support code cels. The delimiter there is #%%. As in the matlab IDE, in Spyder you can run all the code in a Python cell before moving to the next one. Here's what code cells look like in Spyder:
2 件のコメント
Al Danial
2023 年 6 月 14 日
In PyCharm the delimiter looks to be ##. Isn't clear to me if that's in all PyCharm versions or if you need the Pro version.
その他の回答 (1 件)
Govind KM
2023 年 6 月 9 日
I don't think there is any equivalent functionality in Python. Maybe you can make a function for each section and run the required parts by just running the current line of code.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Call Python from MATLAB についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!