"I have a simple mission: To create an open-source, non-linear video editor for Linux. Many have tried and fallen before me, but for some reason I feel compelled to try myself. I am documenting my journey in this blog for all to read. It will be a dangerous journey, and I might not make it back alive. Hold on tight, and enjoy the ride! By the way, I'm calling this project OpenShot Video Editor!"

Have you ever run into a problem where your favorite Python IDE can't determine the type of a variable, and thus you get no auto-completion? There is a built-in function in Python called isInstance(your_variable, type_of_variable) that is designed to compare a variable to a class type, and return true or false. However, just the presence of this function will give many IDEs all the information they need to determine the type of your variable, and thus give you better auto-completion.

For example, imagine you had a function that returned a gtk.Window.
MyWindow = GetMyWindow()

Most IDEs would not correctly determine the type of MyWindow. To solve this, try the following code:

MyWindow = GetMyWindow()
isInstance(MyWindow, gtk.Window)

There are many articles that point out the dangers of using isInstance, however if you are simply using it like my example, it shouldn't cause any problems.

1 comments

  1. Ithai  

    Just found your blog and it's so good to know I'm not alone. Yes - Linux needs a decent NLE and no, Cinelerra is not good enough. If we're going to have the linux alternative for Final Cut or Vegas I'm going to be one very happy camper.

Post a Comment

Subscribe to: Post Comments (Atom)