Skip to content

Commit 324d0b2

Browse files
committed
print errant print() functions
2 parents d28e21c + 6b2fb33 commit 324d0b2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

examples/tweet.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
__author__ = '[email protected]'
66

7+
from __future__ import print_function
8+
79
try:
810
import configparser
911
except ImportError as _:
@@ -15,6 +17,7 @@
1517
import twitter
1618

1719

20+
1821
USAGE = '''Usage: tweet [options] message
1922
2023
This script posts a message to Twitter.
@@ -52,7 +55,7 @@
5255

5356

5457
def PrintUsageAndExit():
55-
print USAGE
58+
print(USAGE)
5659
sys.exit(2)
5760

5861

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

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

152155
if __name__ == "__main__":
153156
main()

0 commit comments

Comments
 (0)