Giter Site home page Giter Site logo

Comments (4)

uriyyo avatar uriyyo commented on June 3, 2024

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

image

Evaluate expression with installed plugin

image

Notes

Also, you can use await syntax in Watchers window and for conditional breakpoints.

from pycharm-evaluate-async-code.

uriyyo avatar uriyyo commented on June 3, 2024

@artas728 If you have more questions or something isn't clear for you, feel free to ask 😊

from pycharm-evaluate-async-code.

artas728 avatar artas728 commented on June 3, 2024

@uriyyo , it is very clear and simple, thanks a lot for the detailed answer!

from pycharm-evaluate-async-code.

uriyyo avatar uriyyo commented on June 3, 2024

@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)

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.