Страница 7 из 8
Добавлено: Вт, 17 января 2023, 15:57:31
dyvniy
Надеюсь дапомню как код в ipython сохранять.
Код: Выделить всё
%save current_session ~0/
%save previous_session ~1/
Добавлено: Вт, 17 января 2023, 18:17:54
dyvniy
https://github.com/microsoft/vscode-jupyter/wiki/ ... -packages-in-Jupyter-NotebooksWhen installing packages using pip, the recommended approach is to use python -m pip install instead of pip install. Refer the Installing Python Modules documentation.
Any command prefixed with ! is treated as a shell command in Jupyter cells. Thus !pip install <module> is treated as a simple shell command that translates to pip install <module>. However the recommendation is to use python -m pip install <module>. To get this desired behavior one must use
%conda install
However when installing packages in Jupyter into a conda environment, use of conda install is preferred over pip install. Hence its highly recommended that one use %conda install in jupyter notebooks when dealing with Conda enviornments.
Добавлено: Пн, 30 января 2023, 18:16:04
dyvniy
Добавлено: Пн, 7 августа 2023, 12:33:41
dyvniy
Установка:
Пример работы:
Код: Выделить всё
from pdf2docx import Converter
pdf_file = '/path/to/sample.pdf'
docx_file = 'path/to/sample.docx'
# convert pdf to docx
cv = Converter(pdf_file)
# all pages by default
cv.convert(docx_file)
cv.close()
Добавлено: Пт, 1 сентября 2023, 11:22:15
dyvniy
>>> import uuid
>>> # make a random UUID
>>> uuid.uuid4()
UUID('bd65600d-8669-4903-8a14-af88203add38')
>>> # Convert a UUID to a string of hex digits in standard form
>>> str(uuid.uuid4())
'f50ec0b7-f960-400d-91f0-c42a6d44e3d0'
>>> # Convert a UUID to a 32-character hexadecimal string
>>> uuid.uuid4().hex
'9fe2c4e93f654fdbb24c02b15259716c'
In [7]: u.bytes
Out[7]: b'}\xd5\x0b\xc7BjAz\x98\xfb=\xc2Q\xd9\xe3t'
In [8]: len(u.bytes)
Out[8]: 16
In [9]: len(u.hex)
Out[9]: 32
Добавлено: Сб, 2 сентября 2023, 17:42:27
dyvniy
Если вам необходимо создать интерактивный граф в нескольких строках кода на языке Python, используйте Pyvis.
pip install pyvis
from pyvis.network import Network
g = Network()
g.add_node(0)
g.add_node(1)
g.add_edge(0, 1)
g.show("basic.html")
https://github.com/WestHealth/pyvis