Skip to content

Instantly share code, notes, and snippets.

View msuryaprakash's full-sized avatar

Murapaka SuryaPrakash msuryaprakash

View GitHub Profile
@msuryaprakash
msuryaprakash / global.R
Created April 26, 2019 05:13 — forked from SachaEpskamp/global.R
A general shiny app to import and export data to R. Note that this can be used as a starting point for any app that requires data to be loaded into Shiny.
library("shiny")
library("foreign")
@msuryaprakash
msuryaprakash / insert2DB.py
Created May 30, 2019 08:03 — forked from lyleaf/insert2DB.py
Insert pandas dataframe to Oracle database using cx_Oracle
"""
ATTENTION:
When using executemany with a list of tuples, the numbers representing the rows has to be strictly from 1 to the last. Or else it won't work.
I really don't understand why.
"""
import cx_Oracle
from parserFWF import getConfigDF
HOTEL_CONFIG = getConfigDF() #dataframe
@msuryaprakash
msuryaprakash / excelapp.py
Created August 31, 2019 12:22
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
@msuryaprakash
msuryaprakash / erpdatapivot.py
Created September 5, 2019 04:30 — forked from pythonexcels/erpdatapivot.py
Excel ERP Data Pivot Tables using Python
#
# erpdatapivot.py:
# Load raw EPR data, clean up header info and
# build 5 pivot tables
#
import win32com.client as win32
win32c = win32.constants
import sys
import itertools
tablecount = itertools.count(1)
@msuryaprakash
msuryaprakash / conditionalformatting.py
Created September 5, 2019 08:50 — forked from pythonexcels/conditionalformatting.py
Conditional Formatting in Excel using Python
#
# conditionalformatting.py
# Create two tables and apply Conditional Formatting
#
import win32com.client as win32
excel = win32.gencache.EnsureDispatch('Excel.Application')
#excel.Visible = True
wb = excel.Workbooks.Add()
ws = wb.Worksheets('Sheet1')
ws.Range("B2:K2").Value = [i for i in range(1,11)]
@msuryaprakash
msuryaprakash / randomcircles.py
Created September 13, 2019 11:42 — forked from dmahugh/randomcircles.py
WIN32 automation of PowerPoint
"""Requires pypiwin32 - see installation instructions at https://github.com/mhammond/pywin32
"""
import random
import win32com.client
# for other shape types, see MsoAutoShapeTypeEnumeration:
# https://msdn.microsoft.com/en-us/vba/office-shared-vba/articles/msoautoshapetype-enumeration-office
SHAPE_OVAL = 9
# for other layout options, see PpSlideLayout Enumeration:
@msuryaprakash
msuryaprakash / excel_to_json.py
Created September 13, 2019 11:42 — forked from dmahugh/excel_to_json.py
convert XLSX file to JSON
"""Example of how to convert an xlsx file to JSON.
Requirements:
- Python 3.7 or higher
- openpyxl (pip install openpyxl)
Assumptions:
- the active worksheet contains a rectangular array of data,
with column names in the first row
- the data fits in memory (makes the code below a bit simpler)
from PyQt5 import QtWidgets, QtGui, QtCore
font_but = QtGui.QFont()
font_but.setFamily("Segoe UI Symbol")
font_but.setPointSize(10)
font_but.setWeight(95)
class PushBut1(QtWidgets.QPushButton):
def __init__(self, parent=None):
from multiprocessing import Process, Queue
import uavcan
from contextlib import closing
import tkinter
def node_status_callback(event):
print('#',event.transfer.source_node_id,': ', event.message.uptime_sec)
# Messages, service requests, service responses, and entire events
@msuryaprakash
msuryaprakash / passwordgen.py
Created October 18, 2019 17:39 — forked from Der-Eddy/passwordgen.py
Password Generator tkinter
import tkinter
import random
class PWGenGui(tkinter.Frame):
def __init__(self, master=None):
self.consonants = "bcdfghjklmnpqrstvwxz"
self.vowels = "aeuoiy"
self.numbers = "0123456789"
self.symbols = "§$%&?#+"