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 | |
from bs4 import BeautifulSoup | |
r = requests.get('http://www.nytimes.com') | |
soup = BeautifulSoup(r.text,'lxml') | |
for story_heading in soup.find_all(class_="story-heading"): | |
try: | |
string = story_heading.a.text.replace(" ",'') | |
string = string.replace('\n','') | |
print(string) | |
except: |
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 random import randint | |
cows = 0 | |
bulls = 0 | |
ONE = randint(1,9) | |
TWO = randint(1,9) | |
THREE = randint(1,9) | |
FOUR = randint(1,9) | |
sec_num = str(ONE) + str(TWO) + str(THREE) + str(FOUR) | |
while True: | |
bulls = cows = 0 |
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
prime = open(r'C:\Users\Raid7\Desktop\prac\primenumbers.txt') | |
happy = open(r'C:\Users\Raid7\Desktop\prac\happynumbers.txt') | |
primes = prime.readlines() | |
happy = happy.readlines() | |
for num in primes: | |
if num in happy: | |
print(num) |
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 | |
num = [] | |
numtoguess=0 | |
cows=0 | |
bulls=0 | |
for i in range(0,4): | |
num.append(random.randint(0,9)) | |
numtoguess = int('{}{}{}{}'.format(num[0],num[1],num[2],num[3])) | |
def doguess(): | |
global cows |
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 | |
long = input('Please enter how long you want your password to be :') | |
withsym = input('Do you want symbols in your password?(Y/N): ') | |
passwd = [] | |
passe='' | |
def dorand(): | |
global passwd | |
if withsym.lower() == 'y': | |
type = random.randint(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 | |
long = input('Please enter how long you want your password to be :') | |
withsym = input('Do you want symbols in your password?(Y/N): ') | |
passwd = [] | |
passe='' | |
def dorand(): | |
global passwd | |
if withsym.lower() == 'y': | |
type = random.randint(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
words = input('String to reverse: ').split(' ') | |
reverselist = [] | |
reversestring='' | |
numofwords = len(words)-1 | |
for x in range(0,numofwords): | |
reverselist.append(words[numofwords-x]) | |
reverselist.append(words[0]) | |
for item in reverselist: | |
reversestring += ' ' + item | |
print(reversestring) |
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 mechanize | |
import requests | |
import re | |
import logging | |
import argparse | |
import sys | |
reload(sys) | |
sys.setdefaultencoding('utf8') |
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 | |
import os | |
def clearscreen(): | |
print('\n'*50) | |
links = [] | |
print('''==== Welcome To ezme.ir URL shortener ==== | |
========= Coded By: Raid7 ========= | |
''') | |
fileorurl = input('(F)ile or (U)rl?: ').lower() | |
ProcessThis = input('File or URL to shorten: ') |
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
chars = { | |
'!':-15, | |
'"':-14, | |
'=':-13, | |
'+':-12, | |
'-':-11, | |
'*':-10, | |
'#':-9, | |
'$':-8, | |
'%':-7, |