• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python utils.list_to_csv函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中tweepy.utils.list_to_csv函数的典型用法代码示例。如果您正苦于以下问题:Python list_to_csv函数的具体用法?Python list_to_csv怎么用?Python list_to_csv使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了list_to_csv函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: remove_list_members

 def remove_list_members(self, screen_name=None, user_id=None, slug=None,
                         list_id=None, owner_id=None, owner_screen_name=None):
     """ Perform bulk remove of list members from user ID or screenname """
     return self._remove_list_members(list_to_csv(screen_name),
                                      list_to_csv(user_id),
                                      slug, list_id, owner_id,
                                      owner_screen_name)
开发者ID:Xyborg,项目名称:tweepy,代码行数:7,代码来源:api.py


示例2: lookup_users

    def lookup_users(self, user_ids=None, screen_names=None, include_entities=None):
        """ Perform bulk look up of users from user ID or screenname """
        post_data = {}
        if include_entities is not None:
            include_entities = "true" if include_entities else "false"
            post_data["include_entities"] = include_entities
        if user_ids:
            post_data["user_id"] = list_to_csv(user_ids)
        if screen_names:
            post_data["screen_name"] = list_to_csv(screen_names)

        return self._lookup_users(post_data=post_data)
开发者ID:XinqiLi1992,项目名称:rickyli1992,代码行数:12,代码来源:api.py


示例3: _lookup_users

 def _lookup_users(self, user_ids=[], screen_names=[]):
     '''A wrapper around __uncached_lookup_users to store the returned Users
     in the cache'''
     try:
         users = self.__uncached_lookup_users(list_to_csv(user_ids), list_to_csv(screen_names))
         self.cache.store_users(*users)
         return users
     except TweepError, e:
         # We looked for a user that does not exist
         if 'page does not exist' in e.reason:
             return []
         raise
开发者ID:rogeliorv,项目名称:tweepy,代码行数:12,代码来源:ExtendedAPI.py


示例4: update_status

    def update_status(self, *args, **kwargs):
        """ :reference: https://dev.twitter.com/rest/reference/post/statuses/update
            :allowed_param:'status', 'in_reply_to_status_id', 'in_reply_to_status_id_str', 'lat', 'long', 'source', 'place_id', 'display_coordinates', 'media_ids'
        """
        post_data = {}
        media_ids = kwargs.pop("media_ids", None)
        if media_ids is not None:
            post_data["media_ids"] = list_to_csv(media_ids)

        return bind_api(
            api=self,
            path="/statuses/update.json",
            method="POST",
            payload_type="status",
            allowed_param=[
                "status",
                "in_reply_to_status_id",
                "in_reply_to_status_id_str",
                "lat",
                "long",
                "source",
                "place_id",
                "display_coordinates",
            ],
            require_auth=True,
        )(post_data=post_data, *args, **kwargs)
开发者ID:XinqiLi1992,项目名称:rickyli1992,代码行数:26,代码来源:api.py


示例5: remove_list_members

    def remove_list_members(self, screen_names=[], user_ids=[],
                owner_screen_name=None, owner_id=None, slug=None, list_id=None):
        if not isinstance(screen_names, list) or not isinstance(user_ids, list):
            raise TweepError('screen_names and user_ids must be list object')

        # Note:
        # Twitter API document says "up to 100 are allowed in a single request."
        # But request with 100 user IDs or screen names are always failed for over capacity.
        # So their limit is set to 50.
        if len(screen_names) > 50 or len(user_ids) > 50:
            raise TweepError('Length of screen_names or user_ids must be up to 50')

        return self._remove_list_members(
                list_to_csv(screen_names),
                list_to_csv(user_ids),
                owner_screen_name = owner_screen_name,
                owner_id = owner_id,
                slug = slug,
                list_id = list_id)
开发者ID:sechiro,项目名称:tweepy,代码行数:19,代码来源:api.py


示例6: update_status

    def update_status(self, media_ids=None, *args, **kwargs):
        """ :reference: https://dev.twitter.com/rest/reference/post/statuses/update
            :allowed_param:'status', 'in_reply_to_status_id', 'lat', 'long', 'source', 'place_id', 'display_coordinates', 'media_ids'
        """
        post_data = {}
        if media_ids is not None:
            post_data["media_ids"] = list_to_csv(media_ids)

        return bind_api(
            api=self,
            path='/statuses/update.json',
            method='POST',
            payload_type='status',
            allowed_param=['status', 'in_reply_to_status_id', 'lat', 'long', 'source', 'place_id', 'display_coordinates'],
            require_auth=True
        )(post_data=post_data, *args, **kwargs)
开发者ID:GoNexia,项目名称:tweepy,代码行数:16,代码来源:api.py


示例7: lookup_users

 def lookup_users(self, user_ids=None, screen_names=None):
     return self._lookup_users(list_to_csv(user_ids), list_to_csv(screen_names))
开发者ID:facesun,项目名称:xdtuxbot,代码行数:2,代码来源:api.py


示例8: statuses_lookup

 def statuses_lookup(self, id_, include_entities=None, trim_user=None, map_=None):
     return self._statuses_lookup(list_to_csv(id_), include_entities,
                                  trim_user, map_)
开发者ID:Xyborg,项目名称:tweepy,代码行数:3,代码来源:api.py


示例9: lookup_friendships

 def lookup_friendships(self, user_ids=None, screen_names=None):
     """ Perform bulk look up of friendships from user ID or screenname """
     return self._lookup_friendships(list_to_csv(user_ids), list_to_csv(screen_names))
开发者ID:Xyborg,项目名称:tweepy,代码行数:3,代码来源:api.py


示例10: lookup_statuses

def lookup_statuses(self, status_ids=None):
        return self._lookup_statuses(list_to_csv(status_ids))
开发者ID:amni,项目名称:twit_lab,代码行数:2,代码来源:twitterstatus.py


示例11: remove_list_members

 def remove_list_members(self, screen_name=None, user_id=None, slug=None,
                      list_id=None, owner_id=None, owner_screen_name=None):
     return self._remove_list_members(list_to_csv(screen_name),
                                   list_to_csv(user_id),
                                   slug, list_id, owner_id,
                                   owner_screen_name)
开发者ID:hqsiswiliam,项目名称:COMM031_Assignment,代码行数:6,代码来源:my_api.py


示例12: lookup_users

 def lookup_users(self, user_ids=None, screen_names=None, include_entities=True):
     return self._lookup_users(list_to_csv(user_ids), list_to_csv(screen_names), include_entities)
开发者ID:pombredanne,项目名称:tweetspiral,代码行数:2,代码来源:api.py



注:本文中的tweepy.utils.list_to_csv函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.parse_datetime函数代码示例发布时间:2022-05-27
下一篇:
Python utils.import_simplejson函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap