-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
116 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# program to create a binary file of records - Just like structure | ||
# made by : rakesh kumar | ||
# Compiled on : 8-July-2018 | ||
|
||
import pickle | ||
list =[] | ||
while True: | ||
roll = input("Enter student Roll No:") | ||
sname = input("Enter student Name :") | ||
student = {"roll":roll,"name":sname} | ||
list.append(student) | ||
choice= input("Want to add more record(y/n) :") | ||
if(choice=='n'): | ||
break | ||
|
||
file = open("student.dat","wb") | ||
pickle.dump(list,file) | ||
file.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# program to download pdf file from any website. | ||
#made by : rakesh kumar | ||
|
||
import urllib.request | ||
|
||
def download(tutorialName): | ||
url = 'https://www.tutorialspoint.com/' + tutorialName + '/' + tutorialName + '_tutorial.pdf' | ||
#url ="https://cbsetoday.com/wp-content/uploads/2018/05/MYSQL-ASS-4-class-XI.pdf" | ||
downloadLocation = '' | ||
|
||
pdf = urllib.request.urlopen(url) | ||
saveFile = open(downloadLocation + tutorialName + '.pdf', 'wb') # because pdf is a binary file | ||
saveFile.write(pdf.read()) | ||
saveFile.close() | ||
print('Downloaded!') | ||
|
||
if __name__ == '__main__': | ||
while True: | ||
tutorialName = input('Name of the tutorial pdf to be downloaded: ') | ||
download(tutorialName) | ||
choice = input("Do you want to download more PDF(y/n) :") | ||
if(choice =='n'): | ||
break |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#program to read a binary file of records - Just like structure | ||
# made by : rakesh kumar | ||
# Compiled on : 8-July-2018 | ||
|
||
import pickle | ||
file = open("student.dat","rb") | ||
list = pickle.load(file) | ||
print(list) | ||
file.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# program to print scatter graph on the screen | ||
# made by : rakesh kumar | ||
|
||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
x = ['Delhi','Banglore','Chennai','Pune'] | ||
y = [250,300,260,400] | ||
plt.bar(x,y) | ||
plt.show() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# program to print scatter graph on the screen | ||
# made by : rakesh kumar | ||
|
||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
x = ['Delhi','Banglore','Chennai','Pune'] | ||
y = [250,300,260,400] | ||
plt.plot(x,y) | ||
plt.show() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# program to print scatter graph on the screen | ||
# made by : rakesh kumar | ||
|
||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
x = ['Delhi','Banglore','Chennai','Pune'] | ||
y = [250,300,260,400] | ||
plt.pie(y,labels= x) | ||
plt.show() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
x = ['Delhi','Banglore','Chennai','Pune'] | ||
y = [250,300,260,400] | ||
plt.scatter(x,y) | ||
plt.show() |
Binary file not shown.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# python program to download wikipedia page | ||
# made by : rakesh kumar | ||
|
||
|
||
import requests | ||
req = requests.post('https://binarynote.com', data = {'search':'wordpress'}) | ||
req.raise_for_status() | ||
with open('wordpress.html', 'wb') as fd: | ||
for chunk in req.iter_content(chunk_size=50000): | ||
fd.write(chunk) | ||
|
||
print("File generated...") |