Purpose: Yesterday in the circle of friends to see a sister paper in the group seems lovelorn. So I want to write a script to soothe sister paper.
Idea: Read txt file contents, print heart shape, etc.
#-*-Coding:utf-8-*-import sysimport mathimport timedef frange (Start, End, step=1.0): If step > 0:while Start < end : Yield start start + = Stepelif Step < 0:while Start > End:yield start start + = Stepelse:raise valueerror (' range () St EP must not is zero ') def f (x, Y, z): a = x*x + 9.0/4*y*y + z*z-1 return a*a*a-x*x*z*z*z-9.0/80*y*y*z*z*z def h (x, Z): For y in Frange (1.0, 0.0, -0.001): If f (x, Y, z) <= 0:return y return 0.0def Writefrang (): For z in Frange (1.5,-1.5,-0. 1): For x in Frange ( -1.5, 1.5, 0.05): v = f (x, 0, z) if v <= 0:y0 = h (x, z) NY = 0.01NX = h (x + NY, z)-y0nz = h (x, z + NY )-Y0th = 1.0/MATH.SQRT (nx*nx+ny*ny+nz*nz) d = (nx + ny-nz) *nd*0.5 + 0.5sys.stdout.write ('.:-=+*#%@ ' [Int (d*5)]) Else:sys . Stdout.write (') sys.stdout.write (' \ n ') def writefrange1 (): For y in Frange (1.5, -1.5, -0.1): For x in Frange (-1.5, 1.5, 0.0 5): Z = x*x + y*y-1f = z*z*z-x*x*y*y*yif f <= 0:sys.stdout.write (' * ') else:sys.stdout.write (') sys.stdout.write (' \ n ') ) def start (): print "* "*80def Dee (): Print"-"*80myfile=open (" Word.txt "," rb+ ") line=myfile.readlines () for I in Range (0,13): Print Line[i] Time.sleep (3) Dee () Writefrange1 () #writefrang () Dee () for I in Range (13,174): Print Line[i] Dee () i+=2 Time.sle EP (2) Myfile.close () Writefrang ()
Effect:
Here is the TXT file content:
Face Goddess!!!!!
I probably guessed what you saw in your circle of friends.
Don't know why I want to write a few words to comfort you
The past will finally pass
Good is always in the future
Nothing's going to happen.
Maybe the next better one is waiting for you.
We all want you to be happy.
I hope you're happy.
The road ahead is very long we accompany you, this is the heart of all of us
The goddess of the face, what makes you a sad tone. That a touch of melancholy, the slightest pain, always appear in the heart.
Who once said: "Please do not lose your smile, because you do not know who is falling in love with your smile." ”
Yes. No need to be persistent, no sorrow, keep beginner's mind. Maybe at the next intersection, you meet the best of him. And those who are in a hurry to leave the people, not to return to the people, just a passer-by!
Want to find something to comfort you, eq too low but do not know what to say, the following are online to find, hoping to have a sentence for you to let go
1. Take your face to the sun, there will be no shadow.
2, do not regret, do not have to melancholy, all the natural.
3. The wound is the disgrace that others give and the illusion that oneself insists.
4. As long as you have a word, I will come. In fact, I've been.
5, my hear tbleeds for you.--I am also sad for you.
6, it's not as Bada Sall that.--things are not so bad.
7, when the tears flow down, just know, separate is another kind of understanding.
8, When love is not in the time, please say to him bless, after all, have loved.
9. Never frown, even when you are sad, because you never know who is falling in love with your smile.
10. Remember what should be remembered and forget what should be forgotten. Change what can be changed and accept what is unacceptable.
11, when you worry, you have to tell yourself, all this is false, you worry about what?
12, do not grieve, do not despair, the future road is in front, there are so many friends to accompany you to go.
13, straighten the chest to bite the bullet, life and death easy bow difficult. Even if it is not a hero, but also if a man.
14, loosen up!it ' snot worth getting upset about.--relax a bit! It is not worth the trouble for this matter.
15, do not cling to the past lovelorn. Clinging to the past lovelorn, you will also taste new feelings of lovelorn or unrequited love.
16, break up on the back of their own, a person's world also has a month to fall, there are beautiful moments, put him into memory.
17, time will slowly precipitate, some people will be in your heart slowly blurred, learn to let go, your happiness needs their own fulfillment.
18, don't say you love the most is who, life is very long, who can not predict tomorrow, perhaps your true love will wait for you in the next second.
19, everything will be better! Believe in love! You should let him feel the warmth of the world, I believe he must be strong up! Come on!
20, think of him when, think of his good, his smile. Remember once loved a person, do not take care of the end is who began betrayal, happy good.
21, lost him, and the whole world, rose garden flowers, you will be the most beautiful in the middle of a flower, there is always a person who know the beauty to stay for you.
22, the origin of the edge off, edge of the thick edge of light, not we can control. What we can do is to cherish the short time when the Karma Ji Hui.
23, lovelorn people The most lonely, bored at the occasion, focus on four arts film magazine, unconsciously self-cultivation and bourgeois sentiment on the training upgrade.
24, in fact, the sky is very blue, the clouds are always scattered, in fact, the sea is not wide, this shore even the other shore, in fact, tears are sweet, when your heart. Actually I want you to be happy every day!
25, gently wind, blowing open your frown, let all worry back to fly. Please don't go back to chase you because it's time to run, because happiness is ahead!
26, I only wish, in your ideals and hope for you to add a little encouragement, in your life when the frustration and exhaustion can give you a bit of strength and hope.
27, left to think of is a lonely picture, but please forget it. A man always has a new beginning, don't let the past tie you to the Hall of Sorrow.
28, life is constantly someone to leave and come, open your heart, perhaps you are more exciting ahead of the people waiting to enter your life, do not miss.
29, lovelorn woman most beautiful. The melancholy posture between gestures revealed undoubtedly, than Lin sister is also moving, flies bees still fart on the top of the run over?
30, good sisters, Mo Sad, damage their own harm, worry, happy smile, where there is no grass, I wish you, forever beautiful, handsome boy waiting for you.
31, some people's love, is only a "mood at the time", if the other side is wrong to this sentiment as a long-term love, is itself naïve.
32, although the thing is lost, even if it is precious and what prevention, after all, we are good, understand? This is called "Keep the Castle peak in, Hollies." I hope this matter will not affect your mood any more.
33, Love is a feeling, even if the pain also feel happy; Love is a kind of experience even if the heart will feel sweet, love is an experience, even if broken will feel beautiful. Please do not give up, and then find another one of their own world.
34, almost all things are two-sided, positive people see the sun, the negative people see is the dark. Just want to tell you: Lovelorn is not a big deal, not still I accompany you?
35, Love is the whole life, lovelorn is the premise of love, she will let me heart, but will not let me forget, I want to live well, ahead of a better scenery.
36, you will not follow the wave, in order to those who care about your friends and relatives, cheer up is your heart, for their own, but also for relatives and friends have a better tomorrow.
37, time to help us heal the wounds of the heart, and re-selected for us the Dream lover, and finally we will enjoy the happiness that should belong to the human.
38, failure is the mother of success, gain and loss between the calm, no worries, automatic monastic success, no "no" suffering. How can you suffer if you don't ask for it?
39, a person's world always need another person to do foil, he left, it is he can not afford you, believe that they will have a better tomorrow. Thanks for the flowers tomorrow is still the same open.
40, no matter what difficulties encountered, no matter how much frustration encountered, people always live in the hope, was totally disheartened, to rise in the plight, in disappointment full of hope.
41. What is a lovelorn? Gently, you go, do not regret, because as long as you wave, you will find that can not wait for the right lover, is sneaking your hand!
42, Happy is a day, not happy is also a day, we do not have the courage to flee the world, we also need to live every day, that since the choice to go through, then why not good every day!
43, Poly is the edge, scattered is not destined to have a better edge and share, scattered before there will be better Together, Mo Sad, raised his head, look ahead, the front is more beautiful dawn.
44, in fact, lovelorn no big deal, will only let us really grow up, know more, let us mature up. Can say, if we do not experience failure, it is difficult to reach the other side of success!
45, my love for you, such as surging river, and such as the flood of the yellow, and then like Sunset brilliant. I want you to love you, I can not without you, I must get you!
46, wish you always healthy and happy life, every day is a beautiful song, happy and not happy when you remember me! And we will never dry the river of friendship, and finally bless your friend health!
47, I do not want to say too much comfort words, too much encouragement to rely on their own, I just want to stay with you, let you know that no matter how, I am in your side, share your sadness and hesitation.
48, when the first sunshine of the Morning light the earth, I breathe the fresh air, the breeze blowing in the face, is so comfortable, I can not help praying: May you be happy today, open happy heart!
49, do not put the sadness on the mouth, everyone has their own story. Live not to miss yesterday, but to wait for hope, let everyone see your strong. You can live well without him.
50, mobile phone has a transfer function, you also play a bit of transfer! The unpleasant, not as the intention to transfer off, really do not you transfer to me, I hope to see you happy, that is my biggest wish.
51, each of us can be knocked down, but no one will stop us from the ground up, dear friends, let us adjust the mentality, positive facing the heart and the outside world, regain the new!
52, I am also very sad, I can help you what is busy? If you need me at any time, just call me, okay? I will accompany you, will also let you have a reliable shoulder can be on the top to cry.
53. Don't make a noise when you say goodbye. After all, two together so long, divided him will be sad, but he is more sensible, do not want to tie your or his tomorrow. Good gather good scattered, later, still is a friend.
54, your sadness, your sadness just for him. Your mood, your sadness just for him. It is a pity that you have not returned to the past. But dear, you have at least me.
55, MO Sad, Mo sad, hurt in your body pain in my heart Ah! When you go to the ends of the earth, you will find Vista, the world where there is no grass, this branch is more victory, without losing charm you say right?
56, The pursuit of life is a complete, no matter what you experience is a good or painful, the past is a life experience, there is no need to be a burden, it is your life in a valuable lesson!
57, if you are lovelorn, just remember, since lovelorn, there must be a ring out of the problem. No matter who is wrong, mind to remember a word, I have the right to love her, but, she did not love my obligations.
58, the breeze blows open your tightly the brow, the spring rain moistens your stiff countenance, lets all worry to fly backwards. Please do not go back to those who do not belong to your sorrow, run forward, because happiness is in front!
59, the world men how many, why unrequited love a grass, this only died elsewhere to find, may you see smile, crooked wry mouth, twist and twist waist, more than flowers Qiao, wish you beautiful don't fret, happily will he to forget!
60, I know your trouble, the mood may not be comfortable, do some of your own interests! Slowly forget the annoying things, let the pain gradually fade away, I believe your mood will become cheerful up.
61, forget those unhappy things! Even God thinks that sorrow and trouble are not yours. Try to make yourself come out, you will see the sun tomorrow more warm than today! Tomorrow's skies are more blue than today!
62, hate makes life paralyzed and powerless, love makes it regain new lives. Hate makes life chaotic, love makes it harmonious. Hate makes life dark, love makes it shine. Friends, let our hearts forever full of love!
63, people in the journey, who will inevitably encounter some unpleasant things, they have to learn to adjust, there is time to go to the countryside to walk in the field of mountains! Look at the vast distant sky, and feel the clear and bright mountains.
64, Lost is yesterday, Misty is tomorrow, only today is the most important, the last moment has passed, the next moment will continue, this moment to cherish, for the dream, for life, from now on, work together!
65, the end is to better start, break up is for the beautiful together, twist the body, raise your head, go forward, your handsome guy in front waiting, MO sigh, Mo Look back, romantic love beckons to you, tomorrow beautiful still.
66, you may experience a sigh of the hot summer, a full of nagging bleak autumn, a full of envy of the cold winter and a smoke filled with the tension of spring, this is not what? Just to hug the cool summer next year.
67, after leaving, loudly tell him: I love you, and you have nothing to do. Love is your right to say everything you want to say, calm your past, and then cry. After crying, leave everything behind yesterday and never touch it.
68, do not want to be sad, wish you happy every day, do not want to lose, wish you every day cheerfully, do not want sorrow, for he you do not deserve, happy, happy life will be close, to laugh, a large number of handsome men are fascinated by you, leaving a crooked neck tree. You pick the whole forest.
69, gently I come, smoothing your tightly-locked brow; Softly I go, let all sorrow go with me. Please do not linger on those who do not belong to your troubles, life every day in the continued, happy every day in the staged, may you put down the distress, happy every day!
70, is your always stay around, do not belong to your MO nostalgia, appreciate your people are waiting for you, the real accompany you for a lifetime of people are looking forward to you, happy to smile, we all love you, life is still brilliant, tomorrow is still beautiful, find a handsome guy better than him.
71, Lovelorn is everyone in life to experience, you should now be lucky just lost a life in the passer-by and not friends or relatives, cherish the possession, do not remember the lost emotion, otherwise you will only in memory of the past and lost more around the fate.
72, the most urgent to go is the most beautiful scenery, the deepest injury is the most true feelings. Although we can not change the reality of the helpless, but we may make the heart more heroic. Yang head, smile, no big deal, hope in the front, and strive to dream brilliant!
73, the feelings of the world is not clear, lovelorn is not really scary, you have intentions and perseverance, all the fate is true, after sad to cheer up, why love a flower, beautiful lover in the back, to keep happy is the most important. May you come out of sorrow and pain, Love will favor the optimistic people oh, refuels!
74, to know that in this world, life has not really loved people. Compared with these people, in life we have won the envy of a point. Although it was lost later. But our lives have become rich. Feelings become deep. Temperament from this time to become mature.
75, life is too short, why they always live unhappy. It is normal to have trouble, no trouble is not normal. If you are in a bad mood, you may want to go to a movie, you may want to listen to a piece of music, you might as well sing a song, you may want to make a phone call, you can go to prevent the sun ...
76, the pain of their own clear, their own sorrow to understand their own feelings of happiness. Perhaps the hell in his own eyes, but in the eyes of others in the church, perhaps in his own eyes of heaven, but others in the eyes of hell. Life is such a funny thing. Don't always doubt spring in others, the key lies in the adjustment of their mentality.
77, maybe you will use a new lover to apply the old wounds, but in your search for a love, sadness will come again and again, because you have his shadow in your mind, so that you can not be relieved, you may hate yourself, hate yourself can not keep his heart, but even if you do too perfect, can not keep the root, in his life you just a hasty leave.
78, life is very long, who can not predict tomorrow, maybe your true love is waiting for you in the next second. Break up to be oneself, a person's world also has the month rises month falls, also has the beautiful moment, has attributed him to the memory. Think of him, just think of his good, his smile. Remember once loved a person, do not take care of the end is who began betrayal, happy good.
79, every day is good is the greatest happiness, happiness stems from the feeling of good every day. Always worry about tomorrow's risk, always erase the shadow of yesterday, how can life be fulfilled today? The total comparison of those who can not compare, total fantasy those can not be achieved, today's mind how quiet? Any unrealistic thing, is the source of pain, the biggest killer of life is sorrow and anxiety.
80, the sentiment is two person's attitude, is not the matter which the person can decide, therefore the love is not absolutely which one can say forever, only has this hope to each other; you are in love with TA at this time, perhaps later may be separated because of discord, similarly, TA is only a little earlier than you, so TA does not love you, You must know how to give up, don't complain!
Use Python program romance to comfort your lovelorn sister paper