Skip to content

Commit

Permalink
print errant print() functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylow committed Dec 2, 2017
2 parents d28e21c + 6b2fb33 commit 324d0b2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions examples/tweet.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

__author__ = '[email protected]'

from __future__ import print_function

try:
import configparser
except ImportError as _:
Expand All @@ -15,6 +17,7 @@
import twitter



USAGE = '''Usage: tweet [options] message
This script posts a message to Twitter.
Expand Down Expand Up @@ -52,7 +55,7 @@


def PrintUsageAndExit():
print USAGE
print(USAGE)
sys.exit(2)


Expand Down Expand Up @@ -143,11 +146,11 @@ def main():
try:
status = api.PostUpdate(message)
except UnicodeDecodeError:
print "Your message could not be encoded. Perhaps it contains non-ASCII characters? "
print "Try explicitly specifying the encoding with the --encoding flag"
print("Your message could not be encoded. Perhaps it contains non-ASCII characters? ")
print("Try explicitly specifying the encoding with the --encoding flag")
sys.exit(2)
print "%s just posted: %s" % (status.user.name, status.text)

print("{0} just posted: {1}".format(status.user.name, status.text))

if __name__ == "__main__":
main()

0 comments on commit 324d0b2

Please sign in to comment.