0
I want to create a command on the linux terminal I created a simple program ( update the linux distro ) with Python and published in Pypi but how much and downloaded and typed his name was not executed worse said that there was no command with that name made several attempts and could not.
I wanted it to run as if it were in my environment but it’s not working.
main of the program:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from subprocess import check_output, call
def process():
print('UPDATE')
update = check_output('sudo apt update', shell=True)
call('clear', shell=True)
print('UPGRADE')
upgrade = check_output('sudo apt upgrade', shell=True)
call('clear', shell=True)
if (update or upgrade == True):
call('clear', shell=True)
print('Your system is up to date')
else:
call('clear', shell=True)
print('Erro')
process()
setup py.:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import find_packages, setup
import os
import re
with open('README.md', 'rb') as f:
readme = f.read().decode('utf-8')
with open(os.path.join('__init__.py'), 'rb') as f:
init_py = f.read().decode('utf-8')
version = re.search(
'^__version__ = [\'\"]([^\'\"]+)[\'\"]', init_py, re.MULTILINE
).group(1)
author = re.search(
'^__author__ = [\'\"]([^\'\"]+)[\'\"]', init_py, re.MULTILINE
).group(1)
email = re.search(
'^__email__ = [\'\"]([^\'\"]+)[\'\"]', init_py, re.MULTILINE
).group(1)
setup(
name='upug',
packages=find_packages(),
version=version,
description='Update linux systems',
long_description=readme,
long_description_content_type="text/markdown",
author=author,
author_email=email,
url='https://github.com/ward910/UpUg',
install_requires=[],
license='MIT',
keywords=['GNU/linux', 'linux', 'python3'],
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
],
)
related: https://answall.com/questions/498357/como-definir-o-nome-do-meu-pacote-no-pypi/498366#498366
– Lucas