This is to create our resume using HTML.
Link to my resume at github : https://github.com/puspita23/puspita_utility/commit/4d27075acc0fc46dd4dee97aa55af09fbe9b612f
Here we have used HTML to create a resume page.
The code for the problem can be found here
Here is the solution to the assignment.
<!DOCTYPE html> <html> <head> <title>Resume</title> </head> <body> <h1><u>Curriculum Vitae</u></h1> <br><br><br><br> <h3>Name: </h3>Rahul Chowdhury <h3>Address: </h3> 108, Chatterjee Bagan<br> P.O. Chinsurah R.S.<br> Hooghly, 712102 <h3>Contact Details: <h4>Mobile: </h4>9804182380 <h4>Email id: </h4>rahulc93@gmail.com <h4>GitHub account: </h4><a href = https://github.com/rahulc93>rahulc93</a> </h3> <h3>Date of Birth: </h3>16th March, 1993 <h3>Father's Name: </h3>Subhashis Chowdhury <h3>Nationality: </h3>Indian <h3>Marital Status: </h3>Single <h3>Academic Qualifications: </h3> <ol type="A"> <li>Semester marks in <b>Information Technology</b> from <b>National Institute of Technology, Durgapur</b></li> <b>CGPA: </b>7.4 <li>Marks obtained in board examinations from <b>Don Bosco, Bandel</b></li> <table border = "1"> <tr> <th>Examination</th> <th>Year of appearing</th> <th>Percentage obtained</th> </tr> <tr> <td>ISC</td> <td>2011</td> <td>84.75</td> </tr> <tr> <td>ICSE</td> <td>2009</td> <td>86</td> </tr> </table> </ol> <br><br> <h3>Other Qualifications</h3> <b><u>Programming Skills</u></b> in the following languages: <ul> <li>C</li> <li>C++</li> <li>Java</li> <li>Python</li> </ul> <h3>Work Experience: </h3>Nil <h3>Languages known: </h3>English, Hindi, and Bengali. <h3>Fields of Interest: </h3>Programming, reading books, music, watching movies. </body> </html>
To view the page which we have made here using html, simply open it with any browser. For example, to view it in konqueror, just do:
$ konqueror resume.html
In this assignment we will be printing the titles of each blog post and their respective authors' names. We are printing them from this site
The code for the problem can be found here
Here is the solution to the problem.
#!/usr/bin/env python import urllib2 from bs4 import BeautifulSoup blog_url = "http://planet.fedoraproject.org/" # the link from which to read the blog posts and authors url_open = urllib2.urlopen(blog_url) # opening the URL of the blog html_source = url_open.read() # reading the html source code of the blog page and storing it into 'html_source' soup = BeautifulSoup(html_source) # passing "html_doc" into the BeautifulSoup constructor title_list = soup.find_all("div", class_="blog-entry-title") # extracting a list of all the titles from the blog author_list = soup.find_all("div", class_="blog-entry-author") # extracting a list of all the authors to the blog posts from the blog for i in range(len(title_list)): # iterating through the length of title_list soup_title = BeautifulSoup(str(title_list[i])) # passing the i-th element of title_list to BeautifulSoup costructor title = soup_title.get_text() # storing the title of the post in 'title' print "Title: ", title # printing the title of the post soup_author = BeautifulSoup(str(author_list[i])) # passing the i-th element of author_list to BeautifulSoup constructor author = soup_author.div.a.get_text() # storing the author's name in 'author' print "Author: ", author # printing the author's name print "" # printing a newline
To run this program, save the code as planetparser.py, and follow the steps
Change the file's permissions and make it executable:
$ chmod +x planetparser.py
Execute the file:
$ ./planetparser.py
Alternatively, you can also do:
$ python planetparser.py
A link to the source code.
Using unordered list
<ul> <li>a <li>b <li>c </ul></dd>
Using definition list & links
<dl> <dt>GitHub</dt> <dd><a href='https://github.com/m0rin09ma3/python-summer-training-2013/tree/master/html' target='blank'>m0rino9ma3 github</a></dd> <dt>Blog</dt> <dd><a href='http://m0rin09ma3.wordpress.com' target='blank'>m0rin09ma3 blog</a></dd> <dt>Mailto</dt> <dd><a href='mailto:shungoh.kaetsu@gmail.com'>Send email</a></dd> </dl>
The assignment was to display all the blog post title and author from Planet Fedora in the terminal.
The script is completely able to do this job and for extra it can show user the links to blogposts if needed.
1 #!/usr/bin/env python 2 import feedparser 3 import sys 4 5 def error(): 6 """ 7 Function for any kind of argumental error handling 8 """ 9 print 'Usage: ./rss2parser.py [LINK] [OPTION](optional)'+'\n' 10 print './rss2parser.py: error: you must provide URL like: http://planet.fedoraproject.org/rss*.xml'+'\n' 11 print '[OPTION]'+'\n' 12 print '-l or --link' 13 print ' Print links the posts' 14 sys.exit(-1) 15 16 17 18 def make_food(link, flag=0): 19 """ 20 Function to display post titles, respective author and original link to the posts(optional) 21 """ 22 #Parsing the rss20.xml document 23 feed = feedparser.parse(link) 24 #Counting total posts 25 total_posts = len(feed.entries) 26 #Counter for loop 27 count = 0 28 29 #Loop to do the job 30 while count < total_posts: 31 32 #Fectching author & post titles from 'feed' object 33 author_title = feed.entries[count].title 34 35 #List index 36 i=0 37 length= len(author_title) 38 author='' 39 post_title='' 40 41 #Fetching author 42 while author_title[i] != ':': 43 author = author + author_title[i] 44 i +=1 45 #Fetching title 46 while i < length: 47 post_title = post_title + author_title[i] 48 i +=1 49 count += 1 50 51 #Printing 52 print str(count) + ': Post Title' + post_title 53 print ' Author: ' + author 54 55 #It is optional part when argument -l or --link given then only it will be execute and show all the link to the respective posts 56 if flag == 1: 57 post_link=feed.entries[count-1].link 58 print ' Link: ' + post_link + '\n' 59 60 if __name__ == '__main__': 61 arg = len(sys.argv) - 1 62 if arg == 0 or arg > 2: 63 error() 64 if arg == 1: 65 make_food(sys.argv[1]) 66 sys.exit(0) 67 if arg == 2: 68 if sys.argv[2]=='-l' or sys.argv[2]=='--link': 69 make_food(sys.argv[1], 1) 70 sys.exit(0) 71 else: 72 error()
$ ./planetfeedparser.py [LINK] [OPTION](optional)
Link must be like: link1 or link2
Options available are: -l or --link, to display the links to blogposts
Run the above script like:
$ ./planetfeedparser.py http://planet.fedoraproject.org/rss10.xml -l
or:
$ python planetfeedparser.py http://planet.fedoraproject.org/rss20.xml
Here example output is given below:
sudip@sudip-mint planetfeedparser $ (master) python planetfeedparser.py http://planet.fedoraproject.org/rss10.xml --link 1: Post Title: Converting LibreOffice dialogs to .ui format, 300 conversions milestone Author: Caolán McNamara Link: http://blogs.linux.ie/caolan/2013/07/15/converting-libreoffice-dialogs-to-ui-format-300-conversions-milestone/ 2: Post Title: The GNOME pants are still alive? Author: Thomas Vander Stichele Link: http://thomas.apestaart.org/log/?p=1559 3: Post Title: How XMir and Mir fit together Author: Matthew Garrett Link: http://mjg59.dreamwidth.org/26254.html 4: Post Title: Linux init-systems Author: Daniel Pocock Link: http://danielpocock.com/linux-init-systems 5: Post Title: Fedora 20 kommt ohne SendMail Author: Fedora-Blog.de Link: http://feedproxy.google.com/~r/Fedora-blogde/~3/rAjpi5VdAhQ/ 6: Post Title: Week-end hacks Author: Bastien Nocera Link: http://www.hadess.net/2013/07/week-end-hacks.html
Html training doc. Code in GitHub
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>About Josep Caselles</title> 5 </head> 6 <body> 7 <div id="container" style="width:700px"> 8 <div id="header" style="text-align:center" > 9 <h1>Josep Caselles</h1> 10 <h2>About me</h2> 11 </div> 12 <div id="Content"> 13 <div id="General" style="width:350px;float:left;padding-right:50px" > 14 <p>Josep Caselles is the nickname for Arnau Orriols, pianist by profession. 15 I'm graduated at Catalonia's Superior School of Music, at Barcelona. 16 Currently I combine my concertist life with teaching work in a musical 17 school.</p> 18 <p>I've been into software development for two years now. 19 I started in a corricular course in college learning basic c++, 20 and after that, mostly self-training, I 've started to learnt to 21 develop Android applicatons with Java and the Android API. Apart from 22 that, I've managed to learn everything I could about FOSS and Linux systems. </p> 23 <p>My main goal nowadays is to find somewhere to take my carreer where these 24 poles of my life converge. All suggestions are much appreciated :)</p> 25 </div> 26 <div id="resume" style="width:280px;float:left;padding:5px"> 27 <h2>Resume</h2> 28 <hr> 29 <h3>Contact</h3> 30 <p>Arnau Orriols</p> 31 <p>josepcaselles@gmail.com</p> 32 <p>Barcelona, Spain.</p> 33 <h3>Education</h3> 34 <ul> 35 <li>Piano Interpretation Degree</li> 36 <li>Some other stuff</li> 37 </ul> 38 </div> 39 </div> 40 </div> 41 42 </body> 43 </html>
To create a resume using html tags.
<!DOCTYPE html> <html> <head> <title>Resume</title> </head> <body> <h1><ins>Shantanu Sarkar</ins></h1> <hr> <pre> <h2>Bio Data:</h2> Name:- <b>Shantanu Sarkar</b> sex:- Male D.O.B:- 21st February 1994 Address:- Boys Hostel,Dr.B.C.Roy Engineering College,Durgapur,West Bengal. Phone no:- +91 8653245483 Email:- shantanusarkar.me@gmail.com <hr> <h2>Education</h2> <b> Krishna Sudarshan Central School, Bokaro, Jharkhand</b> Passed class 10th. Year- 2010 CGPA- 9.0 <b> Guru Gobing Singh Public School, Bokaro, Jharkhand</b> Passed class 12th. Year- 2012 Percentage- 84% <b> Dr.B.C.Roy Engineering College,Durgapur,West Bengal.</b> B. Tech. in Computer Science and Engineering, Year- 2012-2016 CGPA- 7.81 (1st semester) <hr> <h2>Technical Skills</h2> Operation Systems: GNU/Linux, Windows Programming Languages: C, C++, Python. <hr> <h2>Blog</h2> http://shantanusarkarme.wordpress.com </pre> </body> </html>
To go to the codes click here
To see the output click here
A link to the source code.
<!DOCTYPE html> <html> <head> <title>RESUME</title> </head> <body> <h1><b>RESUME</b></h1> <h1>work1</h1> <p> <h2>company1</h2> ABC company </p> <h1>work2</h1> <p> <h2>company2</h2> XYZ company </p> <h1>education</h1> <p> <h2>university</h2> XXX university </p> <h1>skills</h1> <p> <h2>technical</h2> a, b, c </p> </body> </html>