VSCode's Python Interactive mode is AMAZING!

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ส.ค. 2020
  • I've gone from serial Jupyter Notebook user to someone that almost never uses them and it's all thanks to VSCode's interactive mode for Python. Check it out!
    MY OTHER VIDOES:
    ○ A.I. Learns to play Snake • Neural Network Learns ...
    ○ 5 Common Python Mistakes: • 5 Things You're Doing ...
    ○ 5 Amazing Python Libraries: • Five Amazing Python Li...
    ○ Making Python fast: • Can VSCode be a reason...
    ○ Learning programming language Julia: • How to learn Julia, a ...
    Twitter: / safijari
    Patreon: / jackofsome
    #python #vscode #notebooks

ความคิดเห็น • 295

  • @PegasusDesigns
    @PegasusDesigns 3 ปีที่แล้ว +144

    This is absolutely gamechanging! I have used VSC for a year and did not know about this. Thank you so much!

  • @rabbitazteca23
    @rabbitazteca23 3 ปีที่แล้ว +60

    VS Code is just SOOO good. Kudos to everyone contributing in making it better and better with every update

  • @eviltiki13
    @eviltiki13 3 ปีที่แล้ว +10

    Been trying out VS code for Python and didn't know this existed. Very happy I found your short and informative video. Looking forward to trying it out. Thanks!

  • @JanneSauvala
    @JanneSauvala 3 ปีที่แล้ว +18

    Cool feature! Interactive development with the integration between editors and REPLs were the reason why I fall in love with Clojure (and in other LISPs) and this starts to be something similar to that.

  • @ericervin2513
    @ericervin2513 3 ปีที่แล้ว +3

    Excellent video! Short and sweet, hit all the high points, exactly what I was looking for. I couldn't figure out how to open the interactive interpreter for non- ipynb files and presto you showed me that and much more.

  • @TheJunglist
    @TheJunglist 3 ปีที่แล้ว +9

    This is fantastic, I've been looking for something like this for so long!

  • @vaskoa
    @vaskoa 3 ปีที่แล้ว +4

    Now this, this looks amazing. I've been looking something like this for a while, something that has the feel and experience of a CAS but with a sane syntax and documentation. Awesome

  • @smithright
    @smithright 3 ปีที่แล้ว +11

    I'm new to Python, taking my first steps to learning a full stack. This is the best editor setup I've found anywhere. Thanks so much for posting!!! 😁

  • @sohangchopra6478
    @sohangchopra6478 2 ปีที่แล้ว +1

    Can't thank you enough for making this video - this is such an amazing feature! Can't believe I never heard about this before!

  • @ko-Daegu
    @ko-Daegu 3 ปีที่แล้ว +58

    Your channel is basically group of great hidden gem altogether in one place

    • @marcus.the.younger
      @marcus.the.younger 3 ปีที่แล้ว

      might as well change the channel name to Laugh Tale

  • @Q_20
    @Q_20 3 ปีที่แล้ว +28

    Combined with live share, this is revolutionizing collaborative research.

  • @marcus.the.younger
    @marcus.the.younger 3 ปีที่แล้ว +28

    from pycharm to sublime text,
    i have tried many IDEs and editors but vscode tops them all...
    i absolutely love it

    • @joleif4970
      @joleif4970 3 ปีที่แล้ว +9

      pycharm also has this feature btw :)
      (butthurt jetbrains fanboy over here haha)

  • @stoicfloor
    @stoicfloor 3 ปีที่แล้ว +70

    I used to need to switch to Chrome for Jupyter notebook but now not anymore!

  • @anon343
    @anon343 3 ปีที่แล้ว +3

    This is literally a whole new way of running code and I love it. Thanks. You earned yourself a sub!

  • @losiu998
    @losiu998 3 ปีที่แล้ว +3

    I've been using this for one year now. Cant imagine programming in python without this

  • @karnasaurav
    @karnasaurav 3 ปีที่แล้ว +1

    That's awesome man. I have been switching between .py files and notebooks a lot. This is just awesome. THANKS!!

  • @abhaysharma8569
    @abhaysharma8569 2 ปีที่แล้ว +2

    I was trying to get a plot on my vscode for the last 4 hours. I just couldn't figure out what was missing. Thank you so much for this video, you probably saved another 4 hours of mine.

  • @FlavioBarrosProfessor
    @FlavioBarrosProfessor 3 ปีที่แล้ว +66

    It is like working with R and RStudio

    • @MHNK77
      @MHNK77 3 ปีที่แล้ว

      Not really. If you want that, using F9 in Spyder is where it's at

    • @xlw12
      @xlw12 3 ปีที่แล้ว +1

      More like matlab :)

  • @pawel040408
    @pawel040408 2 ปีที่แล้ว

    Really good overview - thanks for sharing. I've recently switched to VSC from Spyder and I keep discovering new cool features nearly every day!

  • @PaulFWatts
    @PaulFWatts 2 ปีที่แล้ว

    Thanks for making this video. I didn't know this feature existed!
    As you have pointed out it is amazing and so useful. Especially when you are a relative new comer to Python like myself.
    I love Vscode and it just keeps getting better and better.

  • @summerstream4809
    @summerstream4809 3 ปีที่แล้ว +2

    Found this on reccomendation; this is really worth spreading.

  • @rodrigobarrigagibson3400
    @rodrigobarrigagibson3400 2 ปีที่แล้ว +1

    This is insane and a total game changer for my workflow... Thanks a lot!

  • @ViniciusRaphael
    @ViniciusRaphael 3 ปีที่แล้ว +2

    Man this is amazing. Seriously. Thanks for sharing.
    I'll definetely try.
    It's kind frustrating to have to create in jupyter and then change to py to create an exec. Will try for sure.

  • @user-ht7gg8xs3u
    @user-ht7gg8xs3u 7 หลายเดือนก่อน

    This is a lifesaver! I'm used to Matlab and recently picked up Python. It's great to check what I'm doing. Thank you!

  • @MauroBueno
    @MauroBueno 2 ปีที่แล้ว

    Thanks for this video, Jack! Thanks a lot!

  • @kieranpeleaux
    @kieranpeleaux 3 ปีที่แล้ว +2

    this is super helpful, thanks! just out of curiosity, how did you get the "Save As" file naming functionality (02:03) in the command palette vs. the usual "Save As" dialog that opens in a new window?

  • @stevepepple1800
    @stevepepple1800 2 ปีที่แล้ว +1

    Very cool workflow!
    I was able to also get this working with remote development in a Vagrant/Docker VM.

  • @usamairshad5729
    @usamairshad5729 2 ปีที่แล้ว

    Nice and easy explanation... good work mate

  • @pleabargain
    @pleabargain 3 ปีที่แล้ว +1

    Learned a lot. Thank you.

  • @karlduckett
    @karlduckett 3 ปีที่แล้ว +3

    Damn this is really cool!
    Still have a soft spot to Jupyter Labs. I guess it would be good to build the notebook in VS - then export the final version back to Jupyter to export to HTML with the markdown and interactive widgets. :)

  • @malanb5
    @malanb5 3 ปีที่แล้ว

    Awesome, didn't know about this integration. thanks for sharing!

  • @YlmazDALKIRANscallion
    @YlmazDALKIRANscallion 2 ปีที่แล้ว

    Thank you for the video!

  • @HorusEagletus
    @HorusEagletus 3 ปีที่แล้ว

    Wow thanks for sharing! It is fantastic.

  • @TehAtomiq
    @TehAtomiq 3 ปีที่แล้ว

    I am very used to matlab and this is exactly what i was missing from VS code. Thanks!!

  • @abduvosidmalikov
    @abduvosidmalikov 3 ปีที่แล้ว

    This was new for me. Thanks!

  • @user-or7ji5hv8y
    @user-or7ji5hv8y 3 ปีที่แล้ว +2

    Truly cool. What key word can I Google to learn more?

  • @SamHartmannCom
    @SamHartmannCom ปีที่แล้ว

    Thanks a lot!
    That's really cool!

  • @josephchillemi7523
    @josephchillemi7523 3 ปีที่แล้ว

    Wow, didn't know. Thank you so much!

  • @abhishekswain2502
    @abhishekswain2502 3 ปีที่แล้ว

    Thanks for this ! This is very cool 😎

  • @ahmed-salem
    @ahmed-salem 3 ปีที่แล้ว +1

    No idea who are the 25 people that dislike a video like that!!... 😂😂. Thanks man for the video.. Such a game changer!

  • @HansBaier
    @HansBaier 3 ปีที่แล้ว

    This is awesome! Thanks!

  • @sarveshdakhane6454
    @sarveshdakhane6454 2 ปีที่แล้ว

    Thanks !!..nicely explained

  • @pope-pylinux-vi
    @pope-pylinux-vi 3 ปีที่แล้ว

    Great video, thank you. Looks like you also have the same problem with pylint as I do (I mean the pop-up near the end). I have it installed but this pop-up shows up every time I start vscode. Can't figure out the cause.

  • @juliocardenas4485
    @juliocardenas4485 2 ปีที่แล้ว

    VERY useful, thank you.

  • @izzyr9590
    @izzyr9590 3 ปีที่แล้ว +1

    Wow even the debugger!
    I liked the debugger set up in Eclipse for Java. I didn’t know python had it too in VSCode! This is awesome

  • @juliocjacobo
    @juliocjacobo 3 ปีที่แล้ว

    Very good feature, and excellent video!!

  • @digigoliath
    @digigoliath 3 ปีที่แล้ว

    Awesome!!! TQVM!!

  • @DIYGURUJI
    @DIYGURUJI 3 ปีที่แล้ว

    Damn, I didn't know that before Thanks🔥🔥

  • @kwkarlwang
    @kwkarlwang 3 ปีที่แล้ว +7

    I want to inform you that I was able to get this exact feature on emacs on a normal .py file using code-cells, which recognizes # %% as a cell, and emacs-jupyter, which serves as a REPL that evaluates the python code, and is also able to render inline plot.

  • @Omgtired
    @Omgtired 3 ปีที่แล้ว +22

    Working in python in the same manner, the big advantage of this mode over notebook is that it supports all additional "syntax checkers" whereas juniper notebook mode does not

    • @hashisgod
      @hashisgod 3 ปีที่แล้ว

      juniper? :O

    • @Omgtired
      @Omgtired 3 ปีที่แล้ว

      @@hashisgod jupyter 😁 that's a typo

    • @hashisgod
      @hashisgod 3 ปีที่แล้ว

      @@Omgtired i prefer the name juniper!

  • @_free_explorer
    @_free_explorer 3 ปีที่แล้ว +2

    Wow this just changed my python programming life O_O

  • @khanhtruong3254
    @khanhtruong3254 3 ปีที่แล้ว

    That's amazing. But it seems that I can only run the interactive mode at the end of the python script, i.e. I can't come back to normal scripting unless I delete all the interactive code.
    Is there anyway to select a subset (in the middle) of the script to run interactive mode?

  • @cgabt1109
    @cgabt1109 2 ปีที่แล้ว

    This video changed my Python life, thx

  • @PaulaBean
    @PaulaBean 3 ปีที่แล้ว

    This was very helpful.

  • @Deevil992
    @Deevil992 3 ปีที่แล้ว

    Just curious if it is possible to load the python kernel in Jupyter from the terminal? That would actually do the same thing right?

  • @naturheilkunde-kanal9814
    @naturheilkunde-kanal9814 3 ปีที่แล้ว

    Sounds great!
    I tried it with my VSCode on OSX but get an error message: "Cannot open resource with notebook editor type 'jupyter-notebook', please check if you have the right extension installed or enabled."
    What extension do I need?

    • @JackofSome
      @JackofSome  3 ปีที่แล้ว

      Do you have the python extension from microsoft installed?

  • @shelupinin
    @shelupinin 3 ปีที่แล้ว

    Cool, thanx for that knowledge

  • @user-md7yv4mw7e
    @user-md7yv4mw7e 3 ปีที่แล้ว

    Is there any way to make VSCode help with function arguments as Jupyter notebook does when you press SHIFT+TAB?

  • @PraecorLoth970
    @PraecorLoth970 3 ปีที่แล้ว +12

    Well, this really looks like the Spyder IDE, at least what I remember of it. It has been a few years since I used it. And is kinda like Matlab also, but that doesn't have inline graphs. I think I will stick to notebooks still because I like having the code and the graphs in one document, and not having to re-run it in case I need to see the graphs again. In any case, one could export .ipynb files to executable .py files and very easily convert them to the format VSCode uses, just need to alter the comment lines between each cell. I haven't tested it, but seems trivial.
    I have often seen people criticize the use of notebooks because they give you bad development practices. One problem I've had more than once was re-running a notebook and getting NameErrors, often because I moved stuff around. How do you deal with that?

    • @JackofSome
      @JackofSome  3 ปีที่แล้ว +3

      I totally get the "notebook as a complete document" approach and it makes a lot of sense in many contexts. For me notebooks are more about exploration/prototyping/development and less about communication so that's why this makes more sense for me.
      Exporting .ipynb can run into issues, though nbdev is admittedly a really good solution github.com/fastai/nbdev
      No real solution for the out of order execution issues. We kind of sign up for that doing this no? A saving grace of using interactive mode is that I have access to all my normal keybindings, so restructuring code is really fast and intuitive.

    • @PraecorLoth970
      @PraecorLoth970 3 ปีที่แล้ว +1

      @@JackofSome thanks for the link, I had heard about nbdev, I think I might give it a shot, although I'm not really developing stuff recently. I do mostly data analysis, hence my preference for notebooks. I am working on consolidating some stuff to share with colleagues, and nbdev might be cool.
      I think I just need more discipline when coding, and periodically reset the environment, to catch those errors. I mean, I use notebooks for reproducibility in science, and fear rerunning them? Makes no sense.

  • @dembasiby
    @dembasiby 3 ปีที่แล้ว

    Thank you!

  • @inkt34
    @inkt34 3 ปีที่แล้ว

    Nice video, is there also a way to move the interactive notebook screen to e.g., the bottom of VS code? So that the .py file and the python interactive window are on top of each other?

    • @JackofSome
      @JackofSome  3 ปีที่แล้ว

      VSCode has horizontal stacking of windows. You'd have to Google how though I always forget

  • @HadesTimer
    @HadesTimer 3 ปีที่แล้ว

    is there anyway this can be added to your python environment by default? So I don't have to remember to add it everytime.

  • @fakt7814
    @fakt7814 ปีที่แล้ว

    Wow, I didn't know about that. Me too have been using Jupyter a lot, then I switched to a regular step debugger, but the ability to use IPython with debugger is a game changer for me.

  • @amberniesalting9011
    @amberniesalting9011 3 ปีที่แล้ว

    That's actually insane!

  • @kia4now
    @kia4now ปีที่แล้ว

    is it possible to open the interactive window seperately, to mimic floating windows? Because running out of real estate on one screen
    Great video and well explained, subscribed!

  • @sagigamil460
    @sagigamil460 3 ปีที่แล้ว

    Amazing; can I use it to run pytest tests?

  • @vitormendonca2905
    @vitormendonca2905 3 ปีที่แล้ว

    Cool but.. i'm a begginer in programing, why should i use a code editor like Visual Studio? Just for the shortcuts? (Isn't pycharm enough?)

  • @misimik
    @misimik 3 ปีที่แล้ว +1

    You can get this type of workflow with Spyder IDE with Matlab View mode, but with better current variables window.

  • @animeshsingh4290
    @animeshsingh4290 3 ปีที่แล้ว +1

    Just saw these ina a Tech with Tim video, these are some really useful features.

    • @JackofSome
      @JackofSome  3 ปีที่แล้ว

      Just found that video. Significantly better than mine :D

    • @JerryAsher
      @JerryAsher 3 ปีที่แล้ว

      Hmm, can you link to that video?

  • @MrTulufan
    @MrTulufan 2 ปีที่แล้ว

    Is there a way to save the outputs inline with the code to a file just like the jupyter notebook?

  • @SylvStone
    @SylvStone 2 ปีที่แล้ว

    nice but it does not work for me (some info is missing here). I'd have some questions, what vsCode version are you using? once managed to install mumpy and matplotlib within a PowerShell CLI rather, all I got as output for that example: 'plot([0,1,2],[0,1,4])' is: but displaying nothing.

  • @adamduma3565
    @adamduma3565 3 ปีที่แล้ว

    nice. thanks

  • @NicholasWong-vv1nn
    @NicholasWong-vv1nn ปีที่แล้ว

    Anyone know if it is possible to open the interactive tab in another window, or detach the tab from the workspace?

  • @ruysg
    @ruysg 2 ปีที่แล้ว

    That is just like a Matlab or Spyder environment, pretty cool

  • @psykowarior
    @psykowarior 3 ปีที่แล้ว

    Thanks this is usefull.

  • @giaphatha88
    @giaphatha88 3 ปีที่แล้ว +5

    Super cool! I didn t know vscode python support is so good now, time to ditch pycharm

  • @angryferret101
    @angryferret101 2 ปีที่แล้ว

    This is so fricking sublime.

  • @theoutlet9300
    @theoutlet9300 3 ปีที่แล้ว

    i cant imagine working with data in a code editor without this feature.

  • @beto5720
    @beto5720 2 ปีที่แล้ว

    Bro this is dope af

  • @Arcadius1989
    @Arcadius1989 3 ปีที่แล้ว +1

    What I lack with the python interactive shell of vscode is that it does not support vim bindings. You can't yank code from the shell, and as I have the vim extension, CTRL-C and CTRL-V dont'work. Anybody got a suggestion to fix that?

    • @JackofSome
      @JackofSome  3 ปีที่แล้ว

      I feel your pain on that. I think it's an open issue right now to allow modal editing in the shell. C-c and C-v tend to work fine for me so unfortunately no insights on that issue :(

  • @timseguine2
    @timseguine2 3 ปีที่แล้ว +1

    I never really found any personal benefit to jupyter notebooks or interactive mode in the past, because the user experience for the text editor always seemed pretty terrible, but this looks pretty slick, actually.

  • @thatcreole9913
    @thatcreole9913 3 ปีที่แล้ว +12

    Whoa! Thank you TH-cam for showing me this video and Channel!

  • @iamkapilkalra
    @iamkapilkalra 3 ปีที่แล้ว

    Fantastic! :: Chef's Kiss ::

  • @gargeyasharma4858
    @gargeyasharma4858 3 ปีที่แล้ว +5

    It's just spider IDE from anaconda distribution. But ofcourse its super cool and useful

    • @eduardoluisbaptista3297
      @eduardoluisbaptista3297 3 ปีที่แล้ว

      Exactly! As a data analyst I'm not changing from Spyder to VS just because of this, to be honest.

  • @xSid19x
    @xSid19x 2 ปีที่แล้ว

    How do you escape out of the interactive cell?

  • @TunioMir
    @TunioMir 3 ปีที่แล้ว

    Correct me if I'm wrong but Spyder (in Anaconda) has been doing this for years right?

  • @cenkulukaya
    @cenkulukaya 3 ปีที่แล้ว +1

    This was the only reason I was using Sublime. That was eye opening. Thank you.

  • @artistscientist2848
    @artistscientist2848 3 ปีที่แล้ว

    @Jack Of Some
    Does someone know the keyboard shortcut move the cursor from the editor to the console where we can type code?

    • @JackofSome
      @JackofSome  3 ปีที่แล้ว

      Unfortunately no. Sorry

  • @talkingbirb2808
    @talkingbirb2808 หลายเดือนก่อน

    update: interactive mode does not generate svg images now and it is advised to use %matplotlib widget or something similar instead

  • @cloutQ51
    @cloutQ51 3 ปีที่แล้ว

    great man

  • @williambaumert7726
    @williambaumert7726 2 ปีที่แล้ว

    Wow this is really cool It's! It's very similar to rstudio's Rmarkdown interface!

  • @lucagreggio2278
    @lucagreggio2278 3 ปีที่แล้ว +6

    This is like matlab, it's crazy, make me discover an incredible thing!

    • @TileBitan
      @TileBitan 3 ปีที่แล้ว

      it doesnt take 2 lifetimes to open tho! nothing beats the original xd

  • @yash1152
    @yash1152 11 หลายเดือนก่อน

    1:53 yep, discovered this accidently myself some months ago. its nice.

  • @saumyakraj1462
    @saumyakraj1462 3 ปีที่แล้ว +2

    What's the shortcut to create a new cell below the current cell without executing it? Amazing and well explained video btw!!

    • @JackofSome
      @JackofSome  3 ปีที่แล้ว +1

      I'm not sure if there's a shortcut but you can just write the comment and it will split the call

    • @fakeaccount4563
      @fakeaccount4563 3 ปีที่แล้ว

      alt + enter

  • @codychan4992
    @codychan4992 3 ปีที่แล้ว

    It is really useful, is there any package like this for Emacs?

    • @JackofSome
      @JackofSome  3 ปีที่แล้ว

      Org mode has something called babel that does this. It works quite well in most cases but I've had some trouble with it too

  • @adventurousmale
    @adventurousmale 2 ปีที่แล้ว

    To enable 'shift + enter' to send line/selection to interactive window you first have to enable it in settings. This took me forever to figure out why it wasn't working right away.
    Jupyter: Send Selection To Interactive Window
    When pressing shift+enter, send selected code in a Python file to the Jupyter interactive window as opposed to the Python terminal.

    • @willfeng6149
      @willfeng6149 2 ปีที่แล้ว

      Where to do that? under python extension?

    • @willfeng6149
      @willfeng6149 2 ปีที่แล้ว

      found it, you already menetioned. "Jupyter: Send Selection To Interactive Window". Thanks!

  • @elghark
    @elghark ปีที่แล้ว

    It's the closest solution to my needs: I'm switching from Atom to VS Code and I'd like to find an equivalent way to run codes below my line script as I'm used to with Hydrogen. Doesn't exist a solution like that for VS Code?

  • @jean-baptistedelabroise5391
    @jean-baptistedelabroise5391 3 ปีที่แล้ว

    mind blowing

  • @davidvargas3731
    @davidvargas3731 3 ปีที่แล้ว +1

    Is there a quick way to remove all the `# %%` after you're done working on a file?

  • @jtadams783
    @jtadams783 3 ปีที่แล้ว +1

    I started learning python a few years ago. Thank you for reminding me how little I know.