导读:美国一位名叫扎拉·达尔(Zara Dar)的计算机科学女硕士放弃攻读博士学位,转而全职经营 OnlyFans 平台,成功赚取百万美元并还清学生贷款。
扎拉解释说,学术压力和经济不稳定促使她探索其他的道路。
Python 源代码如下:
import RPi.GPIO as GPIOimport timeimport imaplibimport emailimport pygame # import pygame library# define the pins that will connect to the stepper motor driver# GPIO pinspin_seq = [17, 18, 27, 22]# Setup GPIOGPIO.setmode(GPIO.BCM)for pin in pin_seq:GPIO.setup(pin, GPIO.OUT)GPIO.output(pin, False)# Motor sequencestep_seq = [[1, 0, 0, 1],[1, 0, 0, 0],[1, 1, 0, 0],[0, 1, 0, 0],[0, 1, 1, 0],[0, 0, 1, 0],[0, 0, 1, 1],[0, 0, 0, 1],]# Function to perform one stepdef step(index):for pin, value in zip(pin_seq, step_seq[index]):GPIO.output(pin, value)# Gmail IMAP server detailsUSERNAME = 'my-email@gmail.com' #replace with your emailAPP_PASSWORD = '000000' # replace with your app passwordMAIL_SERVER = 'imap.gmail.com'SENDER_EMAIL = 'no-reply@email.com' #replace with the email account you want to receive a notification from# Initialize pygame mixerpygame.mixer.init()# Load the sound filesound = pygame.mixer.Sound("sound.wav") #replace with the name of the audio file you want to playdef check_email(user, app_pwd, mail_server, sender):# connect to the server and go to its inboxmail = imaplib.IMAP4_SSL(mail_server)mail.login(user, app_pwd)mail.select('inbox')# search for the mail from the given sender and mark as unseenresult, data = mail.uid('search', None, '(FROM "{}" UNSEEN)'.format(sender))mail_ids = data[0]# if new mail, perform the stepper motor actionif mail_ids:email_ids = mail_ids.split()latest_email_id = email_ids[-1]# mark the latest email as seenmail.uid('store', latest_email_id, '+FLAGS', '(\Seen)')# Play the soundsound.play()# Rotate motor 512 stepsfor _ in range(512*4):for i in range(len(step_seq)):step(i)time.sleep(0.0007) # Motor moves fasterwhile True:check_email(USERNAME, APP_PASSWORD, MAIL_SERVER, SENDER_EMAIL)time.sleep(20) # check every 20 seconds# CleanupGPIO.cleanup()
作者:菜鸟教程
参考:https://ottrelease.org/zara-dar-viral-video/
本篇文章为 @ 场长 创作并授权 21CTO 发布,未经许可,请勿转载。
内容授权事宜请您联系 webmaster@21cto.com或关注 21CTO 公众号。
该文观点仅代表作者本人,21CTO 平台仅提供信息存储空间服务。
请扫描二维码,使用微信支付哦。