TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #60 · 31 мар.

Вторая по частоте future-функция, которую я использовал, это абсолютный импорт from __future__ import absolute_import Что она делает? Изменения, которые вносит эта инъекция описаны в PEP328 Покажу простой пример. Допустим, есть такой пакет: /my_package /__init__.py /main.py /string.py Смотрим код в my_package/main.py # main.py import string Простой пример готов) Вопрос в том, какой модуль импортируется в данном случае? Есть два варианта: 1. модуль в моём пакете my_package.string 2. стандартный модуль string И вот тут вступает в дело приоритет импортов. В Python2 порядок следующий: помимо иных источников, раньше ищется модуль внутри текущего пакета, а потом в стандартных библиотеках. Таким образом мы импортнём my_package.string. Но в Python3 это поведение изменилось. Если мы указываем просто имя пакета, то ищется именно такой модуль, игнорируя имена в текущем пакете. Если мы хотим импортнуть именно подмодуль из нашего пакета то, мы должны теперь явно это указывать. from my_package import string или относительный импорт, но с указанием пути относительно текущего модуля main from . import string Еще одной неоднозначностью меньше 😎 Подробней про импорты здесь: https://docs.python.org/3/tutorial/modules.html #2to3#pep#basic

Резултати

Пронајдени 6 слични објави

Пребарај: #servers

当前筛选 #servers清除筛选
djangoproject

@djangoproject · Post #196 · 28.11.2016 г., 03:42

http://asyncio.readthedocs.io/en/latest/webscraper.html #Web#scraping means downloading multiple web pages, often from different #servers. Typically, there is a considerable waiting time between sending a request and receiving the answer. Using a client that always waits for the server to answer before sending the next request, can lead to spending most of time waiting. Here asyncio can help to send many requests without waiting for a response and collecting the answers later. The following examples show how a synchronous client spends most of the time waiting and how to use asyncio to write asynchronous client that can handle many requests concurrently.

djangoproject

@djangoproject · Post #327 · 30.04.2017 г., 01:28

https://www.tutorialspoint.com/python/python_networking.htm Python provides two levels of access to network services. At a low level, you can access the basic #socket support in the underlying operating system, which allows you to implement #clients and #servers for both connection-oriented and connectionless protocols.

djangoproject

@djangoproject · Post #559 · 25.01.2018 г., 09:12

https://github.com/mehrdadrad/pubdns pubdns is a library for python to have more than 28K public #dns#servers from 190+ countries at your #python script. it works based on the public-dns.info collected data and there is a wrapper based on the dnspython to resolve all type of dns records through these public dns server smoothly. #imp

djangoproject

@djangoproject · Post #463 · 10.10.2017 г., 14:08

https://uwsgi-docs.readthedocs.io/en/latest/ The uWSGI project The #uWSGI project aims at developing a full stack for building #hosting services. Application #servers (for various programming languages and protocols), proxies, process managers and monitors are all implemented using a common #api and a common configuration style. #python

djangoproject

@djangoproject · Post #437 · 11.09.2017 г., 19:13

https://httpie.org/ #HTTPie consists of a single http command designed for painless debugging and interaction with HTTP #servers, #RESTful#APIs, and web services: Sensible defaults Expressive and intuitive command syntax Colorized and formatted terminal output Built-in JSON support Persistent sessions Forms and file uploads HTTPS, proxies, and authentication support Support for arbitrary request data and headers Wget-like downloads Extensions Linux, Mac OSX, and Windows support And more…

GitHub Trends

@githubtrending · Post #15116 · 03.09.2025 г., 12:00

#other#ai#anthropic_claude#awesome#context#mcp#model_context_protocol#servers#tool_use#tools Model Context Protocol (MCP) is an open standard that lets AI models securely connect to various data sources and tools, like files, databases, APIs, and cloud services, to get real-time, relevant information. This helps AI give more accurate, up-to-date, and context-aware answers, reducing repeated data processing and improving efficiency. MCP also supports automation of complex workflows and integration with many platforms, making AI more powerful and flexible. However, running MCP servers requires careful security measures to avoid risks like unauthorized code execution. Using MCP can save time, reduce costs, and enhance AI capabilities for tasks like chatbots, data analysis, and system control. https://github.com/appcypher/awesome-mcp-servers