antonycourtney / csvview Goto Github PK
View Code? Open in Web Editor NEWSimple csv file viewer utility in Python using SlickGrid
License: MIT License
Simple csv file viewer utility in Python using SlickGrid
License: MIT License
python style guide: http://www.python.org/dev/peps/pep-0008/
says use under_scores instead of interCaps:
startRow
should be start_row
both obviously work, but why break encapsulation?
class Root(object):
pass
def startWebServer( dbName, tableName ):
root = Root()
root.tables = TableResource( dbName )
root.table_viewer = TableViewerResource()
versus:
class Root(object):
def __init__(tables, table_viewer):
self.tables = tables
self.table_viewer = table_viewer
def startWebServer( dbName, tableName ):
root = Root(TableResource( dbName ), TableViewerResource())
you can also use properties. see the @Property decorator
instead of :
mappedRow = {}
for (columnName,columnType,cellVal) in zip( self.columnNames, self.columnTypes, row ):
mappedRow[columnName] = viewFormat( columnType, cellVal )
prefer:
mappedRow = {columnName : viewFormat(columnType, cellValue) for
(columnName,columnType,cellVal) in zip( self.columnNames, self.columnTypes, row ) }
when you do this, you can introduce subtle bugs if you change the superclass because super() is not automatically called from init.
class TableViewerResource(object):
def __init__(self):
pass
if init is just a pass, I would recommend leaving out init() altogether, unless you intend to do something specific, in which case, you should also call super (note mixin- and multiple inhertience-friendly super()).
class TableView(object):
def __init__(self):
super(TableView, self).__init__()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.