Questions tagged [python]

Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability.

Filter by
Sorted by
Tagged with
0
votes
0answers
3 views

Pygame wont stream audio over Bluetooth while other applications will

I am having trouble getting pygame to stream audio to a Bluetooth speaker using bluealsa, other programs such as aplay and mpd work completely fine however when initialising pygame's mixer it will ...
0
votes
2answers
26 views

How to run a python cmd inside a bash cmd over ssh

When I run the following in my bash terminal, it works fine. $ bash -c "python -c \"print 'helloworld'\"" ---> helloworld However when I try to do this over ssh, it give me nothing, can someone help ...
0
votes
0answers
18 views

Not able to install python 3 on Turnkey LAMP

I am struggling to install python 3 and I am using Turnkey LAMP(OS). The current version that I have is : Linux lamp 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u5 (2017-09-19) x86_64 GNU/Linux When ...
0
votes
0answers
5 views

How can i customise some words within a text widget in Tkinter?

I'm creating a simple editor for my language ,and i wanna change the color or the font for specific words reserved to my languages (Just like editors (if ,else, ...)) Here is a class snippet : class ...
0
votes
1answer
35 views

Plenty of missing python package

In my whole life, when I installed a software, his dependancies link has installed all the python things that he needs to, so it can run right after the installation But now on my PC, I don't know ...
0
votes
1answer
32 views

Unable to daemonise python script using systemd - No module named 'oandapyV20'

I'm trying to daemonise a python script using systemd, but constantly get the error "No module named 'oandapyV20'" after activating the daemon. The script is at location: /home/user/workingdir/script....
1
vote
2answers
43 views

How can I run Python script once a day if computer is on and it has a connection to the Internet?

I would like to run a Python script every day if my computer is on and it has been connected to the Internet. How can I do it? My effort is 00 14 * * * python3 /home/jaakko/.config/spyder-py3/temp....
0
votes
1answer
17 views

Problem about using update-alternatives --config python to change version

