抱歉,标题不清楚。
我的意思是:如果我有一个变量,我们将其称为a,其值为“ Hello \ nWorld”,它将写为
var a = "Hello\nWorld
Run Code Online (Sandbox Code Playgroud)
如果我要打印它,我会得到
Hello
World
Run Code Online (Sandbox Code Playgroud)
我如何将其打印为:
Hello\nWorld
Run Code Online (Sandbox Code Playgroud) 我正在制作一个自动转发和收藏任何包含关键字“澳大利亚”的机器人
我能够成功地重新推文并自动收藏该推文,但我不知道如何自动关注它们(关注我自动重新推文的每个人)
search_results = twitter.search(q='Australia', count=10)
try:
for tweet in search_results["statuses"]:
try:
twitter.retweet(id = tweet["id_str"])
twitter.create_favorite(id = tweet["id_str"])
twitter.create_friendship(user_id=?????)
except TwythonError as e:
print (e)
except TwythonError as e:
print (e)
Run Code Online (Sandbox Code Playgroud) 不确定是什么导致这个......
我使用"Pillow-3.3.0.win32-py34.exe"安装文件运行Python 3.4.3.
导入图像时带
from PIL import Image
Run Code Online (Sandbox Code Playgroud)
我尝试使用"a.jpg"作为我的图像
img = Image.open("a.jpg")
Run Code Online (Sandbox Code Playgroud)
但是我收到这个错误,
>>> img = Image.open("a.jpg")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python34\lib\site-packages\PIL\Image.py", line 2289, in open
preinit()
File "C:\Python34\lib\site-packages\PIL\Image.py", line 365, in preinit
from PIL import JpegImagePlugin
File "C:\Python34\lib\site-packages\PIL\JpegImagePlugin.py", line 40, in <modu
le>
from PIL import Image, ImageFile, TiffImagePlugin, _binary
File "C:\Python34\lib\site-packages\PIL\TiffImagePlugin.py", line 50, in <modu
le>
from fractions import Fraction
File "C:\Python34\lib\fractions.py", line 6, in <module>
from decimal import Decimal …Run Code Online (Sandbox Code Playgroud)