Father's Day: hard core programmers show love, "Dad" gas confession!

Keywords: Python github pip

In a blink of an eye, it's the third week of June, and the year 2020 is about to pass by half.

Sunday, June 21, 2020 (the first day of may in the year of gengzi (the year of rat), that is to say, tomorrow, which is also Father's Day. Father's Day, as the name suggests, is a day to thank your father. It began in the early 20th century, originated in the United States, and has been widely spread all over the world. In China, although there is no real Father's Day, everyone regards the third Sunday in June as Father's Day.

Father's love is like a mountain. Father has always been a lofty image in children's heart. Father's love is as great as mother's love. The father gives his children more love of self-reliance, self-reliance, self-confidence and tolerance, because it explains a man's love for his children. Father's love is silent, silent, introverted and implicit.

Sometimes, for programmers, we may not be good at expressing our love for our father. Then, we can only pick up our hands and knock out a line of code on the keyboard to express our love for our father.

1. Photo wall

Dependency: pip install Image clize

Use: python picture_wall.py --help

Usage: picture_wall.py [OPTIONS] [text...]  
  
//Make photo wall  
  
Arguments:  
 text... Text of picture wall, if not defined this will generage a rectangle picture wall  
  
Options:  
 -s, --font-size=INT font size of a clear value (default: 20)  
 -e, --edge-len=INT sub picture's egde length (default: 50)  
 -w, --wall-width=INT picture number of rectangle width (default: 20)  
 -l, --wall-length=INT picture number of rectangle length (default: 10)  
 -d, --pic-dir=STR picture's path (default: ./img)  
 -o, --out-dir=STR output dir (default: ./out/)  
 -p, --font-path=STR font path (default: ./demo.ttf)  
 -m, --method=STR decrator method, now accept 'alpha', 'size' (default: alpha)  
  
Other actions:  
 -h, --help Show the help

An example is as follows:

./picture_wall.py I Love U -s 30 -e 10

./picture_wall.py I love you-s 30-e 10

Project address: https://github.com/HeLiangHIT..._love

2. Python code

Print love

from turtle import *  
pensize(1)  
pencolor('red')  
fillcolor('pink')  
speed(5)  
up()  
goto(-30, 100)  
down()  
begin_fill()  
left(90)  
circle(120,180)  
circle(360,70)  
left(38)  
circle(360,70)  
circle(120,180)  
end_fill()  
up()  
goto(-100,-100)  
down()

3. Animation blessing

Github has a small project like this. It also uses Python code to print out an animation effect to send father the blessing of father's day.

The code is as follows:

Class HappyFathersDay(Scene):  
 Def construct(self):  
 happyfatherdayText=TextMobject("Happy father's Day")  
 Dot1=Dot(color=COLOR_MAP["RED_A"],point=UL+DL)  
 Dot2=Dot(color=COLOR_MAP["RED_A"],point=UR+DR)  
 Line1=Line(Dot1,Dot2)  
 self.play(ShowCreation(happyfatherdayText))#display text  
 self.play(Transform(happyfatherdayText, Line1))#Become a straight line  
 self.play(FadeOut(Line1))#Line fade

The effect is as follows:

Original text: https://blog.csdn.net/BEYONDM...

Another programmer made a reminder for Dad to pay attention to his body:

Dynamic web page of blood pressure reduction( https://cfilipek.github.io/fa... )The UI of the eight trigrams, a cup of tea and a book is floating slowly on the smiling father's head, which is also quite unique.

A very attentive design, very good.

Brother migrant workers reminds all readers that when this father's day comes, don't forget to call your father who is not around and take care of him. Even talking about your current state, your life, work, etc. is very gratifying for him.

I wish all the fathers in the world,

Happy holidays!!!

Safe and healthy!!!

Please leave a message to share your story with your father or your blessing for him.

If there are errors or other problems, please comment and correct. If you have any help, please click like + forward to share.

Welcome to the official account of the brother of migrant workers: the road of brother technology.

Posted by bseven on Sun, 21 Jun 2020 03:03:44 -0700