相关疑难解决方法(0)

在Python中,"SyntaxError:调用'print'时缺少括号"是什么意思?

当我尝试print在Python中使用语句时,它给了我这个错误:

>>> print "Hello, World!"
  File "<stdin>", line 1
    print "Hello, World!"
                        ^
SyntaxError: Missing parentheses in call to 'print'
Run Code Online (Sandbox Code Playgroud)

那是什么意思?

python python-3.x

378
推荐指数
7
解决办法
70万
查看次数

Facebook Graph API v2.0 + - /me/friends返回空,或只有使用我的应用程序的朋友

我试图用Graph API v2.0获取我的朋友姓名和ID,但数据返回空:

{
  "data": [
  ]
}
Run Code Online (Sandbox Code Playgroud)

当我使用v1.0时,以下请求一切正常:

FBRequest* friendsRequest = [FBRequest requestForMyFriends];
[friendsRequest startWithCompletionHandler: ^(FBRequestConnection *connection,
                                              NSDictionary* result,
                                              NSError *error) {
    NSArray* friends = [result objectForKey:@"data"];
    NSLog(@"Found: %i friends", friends.count);
    for (NSDictionary<FBGraphUser>* friend in friends) {
        NSLog(@"I have a friend named %@ with id %@", friend.name, friend.id);
    }
}];
Run Code Online (Sandbox Code Playgroud)

但现在我不能得到朋友!

facebook facebook-graph-api facebook-ios-sdk facebook-graph-api-v2.0

366
推荐指数
3
解决办法
24万
查看次数