top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

Imports in wxpython

+1 vote

I'm playing with some code that uses the wxpython grid. Every example I have seen starts with the imports:-

 import wx
 import wx.grid as Gridlib

As Gridlib is exactly the same number of characters as wx.grid I really don't see the point. Am I missing something?

posted Feb 8, 2016 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

You're not missing anything. I've actually never seen that before (or at least never noticed). The first hit when searching "import wx.grid" is which doesn't use the "as" (but I see some hits farther down that do).

Probably the author of that code was just trying to save a dict lookup every time "wx.grid" is referenced (which has to look up "wx" in the globals and then "grid" as an attribute). Seems like an unnecessary micro-optimization to me.

answer Feb 8, 2016 by Kaushik
Similar Questions
+1 vote

I upgraded to ActivePython, and would like to get started learning about Qt and wxWidgets in Python.

I have a couple of question:

  1. Are there obvious reasons to choose either QT/PyQt or wxWidgets/wxPython? I have the impression that Qt is a richer GUI than wxWidgets, but it could just be an impression.

  2. Is there a no-brainer article that explains how to add Qt and wxWidgets to ActivePython community edition, since they're only included in the Business and Enterprise editions?

+2 votes

I am trying to load JSON data into Hive using hcatalog JsonSerDe. I have created the table, but when I use LOAD DATA INPATH command to load 8 records into the table. However, SELECT * shows 16 records in the table, each record duplicated. Why is this happening?

–2 votes

e.g. Does importing com.MyTest.* also import com.MyTest.UnitTests.*?

–4 votes

e.g. will the code containing an import such as java.lang.ABCD compile?

0 votes

i am making an app with tkinter, a module for GUI programming in python, in which i want a button to react to both mouse click as well as enter key from keyboard. is there a way to do it?

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.