attachment
attachment

please create a colorful handbook pdf from the photo information attached.Write list of those vocabulary words along with their meanings from exercise 2 and exercise 3 under headline "Vocabulary" .

analyse_media
Reading File
Browsing Directory

~/

Running Command

mkdir -p "/tmp/workspace/vocabulary-handbook/output" 

Reading File
Running Command

python -c "from reportlab.lib.pagesizes import A4; from reportlab.lib import colors; from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle; from reportlab.lib.enums import TA_CENTER; from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak, KeepTogether; from reportlab.lib.units import cm; from reportlab.pdfbase.ttfonts import TTFont; from reportlab.pdfbase import pdfmetrics; import os out='/tmp/workspace/vocabulary-handbook/output/Vocabulary_Handbook_Describing_People.pdf' # content transcribed from exercises 2 and 3 ex2=[ ('full of herself','too proud or self-important; thinking she is better than others.'), ('confide in','to tell someone private thoughts, worries, or secrets because you trust them.'), ('prone to','likely to do, have, or suffer from something.'), ('keep oneself to oneself','to avoid socialising much or sharing personal matters with others.'), ('lighten up','to become less serious, strict, or easily upset.'), ('take everything in one\'s stride','to deal with problems calmly and without becoming upset.'), ('sheltered upbringing','a childhood protected from difficult experiences or the wider world.'), ('have an agenda','to have a hidden aim or personal motive.'), ('get dragged down','to become discouraged, unhappy, or negative because of difficulties.'), ('rub off on other people','to spread or pass a quality, habit, or mood to others.'), ('conscientious','careful, responsible, and thorough about doing things properly.'), ('stick to one\'s guns','to refuse to change one\'s views or decision under pressure.')] ex3=[ ('bubbly','cheerful, lively, and full of enthusiasm.'), ('loner','a person who prefers to spend time alone.'), ('approachable','friendly and easy to talk to.'), ('prickly','easily offended, irritated, or defensive.'), ('stubborn','unwilling to change an opinion or course of action.'), ('arrogance','an attitude of believing that you are better or more important than others.'), ('team player','someone who works well with other people for a shared goal.'), ('naive','too willing to believe people; lacking experience or judgement.'), ('resilience','the ability to recover quickly from difficulty or disappointment.'), ('intense','having very strong feelings or a very forceful manner.'), ('laid-back','calm, relaxed, and not easily worried.'), ('cynic','a person who tends to believe that people are selfish or dishonest.')] styles=getSampleStyleSheet() styles.add(ParagraphStyle(name='CoverTitle',parent=styles['Title'],fontName='Helvetica-Bold',fontSize=29,leading=34,textColor=colors.HexColor('#12355B'),alignment=TA_CENTER,spaceAfter=8)) styles.add(ParagraphStyle(name='Deck',parent=styles['BodyText'],fontName='Helvetica',fontSize=12,leading=16,textColor=colors.HexColor('#355070'),alignment=TA_CENTER,spaceAfter=18)) styles.add(ParagraphStyle(name='Section',parent=styles['Heading2'],fontName='Helvetica-Bold',fontSize=16,leading=19,textColor=colors.white,spaceBefore=6,spaceAfter=8)) styles.add(ParagraphStyle(name='Word',parent=styles['BodyText'],fontName='Helvetica-Bold',fontSize=10.2,leading=13,textColor=colors.HexColor('#12355B'))) styles.add(ParagraphStyle(name='Meaning',parent=styles['BodyText'],fontName='Helvetica',fontSize=9.25,leading=12.3,textColor=colors.HexColor('#263238'))) styles.add(ParagraphStyle(name='Note',parent=styles['BodyText'],fontName='Helvetica-Oblique',fontSize=8.4,leading=10.5,textColor=colors.HexColor('#52616B'))) def header(c,doc): c.saveState(); w,h=A4 c.setFillColor(colors.HexColor('#F9C74F')); c.rect(0,h-0.55*cm,w,0.55*cm,stroke=0,fill=1) c.setFillColor(colors.HexColor('#12355B')); c.setFont('Helvetica-Bold',8); c.drawString(1.5*cm,0.8*cm,'DESCRIBING PEOPLE | VOCABULARY HANDBOOK') c.setFont('Helvetica',8); c.drawRightString(w-1.5*cm,0.8*cm,f'Page {doc.page}') c.restoreState() def section(title, accent): t=Table([[Paragraph(title,styles['Section'])]],colWidths=[17.2*cm]); t.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,-1),colors.HexColor(accent)),('LEFTPADDING',(0,0),(-1,-1),10),('RIGHTPADDING',(0,0),(-1,-1),10),('TOPPADDING',(0,0),(-1,-1),6),('BOTTOMPADDING',(0,0),(-1,-1),6),('ROUNDEDCORNERS',[7,7,7,7])])) return t def vocab_table(items, light): data=[[Paragraph('<b>WORD OR PHRASE</b>',styles['Meaning']),Paragraph('<b>MEANING</b>',styles['Meaning'])]] for word,meaning in items: data.append([Paragraph(word,styles['Word']),Paragraph(meaning,styles['Meaning'])]) t=Table(data,colWidths=[5.15*cm,12.05*cm],repeatRows=1,hAlign='LEFT') ts=[('BACKGROUND',(0,0),(-1,0),colors.HexColor('#12355B')),('TEXTCOLOR',(0,0),(-1,0),colors.white),('GRID',(0,0),(-1,-1),0.35,colors.HexColor('#BDD5E7')),('VALIGN',(0,0),(-1,-1),'TOP'),('LEFTPADDING',(0,0),(-1,-1),8),('RIGHTPADDING',(0,0),(-1,-1),8),('TOPPADDING',(0,0),(-1,-1),6),('BOTTOMPADDING',(0,0),(-1,-1),6)] for r in range(1,len(data)): ts.append(('BACKGROUND',(0,r),(-1,r),colors.HexColor(light) if r%2 else colors.white)) t.setStyle(TableStyle(ts)); return t story=[] story += [Spacer(1,0.65*cm),Paragraph('Vocabulary',styles['CoverTitle']),Paragraph('Describing people: key words and expressions from Exercises 2 and 3',styles['Deck'])] story += [section('Exercise 2 | Personality expressions','#E76F51'),Spacer(1,0.22*cm),Paragraph('These expressions describe attitudes, habits, and ways of responding to life.',styles['Note']),Spacer(1,0.22*cm),vocab_table(ex2,'#FFF4EE'),Spacer(1,0.42*cm)] story += [PageBreak(),Spacer(1,0.5*cm),section('Exercise 3 | Personality adjectives and nouns','#2A9D8F'),Spacer(1,0.22*cm),Paragraph('Use these words to give your impression of someone\'s character.',styles['Note']),Spacer(1,0.22*cm),vocab_table(ex3,'#EDFAF7'),Spacer(1,0.45*cm)] call=Table([[Paragraph('<b>Study tip</b> Cover the meaning column, say the definition aloud, then make one sentence about a person you know.',styles['Meaning'])]],colWidths=[17.2*cm]); call.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,-1),colors.HexColor('#F9C74F')),('BOX',(0,0),(-1,-1),0.5,colors.HexColor('#E9A820')),('LEFTPADDING',(0,0),(-1,-1),10),('RIGHTPADDING',(0,0),(-1,-1),10),('TOPPADDING',(0,0),(-1,-1),8),('BOTTOMPADDING',(0,0),(-1,-1),8)])); story.append(call) doc=SimpleDocTemplate(out,pagesize=A4,rightMargin=1.4*cm,leftMargin=1.4*cm,topMargin=1.45*cm,bottomMargin=1.35*cm,title='Vocabulary Handbook - Describing People',author='Orris') doc.build(story,onFirstPage=header,onLaterPages=header) print(out, os.path.getsize(out))"

Browsing Directory

~/vocabulary-handbook/output

Created the colorful vocabulary handbook PDF with definitions from Exercises 2 and 3.

Vocabulary Handbook Describing People

PDF Document · PDF

This is a shared conversation. Sign in to Orris to start your own chat.