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 webbrowser,requests,zipfile, io | |
from bs4 import BeautifulSoup | |
def subtitles_downloader(): | |
try: | |
# Get Movie Name For Subtitles | |
movie_name = input("Enter Movie Name:") | |
#replacing spaces with hyphen to get valid link |
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 requests, random | |
from bs4 import BeautifulSoup | |
import smtplib | |
#Function to generate a random quote. | |
def random_quote(url): | |
conn = requests.get(url) | |
soup = BeautifulSoup(conn.content,'html.parser') | |
quotes = soup.find_all('a', attrs={"title": "view quote"}) | |
quotesList = [] |
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
#!/bin/bash | |
#shell script to automate project initialization | |
function create(){ | |
cd | |
python ./automation1.py $1 | |
cd path/to/your/projects/directory/$1 | |
touch Readme.md | |
git init | |
git add . | |
git commit -m "first commit" |
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
//Implementing Matrix Addition | |
class MatrixMultiplication{ | |
public static void main(String[] args) { | |
//Creating two matrices | |
int[][] a = {{1,2,3},{2,3,4}}; | |
int[][] b = {{1,2,3},{2,3,4}}; | |
//Creating empty matrix to store the result | |
int[][] sum = new int[2][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
//Implementing Singly Linked List in Java | |
class LinkedList{ | |
Node head; //Reference to the Node class to create head node of the list. | |
//Node class to create nodes. here we make static class so that main method | |
//can recoginze it. | |
static class Node{ | |
int data; | |
Node next; |
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 | |
import os | |
from github import Github | |
path = "/path/to/your/desired/projects/directory" | |
def create(): | |
folder_name = str(sys.argv[1]) | |
os.makedirs(path+folder_name) | |
username = #your github username |
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
#!/bin/bash | |
#shell script to automate project initialization. | |
function create(){ | |
cd | |
python ./automation1.py $1 | |
cd path/to/your/projects/directory/$1 | |
touch Readme.md | |
git init | |
git add . | |
git commit -m "first commit" |
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
theBoard = {'7': ' ' , '8': ' ' , '9': ' ' , | |
'4': ' ' , '5': ' ' , '6': ' ' , | |
'1': ' ' , '2': ' ' , '3': ' ' } | |
def printBoard(board): | |
print(board['7'] + '|' + board['8'] + '|' + board['9']) | |
print('-+-+-') | |
print(board['4'] + '|' + board['5'] + '|' + board['6']) | |
print('-+-+-') | |
print(board['1'] + '|' + board['2'] + '|' + board['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
def game(): | |
turn = 'X' | |
count = 0 | |
for i in range(10): | |
printBoard(theBoard) | |
print("It's your turn," + turn + ".Move to which place?") | |
move = input() |
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
# Now we will check if player X or O has won,for every move after 5 moves. | |
if count >= 5: | |
if theBoard['7'] == theBoard['8'] == theBoard['9'] != ' ': # across the top | |
printBoard(theBoard) | |
print("\nGame Over.\n") | |
print(" **** " +turn + " won. ****") | |
break | |
elif theBoard['4'] == theBoard['5'] == theBoard['6'] != ' ': # across the middle | |
printBoard(theBoard) | |
print("\nGame Over.\n") |
OlderNewer