[Python] вопрос/ответ.

Discussion in 'Python' started by De-visible, 21 Jan 2009.

  1. i~DOS

    i~DOS Member

    Joined:
    26 Mar 2009
    Messages:
    42
    Likes Received:
    40
    Reputations:
    4
    Valera_ryadom likes this.
  2. Valera_ryadom

    Valera_ryadom New Member

    Joined:
    30 Aug 2015
    Messages:
    12
    Likes Received:
    0
    Reputations:
    0
    слушай, а ты классный))). Подсовываю куки в cookies.sqlite, но чтобы браузер их увидел, нужно перезагрузить. А так норм.
     
  3. Turanchocks_

    Turanchocks_ Elder - Старейшина

    Joined:
    11 May 2013
    Messages:
    1,301
    Likes Received:
    3,161
    Reputations:
    17
    Приветствую!
    Такой трубл - при запросе help('modules') в help'e Pyton'а и в help'е IDLE (версии 2.7 и 3.0) - вместо списка модулей(как это и должно быть) появляется вот это:
    Code:
    help> modules
    
    Please wait a moment while I gather a list of all available modules...
    
    No handlers could be found for logger "OpenGL.Tk"
    /usr/lib/python2.7/dist-packages/matplotlib/cbook.py:137: MatplotlibDeprecationWarning: The matplotlib.delaunay module was deprecated in version 1.4. Use matplotlib.tri.Triangulation instead.
      warnings.warn(message, mplDeprecation, stacklevel=1)
    
    Bad key "axes.prop_cycle" on line 11 in
    /usr/share/matplotlib/mpl-data/stylelib/dark_background.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "axes.prop_cycle" on line 15 in
    /usr/share/matplotlib/mpl-data/stylelib/grayscale.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "axes.prop_cycle" on line 9 in
    /usr/share/matplotlib/mpl-data/stylelib/fivethirtyeight.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "axes.prop_cycle" on line 2 in
    /usr/share/matplotlib/mpl-data/stylelib/seaborn-dark-palette.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "axes.prop_cycle" on line 20 in
    /usr/share/matplotlib/mpl-data/stylelib/bmh.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "axes.prop_cycle" on line 2 in
    /usr/share/matplotlib/mpl-data/stylelib/seaborn-deep.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "axes.spines.right" on line 210 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.flierprops.linewidth" on line 321 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "contour.corner_mask" on line 306 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.vertical" on line 339 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.meanprops.color" on line 327 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.bootstrap" on line 312 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "ytick.minor.visible" on line 230 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.capprops.linestyle" on line 317 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "legend.facecolor" on line 266 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "axes.grid.axis" on line 173 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.patchartist" on line 334 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    /usr/lib/python2.7/dist-packages/matplotlib/__init__.py:1041: UserWarning: Bad val "None" on line #264
            "legend.framealpha    : None    # opacity of of legend frame
    "
            in file "/usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle"
            Key legend.framealpha: Could not convert "None" to float
      (val, error_details, msg))
    
    Bad key "boxplot.meanline" on line 326 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.flierprops.color" on line 319 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "axes.spines.left" on line 209 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.whiskerprops.linestyle" on line 341 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.capprops.color" on line 316 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.medianprops.linestyle" on line 331 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.flierprops.markeredgecolor" on line 323 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "axes.spines.top" on line 211 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "legend.edgecolor" on line 267 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "axes.spines.bottom" on line 208 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "axes.prop_cycle" on line 201 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.whiskerprops.linewidth" on line 342 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.medianprops.linewidth" on line 332 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.showmeans" on line 338 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.meanprops.linestyle" on line 328 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.capprops.linewidth" on line 318 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.boxprops.linewidth" on line 315 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "animation.html" on line 492 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.showcaps" on line 336 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.meanprops.linewidth" on line 329 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "figure.titlesize" on line 273 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "xtick.minor.visible" on line 219 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.boxprops.color" on line 313 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.flierprops.markerfacecolor" on line 324 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.notch" on line 333 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.boxprops.linestyle" on line 314 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "figure.titleweight" on line 274 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "markers.fillstyle" on line 20 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "axes.labelpad" on line 177 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.flierprops.marker" on line 322 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.medianprops.color" on line 330 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.showfliers" on line 337 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.flierprops.markersize" on line 325 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.whiskerprops.color" on line 340 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.flierprops.linestyle" on line 320 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.whiskers" on line 343 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "errorbar.capsize" on line 309 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "image.composite_image" on line 302 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "boxplot.showbox" on line 335 in
    /usr/share/matplotlib/mpl-data/stylelib/classic.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "axes.prop_cycle" on line 19 in
    /usr/share/matplotlib/mpl-data/stylelib/ggplot.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "axes.prop_cycle" on line 2 in
    /usr/share/matplotlib/mpl-data/stylelib/seaborn-muted.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "axes.prop_cycle" on line 2 in
    /usr/share/matplotlib/mpl-data/stylelib/seaborn-colorblind.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "axes.prop_cycle" on line 2 in
    /usr/share/matplotlib/mpl-data/stylelib/seaborn-pastel.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    
    Bad key "axes.prop_cycle" on line 2 in
    /usr/share/matplotlib/mpl-data/stylelib/seaborn-bright.mplstyle.
    You probably need to get an updated matplotlibrc file from
    http://matplotlib.sf.net/_static/matplotlibrc or from the matplotlib source
    distribution
    /usr/lib/python2.7/dist-packages/nltk/twitter/__init__.py:20: UserWarning: The twython library has not been installed. Some functionality from the twitter package will not be available.
      warnings.warn("The twython library has not been installed. "
    /usr/lib/python2.7/dist-packages/pyatspi/__init__.py:17: PyGIWarning: Atspi was imported without specifying a version first. Use gi.require_version('Atspi', '2.0') before import to ensure that the right version gets loaded.
      from gi.repository import Atspi
    There is no such reader #0, PCSC sees only 0 reader(s)
    Как быть?
     
  4. rct

    rct Active Member

    Joined:
    13 Jun 2015
    Messages:
    359
    Likes Received:
    107
    Reputations:
    7
    http://pastebin.com/4SQ3VKG2
    https://docs.python.org/3/library/warnings.html#temporarily-suppressing-warnings
     
  5. rct

    rct Active Member

    Joined:
    13 Jun 2015
    Messages:
    359
    Likes Received:
    107
    Reputations:
    7
    А еще можно так

    Python 3.2.5 (b2091e973da69152b3f928bfaabd5d2347e6df46, Sep 10 2015, 00:16:23)
    [PyPy 2.4.0 with GCC 5.2.0] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>>> help('modules')

    Please wait a moment while I gather a list of all available modules...

    CDROM _weakrefset gzip resource
    DLFCN abc hashlib rlcompleter
    IN aifc heapq runpy
    TYPES antigravity hmac sched
    __exceptions__ argparse html select
    __future__ array http shelve
    __pypy__ ast identity_dict shlex
    _abcoll asynchat idlelib shutil
    _ast asyncore imaplib signal
    _cffi_backend atexit imghdr site
    _codecs audioop imp smtpd
    _codecs_cn base64 importlib smtplib
    _codecs_hk bdb inspect sndhdr
    _codecs_iso2022 binascii io socket
    _codecs_jp binhex itertools socketserver
    _codecs_kr bisect json sqlite3
    _codecs_tw builtins keyword sre_compile
    _collections bz2 lib2to3 sre_constants
    _compat_pickle cProfile linecache sre_parse
    _continuation calendar locale ssl
    _csv cffi logging stackless
    _ctypes cgi macpath stat
    _ctypes_test cgitb macurl2path string
    _curses chunk mailbox stringprep
    _curses_panel cmath mailcap struct
    _dbm cmd marshal subprocess
    _dummy_thread code math sunau
    _elementtree codecs mimetypes symbol
    _ffi codeop mmap symtable
    _functools collections modulefinder sys
    _gdbm colorsys msilib sysconfig
    _hashlib compileall msvcrt syslog
    _io concurrent multiprocessing tabnanny
    _locale configparser netrc tarfile
    _lsprof contextlib nntplib telnetlib
    _markupbase copy ntpath tempfile
    _marshal copyreg nturl2path termios
    _md5 cpyext numbers test
    _minimal_curses crypt opcode textwrap
    _multibytecodec csv operator this
    _multiprocessing ctypes optparse threading
    _osx_support ctypes_config_cache os time
    _pickle_support ctypes_support os2emxpath timeit
    _posixsubprocess curses parser tkinter
    _pyio datetime pdb token
    _pypy_interact dbm pickle tokenize
    _pypy_irc_topic decimal pickletools tputil
    _pypy_testcapi difflib pipes trace
    _pypy_wait dis pkgutil traceback
    _pypyjson distutils platform tty
    _random doctest plistlib turtle
    _rawffi dummy_threading poplib turtledemo
    _scproxy email posix types
    _sha1 encodings posixpath unicodedata
    _sha256 errno pprint unittest
    _sha512 fcntl profile urllib
    _socket filecmp pstats uu
    _sqlite3 fileinput pty uuid
    _sre fnmatch pwd warnings
    _ssl formatter py_compile wave
    _string fractions pyclbr weakref
    _strptime ftplib pydoc webbrowser
    _struct functools pydoc_data wsgiref
    _structseq future_builtins pyexpat xdrlib
    _subprocess gc pypyjit xml
    _testcapi genericpath pyrepl xmlrpc
    _testing getopt queue zipfile
    _thread getpass quopri zipimport
    _threading_local gettext random zlib
    _tkinter glob re
    _warnings greenlet readline
    _weakref grp reprlib

    Enter any module name to get more help. Or, type "modules spam" to search
    for modules whose descriptions contain the word "spam".

    >>>>
     
  6. ArsenyPro

    ArsenyPro New Member

    Joined:
    30 Apr 2016
    Messages:
    6
    Likes Received:
    0
    Reputations:
    0
    Доброго времени суток!
    Поставил себе задачу изучения ЯП, для разных задач и платформ. Выбор пал на пайтон.
    Есть вопрос.
    Какую версию языка выбирать? Сравнялось ли кол-во модулей для 2.7 и 3.5? Ну и конечно что лучше прочесть?
     
  7. wkar

    wkar Elder - Старейшина

    Joined:
    18 Oct 2009
    Messages:
    211
    Likes Received:
    63
    Reputations:
    34
    учи питон 3, разница невелика, потом можешь прочитать в гугле в чем разница между 2 и 3.
    Сравнялось ли кол-во модулей для 2.7 и 3.5?
    какая тебе разница если ты только начал учить его ? Ты не к чему не привязан.
    http://www.diveintopython3.net/
     
    ArsenyPro and ZodiaX like this.
  8. opahopa

    opahopa New Member

    Joined:
    30 Nov 2010
    Messages:
    0
    Likes Received:
    0
    Reputations:
    0
    Приветствую. В кодинге давно но с питоном не знаком. Хочу для теста многопоточный чекер написать.
    Какие модерновые/эффективные библиотеки стоит использовать на данный момент?

    для многопоточности, для http запросов.
    смотрел:
    -asyncio
    -aiohttp
    -requests
    -eventlet

    Другие варианты? что по вашему мнению наиболее просто и эффективно? Python 3.5
     
  9. opahopa

    opahopa New Member

    Joined:
    30 Nov 2010
    Messages:
    0
    Likes Received:
    0
    Reputations:
    0
    в итоге использовал requests для запросов и ThreadPoolExecutor для многопоточности.
     
  10. mr_Coder

    mr_Coder Member

    Joined:
    1 Dec 2016
    Messages:
    39
    Likes Received:
    6
    Reputations:
    0
    Есть Grab - это обертка для pycurl и lxml, предназначеная для парсинга сйтов, для многопотчности используется Grab Spyder. Один момент, не стоит забывать про GIL, многопоточные программы на пйтоне работают медленнее)
     
  11. spize0r

    spize0r Member

    Joined:
    2 Apr 2016
    Messages:
    40
    Likes Received:
    12
    Reputations:
    4
    Подскажите как можно узнать программно кодировку возвращаемого ответа от сервера через функцию?
    s = socket.create_connection(address, timeout=self.timeout)
     
  12. mr_Coder

    mr_Coder Member

    Joined:
    1 Dec 2016
    Messages:
    39
    Likes Received:
    6
    Reputations:
    0
    Я не дома и не знаю. Но я бы для начала поставил бы breakpoint после s = socket.create_connection(address, timeout=self.timeout, и посмотрел бы в отладчике что у нас есть в переменной s. ну или полез бы в документацию.
     
  13. spize0r

    spize0r Member

    Joined:
    2 Apr 2016
    Messages:
    40
    Likes Received:
    12
    Reputations:
    4
    ок. глянул. абра кадабра вообщем там. короче вопрос для знающих Python довольно простой:
    Как автоматически определить кодировку пакетов приходящих через подключение через socket ?
     
  14. ZodiaX

    ZodiaX Reservists Of Antichat

    Joined:
    7 May 2009
    Messages:
    533
    Likes Received:
    308
    Reputations:
    51
    Ни как. Соккет возвращает данные с типом bytes, а дальше уже декодируйте во что хотите.
     
    mr_Coder likes this.
  15. spize0r

    spize0r Member

    Joined:
    2 Apr 2016
    Messages:
    40
    Likes Received:
    12
    Reputations:
    4
    Можете показать на примере кода?
     
  16. mr_Coder

    mr_Coder Member

    Joined:
    1 Dec 2016
    Messages:
    39
    Likes Received:
    6
    Reputations:
    0
    print(s.decode('utf-8'))
     
  17. spize0r

    spize0r Member

    Joined:
    2 Apr 2016
    Messages:
    40
    Likes Received:
    12
    Reputations:
    4
    Это понятно. Ну а если это HTTPS соединение? Есть способ его расшифровать?
    Тоесть соединится с сервером,
    s = socket.create_connection(address, timeout=self.timeout)
    и прочитать байты
    recv(1024)
    потом переконвертировать их в понятный вид. Браузер то их как то читает. Сертификата нет.
     
  18. mr_Coder

    mr_Coder Member

    Joined:
    1 Dec 2016
    Messages:
    39
    Likes Received:
    6
    Reputations:
    0
    Ой все!
     
  19. ronald

    ronald Elder - Старейшина

    Joined:
    27 Mar 2008
    Messages:
    252
    Likes Received:
    41
    Reputations:
    6
    Салют! Вопрос такой:
    По примеру представленного здесь кода https://moythreads.com/wordpress/2015/07/09/sending-email-with-python-without-an-mta/ хочу организовать отправку файлов на почту, всё оформляю в MIME, без проблем всё улетает, но проблема в том, что яндексовский спам-фильтр (тестирую на нём, полагаю, что и в других сервисах будет та же картина), постоянно отправляет в спам. Возможно ли как-то избавиться от данной ситуации? Отправляется xls-файл с шаблонным текстом.
     
  20. Matrix001

    Matrix001 Member

    Joined:
    18 Aug 2016
    Messages:
    192
    Likes Received:
    93
    Reputations:
    3
    Посмотри траффик :) . Может еще есть STARTTLS,TLS,SSL ( короче SSL ). ТУТ, ТУТС, ТУТ