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
0 answers
24 views

Can't restart a suspended process

I execute a long running Python-process. To stop the annoying noise from the fans I use AppPolice to prevent this process from using more than 20 % CPU (I don't care when it finishes). I think that ...
d-b's user avatar
  • 1,703
0 votes
1 answer
4 views

Why does Django throw ImproperlyConfigured when I try to import in the Python shell?

This one kept throwing me when I started Django. Suppose you have a project project with an app app, and you want to inspect it. So you import parts of it in the Python shell: (virtualenv) $ ...
Marnanel Thurman's user avatar
0 votes
0 answers
13 views

Separate independent screen using X and Python

I have a request for guidance/keywords to search on a problem that is new to me. We are running a microscopy application on Ubuntu 20.04 and using Python. We have two HDMI outputs on our GPU. One ...
Druidris's user avatar
  • 101
0 votes
0 answers
15 views

how to install missing python modules offline without managers

nightmare scenario here. i have a device running embedded OS (Custom Linux buildroot). it is offline and has NO package manager (apt, yum, et al.) and python has several missing modules, one of ...
WhiteRau's user avatar
  • 213
0 votes
0 answers
14 views

Conda and Python Path [closed]

I recently install a software package in a new conda environment. I need to copy over a python script for the package to fully work. It seems simply copying the file over does not work -- how do I do ...
dtx1's user avatar
  • 1
0 votes
2 answers
20 views

Problems with installing pycryptodome

I have modified my thinkpad's BIOS to remove the wifi whitelist and plan to flash the modified bios back to the eeprom. To do that I have to use a tool called thinkpad-uefi-sign which signs the image ...
witherslayer's user avatar
0 votes
0 answers
23 views

Pasting multiline value in Screen GNU executes line by line

I am used to pasting snippets of code in ipython shell to test things out. When I copy and paste something like this print("A") print("B") print("C") in ipython shell, ...
Moeed Huda's user avatar
1 vote
4 answers
77 views

Remove duplicates by adding numerical suffix

How do I append a numerical suffix to lines to remove duplicates? Pseudo code: if currLine.startsWith("tag:") x = numFutureLinesMatching(currLine) if (x > 0) currLine = currLine + ...
Steven's user avatar
  • 738
0 votes
1 answer
54 views

Linux Ubuntu Kernel crash: python: Corrupted page table

My system configuration: Processor: 12th gen Core i7 12700K x 20 16 GB RAM Not installed external GPU (No Graphics Card). All the GPU is from the processor itself (on chip) Motherboard: Gigabyte ...
Syed Waris's user avatar
0 votes
1 answer
48 views

Script not working fully under systemd

I have a python script to switch light/dark mode. At the end there's this line: process = subprocess.Popen(binDir + "/polybar.sh") That script it points to is this: #!/bin/env bash # ...
indeedwatson's user avatar
0 votes
0 answers
19 views

find in tshark/wireshark tcp sessions with unique value in filter - ldap.attributes

I need to find in tshark/wireshark tcp sessions with an unique value in filter - ldap.attributes For example, in a picture In red - value from filter - ldap.attributes. Some filter in the dump can be ...
Mexanizm456's user avatar
0 votes
1 answer
18 views

SSL cert recognized by OpenSSL but not geventhttpclient

I have an instance of an NVIDIA Triton Inference Server. Then, there is the Python's client which uses geventhttp Python's package to perform the requests. This is all deployed as microservices, so in ...
bert's user avatar
  • 255
-2 votes
0 answers
15 views

apt problem or may be a pyhton traceback error

#sudo apt-add-repository ppa:agateau/lightdm-kde Traceback (most recent call last): File "/usr/bin/apt-add-repository", line 95, in <module> sp = SoftwareProperties(options=...
Yuvraj Chhatwani's user avatar
1 vote
0 answers
45 views

echo or >> (or something) fails when network connection has been idle for a long period?

I have a script that takes several hours to finish (the script runs whisper and it is the whisper . At the end I echo and >> some results to a network volume mounted using SMB. This often fails ...
d-b's user avatar
  • 1,703
0 votes
0 answers
17 views

How could I solve "ModuleNotFoundError: No module named 'pheweb.command_line'"

I am trying to run a software called 'Pheweb' on Ubuntu. I followed the guideline here but got 'permission denied' error when I ran 'pip3 install pheweb'. So I installed with this code: sudo apt-get ...
syl's user avatar
  • 1
1 vote
1 answer
21 views

What could've casued my pip installation to disappear? Or at least not be found when I try to pip install something?

I have used pip to install packages many times and all of a sudden it's gone. I can't recall if I used it after a system update or if it's been gone since I updated a few days ago. I'm using fedora 38....
ttat2g's user avatar
  • 13
0 votes
1 answer
78 views

How to `import FreeCAD` in CLI (python)

How can I import FreeCAD from the python console? I'm trying to write a script that can manipulate a given FreeCAD file, but I can't even get FreeCAD imported into the python console on a system where ...
Michael Altfield's user avatar
2 votes
1 answer
102 views

How to display rgb hex colors on terminal using python?

Using ANSI escape sequence, I can change the color of text that python prints. The example below prints "Hi World" in light blue. #!/usr/bin/python3 print(f'\033[38;5;117mHi World') While ...
un31389's user avatar
  • 21
0 votes
1 answer
18 views

Why can't I change my pip3 from the built in to the MacPort-version?

Here is a terminal session: db@air ~ % port select --list pip3 Available versions for pip3: none pip3-apple (active) pip311 db@air ~ % sudo port select --set pip3 pip311 ...
d-b's user avatar
  • 1,703
0 votes
2 answers
45 views

Django backend died when deploying a new version: Address already in use

I have a Django app running on a Debian server, with a simple deploy script that is automatically invoked via a GitHub webhook: #!/bin/sh git pull /home/criticalnotes/.local/bin/poetry install --with ...
Kevin Renskers's user avatar
0 votes
2 answers
39 views

Adding a newline above PS1 that survives prepending

In OBSD ksh, I had a PS1 which prepended a blank line: PS1="\n[\u@\h] \w\n\$" The problem with this was that pyenv prepends the name of a virtual environment when that environment is ...
user1093043's user avatar
0 votes
0 answers
37 views

Battery plug-in detection latency

I am writing a python script that needs to know when battery is inserted. I use pyudev for that. The problem: The laptop is powered on with only AC power adapter inserted. When I run ls /sys/class/...
ibrahem's user avatar
  • 111
-1 votes
1 answer
67 views

Complicated DIFF method

I'm trying to do a compare between a config from an old box and a new box to verify Availability and State haven't changed. I have a file that is generated with about a thousand nodes but every node ...
MyWiseGuys's user avatar
0 votes
1 answer
62 views

How to install missing Python modules für QGIS on Manjaro?

I installed QGIS via pamac UI just to find it complaining about two missing Python modules (osgeo, jinja2) needed for some of it's plugins. My first thought was to install them via pip, but pip ...
PVitt's user avatar
  • 103
0 votes
3 answers
96 views

How do I use grep, awk, or sed to get a substring of a line up until a string literal?

I am trying to process a text file and omit a certain string literal if it occurs at the end of the line. E.g.: Source: ABC 123 DEF, characters I don't want GHI, these characters are ok Desired ...
Evan Harmon's user avatar
2 votes
1 answer
41 views

Is it safe to slicing byte directly to split a big file?

In my case, the big file is tar.gz, I have myBigFile.tar.gz with size 52GB, I splitted it with chunk size 2GB therefore I have 27 parts file. Here is the code I program from scratch: from time import ...
Muhammad Ikhwan Perwira's user avatar
1 vote
1 answer
302 views

E: Package 'python-minimal' has no installation candidate

I am trying to deploy k8s cluster on aws using kubespray. Step1: I have downloaded the following dependencies: apt-get update apt-get install software-properties-common apt-add-repository ppa:...
swetha panchakatla's user avatar
0 votes
0 answers
48 views

Not a directory but have contents

So I use Compute Engine VM in Google Cloud to download youtube videos. I use Youtube-dl to download it. I follow the documentation in here: https://github.com/ytdl-org/youtube-dl/blob/master/README....
Flitzcore's user avatar
0 votes
0 answers
21 views

createrepo -v --update folder failed in incremental build in docker

env description: root@sriov-TaiShan-200:~# docker version Client: Docker Engine - Community Version: 20.10.17 Server: Docker Engine - Community Engine: Version: 20.10.17 [root@...
xiaojueguan's user avatar
0 votes
1 answer
46 views

Plotting a two dimensional array using matplotlib python

I want to be able to plot an array of functions that are stored as a 2-d array using matplotlib. They all have the same independent variable. Specifically, P=zerros((ntotx, ntoty),float) x=zeros(ntotx,...
nardis_miles's user avatar
0 votes
1 answer
170 views

Searching for a pattern in a binary file using python script

I want to find repeated copies of the config section within the partition dump (binary file), using pattern and 'magic' header. The config section always starts with 202 '0xff' bytes followed by 4 ...
minto's user avatar
  • 511
0 votes
0 answers
52 views

Configure Ofono with SIM800C device

I'm trying (as a complete newbie) to use ofono to manipulate my SIMCOM 800C device. I've compiled it from source and configured all the necessary services (D-bus and udev). The udev rule from the doc ...
tobihans's user avatar
  • 101
0 votes
0 answers
69 views

vscode with jupyter with archlinux

I am trying to install and use vscode with jupyter extension for coding with python on my archlinux OS. but it does not found any kernel interpreter I installed both jupyter and python extension in ...
eugenio b's user avatar
0 votes
1 answer
114 views

Is there a special set of permissions that must be set on a log file read by fail2ban?

I've experienced some spam recently on my Minecraft server that I suspect to be from some kind of port-scanner or other bot. So far whatever it is hasn't posed any real threat but I figured better ...
kawub's user avatar
  • 11
0 votes
1 answer
267 views

ModuleNotFoundError: No module named 'debpython' [closed]

After some manipulations with updating Python to version 3.9 and using the command "python" to invoke Python 3.9 (update-alternatives), or perhaps something else, I encountered a global ...
echos's user avatar
  • 1
1 vote
2 answers
38 views

Remove all function documentation matching a pattern from a file

Let's say you have many functions with auto-generated documentation similar to: /** * @author John Doe */ Is there a simple way to remove these 3 lines from every function documented this way in ...
davidvandebunte's user avatar
0 votes
1 answer
159 views

How to activate python venv in a non-bash shell?

I see most tutorials/online sources advice using either source or . (a bash built-in) to activate a python venv. For example, this page suggests to do the following in Linux: cd ~/<proj_name> . ...
tinlyx's user avatar
  • 552
0 votes
2 answers
397 views

Ubuntu 18.04 python update problem

I have an update problem for a few days. My version is Ubuntu 18.04.6 LTS (bionic) sudo apt-get upgrade gives an output like that; Reading package lists... Done Building dependency tree ...
ahmet cihan Akınca's user avatar
0 votes
0 answers
8 views

How to set _NET_WM_STRUT for my app in python

I want to make a standalone status bar (something like polybar) in python. I chose tkinter to work on it but sadly I can't find any option to set _NET_WM_STRUT_PARTIAL and _NET_WM_STRUT which are ...
mcnuggetsx20's user avatar
0 votes
0 answers
22 views

Python 3 BBS lister

I have the following script. Which works perfectly fine with telnet (or even ztelnet), the problem is that it does not allow me to answer all of the questions with another term. Other than telnet or ...
ignatius's user avatar
  • 391
1 vote
1 answer
94 views

Shell Variable Expansion in qsub command through drmaa

I am running a bulk job submission to SGE (Sun Grid Engine) using python drmaa bindings. For the bulk job submission I am submitting a python script that takes in one argument and is command line ...
Melendowski's user avatar
0 votes
0 answers
47 views

Inkscape working on local machine but not working on docker container

FROM python:3.10 RUN apt-get update && apt-get install -y inkscape WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY . . EXPOSE 5000 CMD [&...
Faizan Naeem's user avatar
1 vote
1 answer
119 views

Delete VM including storage with python-libvirt

I'm trying to write scripts in Python with the libvirt library, but there's one thing I'm currently stuck at. I can successfully create a VM, set it up how I want it, start it, access it, and shutdown ...
Florian Bach's user avatar
0 votes
0 answers
35 views

Setting wm_state in python xlib

I want to write my own status bar. I figured it has to have a specific _NET_WM_STATE property set to _NET_WM_STATE_ABOVE (polybar does it). What I can not figure out though is how do I go about it ...
mcnuggetsx20's user avatar
0 votes
1 answer
62 views

Reading X11 properties

I want to write my own status bar, that would be EWMH compatible, which means I have to read some X11 properties like: _NET_NUMBER_OF_DESKTOPS _NET_DESKTOP_NAMES and such. So my question is ...
mcnuggetsx20's user avatar
0 votes
0 answers
75 views

My Crontab doesn't work on Raspberry Pi

I have a python script in: /home/pi/auto/wake_up.py crontab -e: * * * * * /usr/bin/python /home/pi/auto/wake_up.py >> /tmp/wake_up.log log is created but with empty line same when I put #!/usr/...
JOC0N's user avatar
  • 13
0 votes
1 answer
77 views

Why does this "-e" option for echo get written to a file (although not enclosed in double quotes)? [duplicate]

#!/usr/bin/env python3 from subprocess import run from sys import modules def main(): doas() def doas(): ch = input("Ready to proceed with setting up doas?[Y/n]?") if ch == 'y': ...
John Smith's user avatar
0 votes
1 answer
40 views

Do I need to recompile Vim if Python changes a minor version?

I use a compiled Vim on my machine. This compiled vim attempts to load the shared libary libpython3.10.so.1.0 I just updated my system and apparently Python deleted the old Python 3.10 libaries and ...
Tyler Durden's user avatar
  • 5,461
-1 votes
1 answer
34 views

Python script to get file path: insert the result inside quotes; I get the full path but not quotes

I have a python script which copy the full path of text files opened in gedit: #!/usr/bin/env python3 import subprocess import sys name = subprocess.check_output(["xdotool", "...
Dave's user avatar
  • 1
0 votes
1 answer
71 views

Filtering log statements before they're written

I have an application I need to run in verbose mode to get the information I'm interested in. This produces an enormous log file that is <1% interesting for my requirements.I want some way of ...
Stephen Boston's user avatar

1
2 3 4 5
46