repository to host the colab notebook containing solutions to the IVP assignment.
from PIL import Image
import requests
from io import BytesIO
#enter URL of the image. open the image in new tab first and then copy and paste the URL here.
url = "https://marketplace.canva.com/EAFHm4JWsu8/1/0/1600w/canva-pink-landscape-desktop-wallpaper-HGxdJA_xIx0.jpg"
def getImageFromURL(url):
response = requests.get(url)
im = Image.open(BytesIO(response.content))
im.save('image.jpg')
- open any image on chrome in a new tab. it should be in the format - https://xyz.com/abcdefgh.jpg
- copy the link and paste it in the url variable. the link should be enclosed in strings.
- go to runtime tab
- select run all
- mount your drive to this colab notebook
- go to files and save a copy of this notebook.
- go to /content/drive/MyDrive/Colab Notebooks
- copy path of the copy of the jupyter notebook file and put it in place of file path
%cd /content
#run these.
!sudo apt-get install texlive-xetex texlive-fonts-recommended texlive-generic-recommended
!jupyter nbconvert --to pdf 'file_path'
- go to file->print and save file as pdf
- Download file as jupyter notebook under files.
- open in VS Code after installing the jupyter extension for vs code
- go to the 3 dots on the top shelf and choose export and then export as HTML
- open the HTML file and save it as PDF