Вторая по частоте 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
goldendict-ng
下一代 GoldenDict。一款功能丰富的开源词典查找程序,支持多种词典格式和在线词典。
https://xiaoyifang.github.io/goldendict-ng/
https://forum.freemdict.com/
https://github.com/lrorpilla/jidoujisho
Japanese-Chinese dictionaries.
https://cloud.freemdict.com/index.php/s/pgKcDcbSDTCzXCs?path=%2FJAPANESE%2FJpn-Chi
recommend using that add-on for anki:
https://ankiweb.net/shared/info/1344485230
the complete guide of how to configure goldendict-ng for Japanese :
https://tatsumoto-ren.github.io/blog/setting-up-goldendict.html
create anki cards from anime
https://github.com/Ajatt-Tools/mpvacious
#dict
https://github.com/blissnd/easyxls
Convert any #spreadsheet into a Python internal #dict/#array data structure, for easy processing. Can also handle pivot tables.
For pivot table usage, header_row_start & header_col_start need to be set equal to the top left corner of the pivot table => header_row_start=8, header_col_start='c' in the included example.
Column IDs must always be lowercase chars in quotes, e.g. 'a'.
👑New Meme Contest
👑
💰Reward : 100 USDT For Top 10 People🤑
👑Contest Link : Meme Contest
⭐Steps to take Part
⭐ Follow @dict00
⭐ Like RT Quite this tweet+comments @ 3 friends
⭐ Add your #DICT meme to the comments below
⭐ Must join Telegram Channel
⭐ Send proof in Telegram group with retweet link
#MemeContest#100USDT#USDT#giveaway
🔔Note: Please do your own research (DYOR) before joining to any project.Don't send any fee or penny without doing own research
✈️Business:@ProjectPromoters✅
@lingvanexbot
Qué puede hacer este bot?
Este es un bot traductor de alta calidad basada en redes neuronales para más de 50 idiomas.
➕ Traducir cualquier texto o palabras
➕ Convertir texto a voz
➕ Dar definiciones para cualquier palabra
➕ Diccionario
➕ Buscar por ejemplos de traducciones
Idioma: Múltiple
(visto en @BotsGram_cu)
#linguistic, #translate, #define, #dictionary, #dict, #text2speech, #speech, #examples, #sentence, #words