from setuptools import setup
from my_pkg import constants
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md')) as f:
long_description = f.read()
setup(
name='my_pkg',
version=constants.MY_PKG_VERSION,
description='Pkg description',
author='Your Name',
author_email='your@ema.il',
url='http://github.com/some/user',
packages=[
'my_pkg',
'my_pkg.abstractions',
'my_pkg.exceptions',
],
long_description=long_description,
long_description_content_type='text/markdown',
include_package_data=True,
install_requires=[],
python_requires='>=3.4',
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Natural Language :: English",
"Operating System :: OS Independent",
"Development Status :: 1 - Planning",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Topic :: Software Development :: Libraries"],
package_data={
'': ['*.md', '*.txt', '*.json']
},
keywords='my_pkg',
license='MIT',
)
entry_points={
'console_scripts': ['your_command=my_pkg.cli.command_line:main'],
},
Как это сделать программно?
if row == "" or not row == "":
print('the list is empty or not empty')
print(row)
Безопасно ли использовать API-сервис сторонних разработчиков для интеграции с WhatsApp?
class A:
def __init__(self, name='default'):
self._name = name
@property
def name(self):
return self._name
@name.setter
def name(self, value):
self._name = value
a = A()
print(a.name)
a.name = 'test'
In [1]: l1 = list(range(5))
In [2]: l2 = list(range(5, 10))
In [3]: l1
Out[3]: [0, 1, 2, 3, 4]
In [4]: l2
Out[4]: [5, 6, 7, 8, 9]
In [5]: list(zip(l1, l2[1:] + [None]))
Out[5]: [(0, 6), (1, 7), (2, 8), (3, 9), (4, None)]
In [6]: list(map(lambda x, y: (x, y), l1, l2[1:] + [None] ))
Out[6]: [(0, 6), (1, 7), (2, 8), (3, 9), (4, None)]
In [7]: def foo(x, y):
....: return '%s:::%s' % (x, y)
....:
In [8]: list(map(foo, l1, l2[1:] + [None] ))
Out[8]: ['0:::6', '1:::7', '2:::8', '3:::9', '4:::None']