Preview:
# ライブラリの読み込み
import tweepy

#****には自身のコードを入力してください
CONSUMER_KEY = '****'
CONSUMER_SECRET = '****'
ACCESS_TOKEN = '****'
ACCESS_SECRET = '****'

#twitter認証
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_TOKEN, ACCESS_SECRET)
api = tweepy.API(auth)

# アカウント指定(Twitterアカウントの@以降の英数字)
Account = '****'

# アカウントの内部IDを取得する
inner_id = api.user_timeline(Account, count=1, page=0)[0].user.id

api.send_direct_message(recipient_id=inner_id,text='Hello world!')
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter