Skip to content
Advertisement

Tag: ubuntu

Create terminal name for execute python script in Ubuntu

I have a python file in: ‘/home/username/scripts/pyscript’ and I want set a word for execute directly this script. I want do this “python3 /home/username/scripts/pyscript/main.py arg1 arg2” but looks like this “myscript arg1 arg2” Is this posible? Thank you anyway. Answer Finally I solver with the help of @pierpaciugo I add a alias at the end of the .bashrc for make

How can I install the pylint for python2.7?

I try to install the pylint for the python2.7 which in ubuntu 18.04, but it raises an error with this words: I have been used the pip3 installed the pylint successfully for python3.6. So, how can I install the pylint for python2.7? Answer pylint still maintains support for Python 2 until maybe next year or so. But you need to

How to solve UnicodeDecodeError in Python 3.6?

I am switched from Python 2.7 to Python 3.6. I have scripts that deal with some non-English content. I usually run scripts via Cron and also in Terminal. I had UnicodeDecodeError in my Python 2.7 scripts and I solved by this. Now in Python 3.6, it doesnt work. I have print statements like print(“Here %s” % (myvar)) and it throws

How start celery worker in Django project

I have a Django project with the directory structure mentioned below. I am trying to use Celery for running tasks in the background. I have facing some trouble while running the worker. Whenever I issue the following command, I get an error. Command From the projectdirectory where manage.py resides ModuleNotFoundError: No module named ‘tasks’ From the projectdirectory where celery.py resides

Python can’t read the environment variable

I used Ubuntu16.04 When I use sudo python3 into the interactive shell it can’t read the SECRET_KEY I set it in the /etc/profile.d/project.sh project.sh After reloading it but in vain. I also set in the ~/.profile But still got the error. How do I fixed it? [EDIT] It can work in sudo -E python3 But the futher problem is that when

Python & MS Word: Convert .doc to .docx?

I found several questions that were similar to mine, but none of the answers came close to what I need. Specifications: I’m working with Python 3 and do not have MS Word. My programming machine is running OS X and cloud machine is linux/ubuntu too. I’m using python-docx to extract values from a .doc file that is sent to me

Advertisement