(base) xywang@xywang-UX430UQ:~$ python -V Python 3.7.6 (base) xywang@xywang-UX430UQ:~$ sudo update-alternatives --config python There are 4 choices for the alternative python (providing /usr/bin/...
-1
votes
0answers
8 views

Python question: how to check age of files/keys and compare with index

I have a some files that have the structure: key1.pem key2.pem key3.pem keyn.pem How can I check if the key with the highest index is also the youngest file?
2
votes
2answers
120 views

Install virtualenv for python2.7 on debian 10

I want to use python2.7 with virtualenv. I recently upgraded from debian 8 to debian 10. I originally had python2.7 and pip installed on debian 8, but maybe something happened during the installation ...
0
votes
1answer
29 views

How can(should) I convert .py files to a windows .exe file on a Linux machine?

I am on Linux Mint 19.03, Python version that I use is 3.7, I have winehq-stable installed(5.0). I don't have a lot information on Wine I was trying to make a .exe file to distribute to ...
0
votes
0answers
13 views

Adjusting the CPU usage of uwsgi

I have daemonized uwsgi server with django. I am cheking process with top command. Every time request comes, uWSGI process surpass %CPU 102% %MEM 90%. It might be dangerous for long usage, I guess. ...
0
votes
1answer
14 views

How to run procmail in cmdline and provide .eml file as input?

Procmail failed while running my external python script on received email. After that I tried run that script manually and provide the same arguments as procmail - it passed without any problems, so I'...
0
votes
0answers
17 views

how to replace python 3.7 with 3.6 kali linux

I need to install TensorFlow and I do not want to work through conda, is there a way i can replace my current python version (3.7.7) with python 3.6?
1
vote
1answer
26 views

Ubuntu 18.04 Freezing on SSH and RDP but can still ping and very rare slow SSH with cryptic Python errors

I am running Ubuntu 18.04 on a desktop which I connect to remotely via xRDP and sometimes SSH. The computer is in a hospital lab, which I connect to using a VPN. With no warning or pattern, when I am ...
0
votes
0answers
7 views

Netconf notification on a particular session in python

Im writing a python script to send the netconf notification to a netconf client but netconf client is expecting the notification on a particular session. The and create-subscription request are ...
0
votes
0answers
15 views

nginx fails while the website somehow still works

Description I have built my Django3, gunicorn, nginx, Ubuntu 18.04, Digital Ocean project based on this guide. I only had 1 problem that it does not shows the CSS and all other static files like ...
0
votes
0answers
24 views

evdev 'virtual' mouse not showing up an screen and not highlighting

I am trying to interface a touchscreen with a raspberry pi running osmc. This is just about the touch. I have a python script that reads the coordinates and the pressure of a touch on the screen and I ...
0
votes
1answer
29 views

python script not running from crontab

This is one of the so many questions asked in the forums. I've a script that runs perfectly if I run it from the linux terminal. However when I let it run from crontab at a reboot it doesn't work. I ...
1
vote
2answers
34 views

Cron task does not work

I am developing a backup script in my NAS running a docker container. Inside my container I have cron running with this /etc/crontab: root@backups-nas:/code# cat /etc/crontab SHELL=/bin/bash PATH=/...
0
votes
0answers
32 views

Why the color string gives different result if produced by python?

I ran followings commands in git-bash terminal on Windows 10: ~$ printf $'\x1b[30;42mHello, World!\x1b[0m\n' Hello, World! # correct color shown ~...
1
vote
0answers
18 views

Route jackd to discord.py

Currently, I am trying to take audio output from jackd and pipe it into a discord voice chat. This solution doe not seem to work, but this solution supposedly works. What is happening that my solution ...
1
vote
1answer
24 views

instruct apt package installer to access a different python version

I am using quite an old installation of linux, the system python does not include Python 3.7. I have however installed Python 3.7, as can be seen in the following terminal output, but I would like to ...
0
votes
0answers
15 views

How to find out what led to a specific package being installed [duplicate]

tl;dr: is there any way a user can find out what event led to the installation of a particular package onto their OS? For instance, if package bar is found to be installed, is there a way to show that ...
0
votes
0answers
13 views

Forced to reload shell via `zsh` for nvim to recognise python

My nvim installation requires python for some of the plugins to work properly. I installed python and set the correct exports in my zshenv file. If I launch a shell, and start nvim, it will crash and ...
0
votes
0answers
24 views

How can i write a program in python to switch to root user from normal user in linux and again back to normal user?

I am scripting in python and till now I have been accessing the commands from normal user. Now I have to delete a file from var/tmp folder which can be done after being a root user. So how can I write ...
0
votes
1answer
29 views

Installing Python 3.7 from source with custom openssl installation: test_ssl failed [closed]

To be able to install Python from source without root permission on a Ubuntu server, I had to install openssl, which I did using the following commands: wget https://www.openssl.org/source/openssl-1....
0
votes
2answers
28 views

How to package Debian's python3-ebooklib for Fedora [closed]

It seems this package for ebooks https://packages.debian.org/buster/python3-ebooklib is not (yet) packaged for Fedora. How to package this into rpm (locally) or make it available in copr?
0
votes
0answers
18 views

Make Python3 script callable from everywhere without making it an executable

I've got a folder: /root/Desktop/commands/ This folder contains many Python scripts that should be callable from anywhere from the terminal. How can I make it, that I say once, that all scripts in ...
1
vote
1answer
71 views

cp: invalid option — 'h'

I'm using Ubuntu and I'm trying to install this Python package via Anaconda. I followed the steps as they are in the link, and when I type cp -Ri $THIS_DIR/PackageFiles/Scripts $CMDIR (line 59 onwards)...
0
votes
3answers
41 views

How can I start a long running background process, via ssh, and immediately disconnect?

I want to write a bash script which can ssh into a server, start a continuous background process (infinite python script) and exit the server. Here is what I have tried: ssh user@domain "python3 ...
2
votes
1answer
73 views

repr equivalent in shell

In python i use: repr('test') for get the output: "'test'" I want to do the same but in the shell to be able to store this value in a variable. How can I do? For example: If I execute a command: ...
0
votes
0answers
8 views

Error in installation of mendeleev python library

While installing mendeleev python library with the command "pip install mendeleev" I am getting this error. Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-YVHGQs/...
0
votes
1answer
29 views

/usr/bin/env python runs on cmdline, fails in #! line [duplicate]

I'm trying to make a python script runnable, by adding the following "shebang" first line: #!/usr/bin/env python but when I run the file, I get: $ myscript.py : No such file or directory Now, if I ...
0
votes
1answer
26 views

Python errors in Postfix Policyd-spf config: “warning: problem talking to server private/policyd-spf”

Implementing pypolicyd-spf support in Postfix 3.3.1 on RHEL 8, encountered following error in /var/log/maillog: spawn[xxxx]: fatal: spawn_comand: execvp /usr/bin/python: No such file or directory ...
0
votes
0answers
38 views

How to solve this “ python setup.py egg_info” Problems on Pycharm?

When I run the cmd on Pycharm terminal>> pip install django-heroku ; it gives this error Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-dtad1xv7/psycopg2/ After ...
0
votes
2answers
100 views

Running Python script using shell script redirecting python output

I am running my python script using a shell script run.sh to restart it if crashes : #!/bin/sh COMMAND='nohup python3 -u test.py run >> py.log &' LOGFILE=restart.txt writelog() { now=`...
0
votes
1answer
32 views

How can I make by pip installed python packages visible to rpm?

Problem: I have a local rpm package with lots of out of date python packages which I cannot install from the package manager. Thus, I installed them with pip. But rpm still complains that the ...
0
votes
1answer
32 views

Using output of a python expression in an if statement

I want to use the output of a simple Python expression as a condition in an if statement. I know that x=$(python3 -c "print('False')") echo $x will produce the output of False, so I don't ...
-1
votes
0answers
28 views

Python, getting max value of an array with a simple loop [migrated]

I am writing a simple loop to get the max value inside an array. I know there is the function arr.max() but I'm just curious why the following code does not work. import numpy as np arr1 = np.arange(...
1
vote
0answers
51 views

Run Python script in virtualenv as service

I'd like to run a python script, which uses a virtualenv as a service. I've already researched a bit, but couldn't find a working solution. I've put the path of the virtual env python on the first ...
0
votes
1answer
42 views

How to pipe:/// through a .sh or Python script, or use some sort of setting files with FFMPEG

First post, so be kind please :) So a quick bit of history. I am using tvheadend, and the inbuilt transcoder murders my CPU, and provides average quality output (it's powered by ffmpeg), if I pipe ...
0
votes
1answer
33 views

Is it possible to disable or deactivate (not remove or uninstall) a Python version in Ubuntu18.04?

I want to disable or deactivate (not remove) Python 2.7 from Ubuntu 18.04. Is it possible to do it. If so, then how?
0
votes
0answers
8 views

Python venv module cannot add virtual environment name to PS1, when using PROMPT_COMMAND?

I use the official Git Bash prompt support for displaying the current branch as part of the prompt. My problem is that activating a Python virtual environment (python -m venv <dir>) using ...
0
votes
1answer
26 views

How to install python3 with all it is tools on Redhat RHEL7 offline machine

I have a Django project that is going to be installed in an RHEL 7 server with no internet access. I need to include everything locally, starting from python3 source, to pip and setup tools. with ...
0
votes
1answer
62 views

Python Script To Identify Ext4 Inodes From Raw Data Of Partition

I'm trying to put together a python script that can read the raw data from the back-up image of an ext4 partition and recognize when it sees an ext4 inode structure so that particular file can be ...
0
votes
0answers
19 views

How to change default postfix email permissions?

I need to configure Postfix so that it sets chmod of emails automatically to 0704, in order that a flaskapp run by apache2 could access them and show them to running user. I need flask to be able to ...
2
votes
1answer
57 views

Systemd service definition not working

Defined a systemd service: [Unit] Description=WebGPS After=gpsd.service [Service] ExecStart=/usr/sbin/daemonize -p /run/gpsd/webgps.pid -o /var/log/webgps.log /usr/bin/python /var/www/gpsd/webgps.py ...
0
votes
0answers
35 views

Python: Kill Subprocess Only If Process Goes Interactive

I need to test a process in a loop with different input. In my circumstance, if it does not go interactive it has succeeded. If it does go interactive, I must conitinue on testing and kill the process ...
0
votes
1answer
36 views

Does tinycore's \ PiCore's Python limits prevent Python library installation for controlling a relay board?

On Raspbian: I have successfully implemented instructions per: https://github.com/SequentMicrosystems/megaio-rpi git clone newbielink:https://github.com/SequentMicrosystems/megaio-rpi.git [nonactive]...

1
2 3 4 5
34