Comments (4)
Hi @artas728,
I thought that will be a great idea to have documentation regarding how to use this plugin but as usual, I haven't enough time to do it. Sorry, my bad 😔
Basically, the only thing you should do is install a plugin in PyCharm, that's all. It will replace default PyCharm debugger with custom one which supports await
syntax in evaluate expression
and conditional breakpoints
(It will patch default asyncio
loop using nest-asyncio library in order to have ability reenter to running event loop).
Example
I will show you a quick example, how PyCharm will behave in different cases with and without this plugin.
For instance, we have async code like this:
async def foo(n):
return n * 2
async def bar():
for i in range(10):
n = await foo(I) # At this line we have breakpoint
print(n)
After we reach a breakpoint, we will open evaluate expression
window.
Evaluate expression without plugin
Evaluate expression with installed plugin
Notes
Also, you can use await
syntax in Watchers
window and for conditional breakpoints
.
from pycharm-evaluate-async-code.
@artas728 If you have more questions or something isn't clear for you, feel free to ask 😊
from pycharm-evaluate-async-code.
@uriyyo , it is very clear and simple, thanks a lot for the detailed answer!
from pycharm-evaluate-async-code.
@artas728 great, I will close this issue. In case of any questions, you can reopen an issue.
from pycharm-evaluate-async-code.
Related Issues (20)
- Don't work with docker-compose interpreter. HOT 3
- When debugging code, normal code breaks can lead to different runtime results HOT 6
- Event loop is already running error HOT 19
- Pycharm 2021.3 support? HOT 6
- Great plugin , but doesn't work anymore in pycharm 2021.3.1 HOT 6
- asyncio.create_subprocess_exec() will throw notImplementedError exception on Windows HOT 3
- DeprecationWarning: There is no current event loop HOT 5
- Django console stop warking after plugin was enabled HOT 2
- The plugin is not being applied automatically HOT 6
- awaiting a function crashes the debugger HOT 6
- Just sent a crash log for your refer if you have time to check. HOT 3
- Doesn't work with python 3.11.1 HOT 8
- DeprecationWarning: There is no current event loop HOT 4
- Support event loops other than asyncio HOT 3
- Crashing in PyCharm debugger on Django tests HOT 4
- Doesn't work HOT 10
- not working when using fastapi HOT 7
- add support for js/nodejs
- Any plan to support trio? HOT 7
- Fails the invocation of the latest IDEA EAP 6 HOT 5
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 pycharm-evaluate-async-code.