Skip to content

Instantly share code, notes, and snippets.

View peace899's full-sized avatar

Peace L peace899

  • Johannesburg, ZA
View GitHub Profile
@msuryaprakash
msuryaprakash / excelapp.py
Created August 31, 2019 12:22 — forked from mikepsn/excelapp.py
Interacting with Microsoft Excel from Python using the Win32 COM API (Example Python Code)
"""
An example of using PyWin32 and the win32com library to interact
Microsoft Excel from Python.
This can be used instead of Visual Basic for Applications (VBA)
(c) Michael Papasimeon
"""
import win32com.client
@joaofig
joaofig / buffer_in_meters.py
Created August 14, 2018 09:03
Python code to convert a geographic point into a circular buffer with radius in meters.
from shapely.geometry import Point
from functools import partial
from shapely.ops import transform
import pyproj
def buffer_in_meters(lng, lat, radius):
proj_meters = pyproj.Proj(init='epsg:3857')
proj_latlng = pyproj.Proj(init='epsg:4326')
project_to_meters = partial(pyproj.transform, proj_latlng, proj_meters)
@StephenNneji
StephenNneji / custom_tabs.py
Last active September 2, 2021 20:39
Custom styled tabs in QT
import sys
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import (QApplication, QDialog, QWidget,
QLabel, QLineEdit, QHBoxLayout, QVBoxLayout, QPushButton,
QButtonGroup, QStackedLayout)
class Dialog(QDialog):
@StephenNneji
StephenNneji / demo_view.py
Last active November 1, 2023 01:55
Add checkbox in QTableView Header using icons
import numpy
from PyQt5 import QtCore, QtWidgets, QtGui
Qt = QtCore.Qt
class NumpyModel(QtCore.QAbstractTableModel):
def __init__(self, narray, parent=None):
QtCore.QAbstractTableModel.__init__(self, parent)
self._array = narray.point
self.test = narray.enabled
# !/usr/bin/env python
# -*- coding:utf-8 -*-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class overlay(QWidget):
def __init__(self, parent=None):
super(overlay, self).__init__(parent)