Skip to content

Instantly share code, notes, and snippets.

View sunilk-n's full-sized avatar
🎯
Focusing

Sunil Kumar Nerella sunilk-n

🎯
Focusing
View GitHub Profile
@sunilk-n
sunilk-n / bobOccur.py
Last active October 22, 2017 17:05
Write a program that prints number of times the word "bob" occurs in a string. For example if s = "azcbobobegghakl" Then your program should print ,"Number of times 'bob' occurs is:2"
s = "azcbobobegghakl"
check = "bob"
checker = 0
for i in range(len(s)):
try:
if s[i] == check[0] and s[i+1] == check[1] and s[i+2] == check[2]:
checker +=1
except:
pass
@sunilk-n
sunilk-n / longAlph.py
Created October 22, 2017 18:08
Write a program that prints the longest sub-string of a string in which the letters occur i alphabetical order. For example, s="azcbobobegghakl" then your program should print "Longest string in alphabetical order is: beggh"
s = "abcbcd"
alph = "abcdefghijklmnopqrstuvwxyz"
temp = 0
list = ""
fin = []
for i in range(len(s)):
if s[i] in alph:
fin.append(list)
list = list + s[i]
@sunilk-n
sunilk-n / pyQtTableView.py
Last active December 19, 2017 10:25
Listing all the path objects and inserting items to QTableView with styling
from PySide import QtCore, QtGui
import sys
import os
import re
class Application (QtGui.QMainWindow):
def __init__(self, parent=None):
super(Application, self).__init__(parent)
self.setGeometry(50, 50, 500, 500)
style = """QTableView{
from PySide import QtGui, QtCore
import os, subprocess, shutil, re
class animQt(QtGui.QMainWindow):
def __init__(self):
super(animQt, self).__init__()
self.setGeometry(250,250,360,100)
style = """
QMainWindow, QMessageBox{
@sunilk-n
sunilk-n / renderFrames
Created May 8, 2018 09:17
Maya Render frames for batch
import maya.cmds as mc
wName = "RenderFrames"
#Starting Class here
class renFrames(object):
finLst = []
cam = []
finCam = ""
def __init__(self):
#print "testing"
@sunilk-n
sunilk-n / linuxFix.py
Created August 21, 2019 06:20
File changes for linux
# moneyKart/kartDisplay/moneyKartUI.py
# Line 18 update for linux
if sys.platform.startswith('win'):
#Remains same
else:
w, h = 940, 560
# Line 89 function change
if sys.platform.startswith('win'):
# Remains same
try:
from PySide2 import QtWidgets, QtCore, QtGui
except:
from Qt import QtWidgets, QtCore, QtGui
class QWidgetList(QtWidgets.QScrollArea):
def __init__(self, parent=None):
super(QWidgetList, self).__init__(parent)
#Private attributes of QWidgetList