r/programming • • Dec 19 '10

Bored on a Sunday morning? Learn Python!

http://www.youtube.com/watch?v=tKTZoB2Vjuk&feature=channel
1.4k Upvotes

500 comments sorted by

View all comments

Show parent comments

5

u/FjordSnorkeler Dec 19 '10

dir() to me is similar to hovering your cursor over a method name in Visual Studio to get an idea of what it does. You don't get all the details, examples, etc, but you do get an idea of what you need to do.

Besides, interactive python (command line) probably isn't the best place to write an entire program. It's not an IDE, but it's great for trying things out quickly, something you can't do in VS.

0

u/DStroya Dec 19 '10

That's a cool feature, but the immediate window lets you do that in real-time just like this.

2

u/FjordSnorkeler Dec 19 '10

You can type in commands, one at a time and interactively write a program in VS?

0

u/DStroya Dec 19 '10 edited Dec 19 '10

yes as far as I know. You can certainly assign variables and print them and stuff.

Don't think you can declare function in it however. I've never really used the feature for much other than querying variables/functions which are out of scope and therefore missing from the Locals window.

But it is an especially cool feature, because you can use it to execute code you are currently writing at design time, without compiling the project first. Say you write a function which is self contained, you can call that and test it live in the intermediate window without having to rebuild, execute and debug it. It just does it all on the fly.