File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 4
4
5
5
6
6
7
+ from __future__ import print_function
8
+
7
9
try :
8
10
import configparser
9
11
except ImportError as _ :
15
17
import twitter
16
18
17
19
20
+
18
21
USAGE = '''Usage: tweet [options] message
19
22
20
23
This script posts a message to Twitter.
52
55
53
56
54
57
def PrintUsageAndExit ():
55
- print USAGE
58
+ print ( USAGE )
56
59
sys .exit (2 )
57
60
58
61
@@ -143,11 +146,11 @@ def main():
143
146
try :
144
147
status = api .PostUpdate (message )
145
148
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" )
148
151
sys .exit (2 )
149
- print "%s just posted: %s" % (status .user .name , status .text )
150
152
153
+ print ("{0} just posted: {1}" .format (status .user .name , status .text ))
151
154
152
155
if __name__ == "__main__" :
153
156
main ()
You can’t perform that action at this time.
0 commit comments