top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

Imports in wxpython

+1 vote
36 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 Google+ Share Button LinkedIn Share Button Multiple Social 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?

+1 vote

Hi,

Please, I'm working on a dashboard project and so far I am facing challenges when it comes to writing functions for my views.

The difficulty here is, how do I write functions for different parts on a template.

For instance, I want to write a function that takes a user to his profile. How do I do that?

So far this is what I came up with:

@login_required
def show_profile:
  if request.method ==GET:
   return(render, '/profile.html/')
  else:
   return (render, '/login.html/')
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...