(api, user)
| 29 | |
| 30 | |
| 31 | def tweet_picture(api, user): |
| 32 | print(f"Enter the picture path, {user.name}:") |
| 33 | pic = os.path.abspath(input()) |
| 34 | print(f"Enter the status, {user.name}:") |
| 35 | title = get_status() |
| 36 | try: |
| 37 | api.update_with_media(pic, status=title) |
| 38 | print("\nTweet with picture posted successfully!") |
| 39 | except tweepy.TweepError as e: |
| 40 | print(f"Error posting tweet with picture: {e}") |
| 41 | |
| 42 | |
| 43 | def initialize_api(): |