This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class VendingMachine: | |
notes = [20, 10, 5, 1] | |
drinks = { | |
"coke": 2.00, | |
"pepsi": 3.00, | |
"water": 1.00 | |
} | |
def displayMenu(self): | |
for drink, price in self.drinks.items(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from PyQt5 import QtCore, QtGui, QtWidgets | |
class MyWidget(QtWidgets.QWidget): | |
def __init__(self): | |
super().__init__() | |
self.setWindowTitle(" ") | |
self.begin = QtCore.QPoint() | |
self.end = QtCore.QPoint() | |
self.setWindowOpacity(0.3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import sys | |
from PySide2 import QtCore, QtGui, QtWidgets | |
class Tetris(QtWidgets.QMainWindow): | |
def __init__(self, *args, **kwargs): | |
super(Tetris, self).__init__(*args, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PySide2 import QtWidgets | |
import sys | |
from urllib import urlencode | |
import urllib2 | |
import json | |
class UI(QtWidgets.QMessageBox): | |
def __init__(self, *args, **kwargs): | |
super(UI, self).__init__(*args, **kwargs) | |
self.setWindowTitle("Joke By Shameer (The Joke is not mine)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.request, json | |
_KEYWORD = 'monitor' #PUT THE NAME OF THE PRODUCT YOU WANT TO SEARCH | |
_LIMIT = 100 #PUT THE AMOUNT OF PRODUCTS YOU WANT TO SEARCH FROM | |
with urllib.request.urlopen('https://shopee.com.my/api/v4/search/search_items?by=relevancy&keyword='+_KEYWORD+'&limit='+str(_LIMIT)+'&newest=0&order=desc&page_type=search&scenario=PAGE_GLOBAL_SEARCH&version=2') as url: | |
data = json.loads(url.read().decode()) | |
for i in data['items']: | |
print('Title : '+i['item_basic']['name'].encode("ascii", "ignore").decode(),end='\n') | |
print('Stock : '+str(i['item_basic']['stock']),end='\n') | |
print('Rating : '+str(i['item_basic']['item_rating']['rating_star']),end='\n') | |
print('Rating according star : '+str(i['item_basic']['item_rating']['rating_count']),end='\n') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import instaloader | |
from instaloader import Profile | |
#to get followings of that username | |
def getfollowing(ids,lists): | |
profile = Profile.from_username(L.context, ids) | |
for followee in profile.get_followees(): #change to 'get_followers()' to get the persons followers | |
lists.append(followee) | |
def data(names): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>CSS Selector Tutorial</title> | |
<style type="text/css"> | |
*{ | |
text-align: center; | |
} | |
.space h3{ /*Every h3 Element inside .space are selected*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#uses library | |
import math | |
nums=[] | |
def check(n): | |
if '7' in str(n) or '3' in str(n): | |
print(n) | |
nums.append(int(n)) | |
def start(n): | |
for i in range(0,n+1): |