This file contains hidden or 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 socket, sys, threading | |
PORT = 4444 | |
class ChatServer(threading.Thread): | |
def __init__(self, port, host='192.168.1.3'): | |
threading.Thread.__init__(self) | |
self.port = port | |
self.host = host | |
self.server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
self.users = {} | |
try: |
This file contains hidden or 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 socket | |
import sys | |
import argparse | |
host='localhost' | |
def echo_client(port): | |
sock=socket.socket(socket.AF_INET,socket.SOCK_STREAM) | |
server_address=(host,port) | |
print("connection to {} port {}".format(host,port)) | |
sock.connect(server_address) | |
This file contains hidden or 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 time,sys | |
def progbar(increment,num): | |
if increment==num: | |
print(" Completed") | |
pass | |
else: | |
for i in range(1,10): | |
if increment==int(num/10): | |
This file contains hidden or 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,time,os,hangman_pic | |
def exit_question(): | |
answer=input("do you wanna play again.Y/N:") | |
if answer.upper()=="N": | |
print("See you later bro") | |
time.sleep(2) | |
exit() | |
else: | |
game() |
This file contains hidden or 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 bs4 import BeautifulSoup,SoupStrainer | |
import urllib.request | |
import colorama,re,queue,threading | |
from colorama import Fore | |
from urllib.parse import * | |
class check_link(): | |
def __init__(self,address): | |
self.address=address | |
def check(self,address): |
This file contains hidden or 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 urllib.request import urlopen | |
from bs4 import BeautifulSoup | |
import re | |
import random | |
import mysql.connector | |
global num | |
num=0 | |
def getlinks(articleurl): | |
html=urlopen("http://en.wikipedia.org{}".format(articleurl)) | |
response=BeautifulSoup(html,"html.parser") |
This file contains hidden or 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
******************************************************************************* | |
/*account header file*/ | |
******************************************************************************* | |
#ifndef ACCOUNT_H | |
#define ACCOUNT_H | |
#include <iostream> | |
#include <iomanip> | |
#include <string> | |
#include "transaction.h" |
This file contains hidden or 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 numpy as np | |
import pylab | |
import mahotas as mh | |
from skimage import measure | |
sky=mh.imread('sky.jpeg') | |
pylab.imshow(sky) | |
t=mh.thresholding.otsu(sky.astype('uint8')) | |
labeled,stars=mh.label(sky>t) | |
print stars | |
pylab.imshow(labeled) |
This file contains hidden or 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 tkinter import * | |
import os | |
from tkinter.filedialog import askdirectory | |
from tkinter import messagebox | |
import subprocess | |
def content_analyser(pat): | |
with open(pat,'r') as f: | |
try: | |
for line in f: | |
if search in line: |
This file contains hidden or 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 mysql.connector | |
from mysql.connector import errorcode | |
import re | |
from prettytable import PrettyTable | |
def new_record(): | |
s="" | |
a="" | |
b="" | |
print("Please enter the table name") |