A blog about the development and usage of GarlicSim, the open-source Pythonic framework for computer simulations.
Written by Ram Rachum, developer of GarlicSim.

GarlicSim Website

Twitter

GitHub Repository

Ram's Personal Website

26th April 2011

Text

New Wing 4 script: `instantiate`

Hey, I made a new script for Wing IDE 4. Users of Wing may want to check it out.

It’s called instantiate.

What it does is simple. Often you want to instantiate an object from a class like this:

cat_nip = CatNip()

The annoying thing about typing this is that you don’t get autocompletion for cat_nip because it doesn’t exist yet. But you do usually get autocompletion for CatNip. Hence this script: You type CatNip, execute the script, and then automatically get this line:

cat_nip = CatNip()

With the cursor already placed inside the parentheses for you to type the arguments.

The source is on GitHub:

https://github.com/cool-RR/cute-wing-stuff

Enjoy!

Comments
All content in this website is copyright © 1986-2011 Ram Rachum.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License, with attribution to "Ram Rachum at ram.rachum.com" including link to ram.rachum.com.
To view a copy of this license, visit: http://creativecommons.org/licenses/by-sa/3.0/