top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Imports in wxpython

+1 vote
310 views

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 http://wxpython.org/Phoenix/docs/html/grid_overview.html 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 2.7.2.5, 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

Elective 1 options: Artificial neural networks, digital image processing, statistical machine learning
Elective 2 options : genetic algorithm and its application, computer vision

...