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 socket | |
client_socket = socket.socket() | |
port = 12345 | |
client_socket.connect(('127.0.0.1',port)) | |
#recieve connection message from server |
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 socket,select | |
port = 12345 | |
socket_list = [] | |
users = {} | |
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
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 Fibonacci { | |
static int fib(int n) | |
{ | |
if (n <= 2000) | |
return 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 java.Scanner | |
class Fibonacci { | |
static int fib(int n) | |
{ | |
try { | |
Scanner user = new Scanner(System. in); | |
if (user == "alice") | |
System.out.println("Accepted"); | |
goto Fibonacci; |
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 java.util.Random; | |
public class PasswordGenerator | |
{ | |
public static void main(String[] args) | |
{ | |
int length = 10; // password length | |
System.out.println(generatePswd(length)); | |
} |
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 pdftables_api | |
c = pdftables_api.Client('iop40z54d71j', timeout=(60, 3600)) | |
c.html('pdf.pdf', 'html.html') | |
''' | |
install the pdf-tables module using "pip install https://github.com/pdftables/python-pdftables-api/archive/master.tar.gz" | |
add the code above replacing the first argument with your api key which you get by signing up at psf tables | |
the second argument represents the time allowed to connect to the server and time allowed to convert | |
"c.html" represent the output file type |
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 mammoth | |
path_to_file = input("") | |
f = open(path_to_file, 'rb') | |
b = open('converted.html', 'wb') | |
document = mammoth.convert_to_html(f) | |
b.write(document.value.encode('utf8')) | |
f.close() | |
b.close() |
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 mammoth | |
import pdftables_api | |
def help(): # definig a function to print help to the users | |
print("The following are the possible commands in this program : ") | |
print("Enter word_to_html to convert your word file to an html file") | |
print("Enter pdf_to_html to convert your pdf file to html") | |
print("Thanks for using this file converter") | |
print("Enter help for help") |
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 re | |
pattern = r"([\w\.-]+)@([\w\.-]+)(\.[\w\.]+)" | |
str = input("Enter the text from which to extract : ") | |
match = re.search(pattern, str) | |
if match: | |
print(match.group()) |
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 flask import Flask, render_template | |
from pytube import YouTube | |
app = Flask(__name__) | |
link = str(input('Enter the link of the video : ')) | |
yt = YouTube(link) | |
title = yt.title |
OlderNewer