Questions tagged [python]
Python is an interpreted, general, high-level programming language. Programming questions are off topic. Questions about the use of Python should be asked at Stack Overflow (https://www.stackoverflow.com) instead.
3,149
questions
0
votes
0
answers
18
views
Blocking SSH Connection Using Scheduled Task
I have a Python script to block SSH connection. When I keep running the program in CMD console, it successfully blocks port 22.
But when I set the script as a scheduled task (run as administrator in ...
-4
votes
1
answer
37
views
Predict a disk's near failure or burnout [closed]
I have a project to submit on computer resource's monitoring, and for that I wish to create a CLI program -for Linux and Windows- that analyses the data provided by SMART each time the computer ...
0
votes
0
answers
23
views
network errors in windows
i am desperately trying to fix this for weeks, when doing anything that requires internet with anaconda on windows it gives this error:
Retrieving notices: ...working... Retrying (Retry(total=2, ...
0
votes
0
answers
8
views
How open a .log file in Notepad with Python without the file continuing to be linked to Python execution? [migrated]
When I open the Windows file explorer and double-click the test_errors.log file, it opens in Notepad and I can edit it by directly saving the edits with Control + S.
But I want to do this with Python, ...
0
votes
0
answers
57
views
Using python-gnupg library in AWS lambda function
I'm using Python 3.12 in an AWS Lambda function to decrypt PGP encrypted files. I'm using the python-gnupg version 0.6.0 library to do this. It decrypts files fine on my development Mac but fails when ...
0
votes
0
answers
8
views
How to run EdgeOS configuration commands in python fabric [migrated]
I'm trying to programmatically update configuration in EdgeOS using a python script. I'm using fabric as an ssh client. https://docs.fabfile.org/en/latest/index.html
Below "---original question---...
0
votes
0
answers
49
views
How to draw a moving line as slider for the image comparison video generator script in Python with FFmpeg
I have the below script to generate a video slider with FFmpeg
You can see example here (first 10 seconds) : https://youtu.be/F_wf1uHqZRA
I am trying to replicate effect of imgsli like a person is ...
0
votes
0
answers
36
views
Unable to Uninstall Anaconda3 on Windows 11
I can't uninstall Anaconda3 from my system.
I have spent a lot of hours searching for a solution to this and have tried everything I can find and was able to understand.
I have Anaconda3 2023.09-0 ...
1
vote
0
answers
50
views
concatenating multiple files is giving Non-monotonic DTS in output stream error
I am trying to concatenate multiple video files with ffmpeg and python with the following code :-
def story(path):
videos = [f for f in os.listdir(path) if f.endswith(".mp4")]
print(videos)
...
-1
votes
0
answers
52
views
unable to concatenate videos using ffmpeg and python
i am trying to concatenate videos using FFmpeg and python with the below code
`def story(path):
videos = [f for f in os.listdir(path) if f.endswith(".mp4")]
print(videos)
command = [
&...
1
vote
1
answer
71
views
How do I create a pty without a shell?
Backstory: I have a CLI Python application. I want to be able to debug it without interfering with the CLI of the main application. The Python debugger allows you to specify an alternative stdin/...
0
votes
0
answers
21
views
How to Create a Regex expression to get string before HS code: digit* (exclude HS code: digit*) [migrated]
import re
txt = '''293 PACKAGE(S)_x000D_
PRINTED HEAD ITEM: KA02033-E844 A5 :INVOICE: FIT-2401-01 HS CODE: 84732:100 KNITTED FABRIC H.S CODE: 6006.2:2.00 INV#: TSTEX0124-009 (TC-240021:) WOVEN TWILL ...
0
votes
2
answers
28
views
How would you include a specific module to load at boot in Debian?
I am working with Klipper for 3D printing, and I came across a pull request that allowed for TTY support in Klipper, to allow a Mosaic Palete 3 Pro to control the printer for its Connected Mode.
I ...
-1
votes
1
answer
40
views
How to match arbitrary adjacent identical strings? [closed]
There are some repeating strings in my data that I need to find. They have a pattern that they repeat twice, and the repetitions are adjacent, with no space in between. They can have arbitrary lengths ...
0
votes
0
answers
43
views
starting chrome via WebDriver session wont use default profile - windows
I came from this GitHub but there are mainly linux prof. When I run the program via cmd chrome is opened but without any default profiles:
chrome via program
When I run chrome direct via cmd with &...
0
votes
0
answers
64
views
Cannot activate Python virtual environment from within shell script (zsh)
I cannot activate a Python virtual environment from within a shell script (zsh).
I have tried the following:
#!/bin/zsh
conda create -n myenv python=3.10
conda activate myenv
It sends me the error ...
1
vote
1
answer
115
views
Why is rsync so much slower than my Python script for syncing?
I have the following Python script that I sometimes use to mirror large directories (main logic for syncing is implemented within sync_directory()). It also tries to mirror other metadata such as file ...
0
votes
0
answers
34
views
Chromedriver not found in Cygwin although it exists
After a couple hours of trying everything I could, I'm posting the question here.
I'm trying to run this python script which uses chromium in order to execute.
https://github.com/FallingLights/...
0
votes
1
answer
31
views
Loop of screens with a loop inside does not pick variable values
How can we execute a loop of screens, each of them executing a loop so that it picks both inner and outer variables?
Consider this:
# does not print i
for i in 1 2; do
screen -dmS screen-${i} ...
0
votes
0
answers
72
views
Why is faster pc i5:ram 4, ssd 256, core 4, then laptop i7: ram 16, ssd 500, core 10?
I have such a case and maybe you can help me, what is the reason?
I did a test, reading an excel file (310 MB) in python (pandas).
Laptop(IdeaPad Slim 5 16IRL8): i7, ram 16, ssd 500, core 10, 2.4 ghz, ...
0
votes
0
answers
64
views
Unsure what happening with my terminal but I'm getting a weird response
Whenever I run a python file, (vs code) or even open my terminal on mac I get a warning saying.
/Users/ABC/.zshrc:1: command not found: “alias
/Users/ABC/.zshrc:2: command not found: “alias
/Users/ABC/...
0
votes
0
answers
41
views
How to run main.py in Pico (via Thonny) if I plug in a keyboard (on Ubuntu)?
Context
After having written the following keyboard "driver" on a Raspberry Pico:
print("Starting")
import board
from kmk.kmk_keyboard import KMKKeyboard
from kmk.keys import KC
...
0
votes
0
answers
40
views
Show the current occurrence for a searched term as a number out of the total of all occurrences of that term through a file for Notepad++
For example I have this document that in Notepad++ it takes only one line, where the word "calculator" has 112 occurences (see the 2 red rectangles):
, but when I go ahead to use "Find ...
0
votes
1
answer
205
views
Is it normal for Ubuntu (WSL) to take up 40GB of space?
I've tried running this to cleaning out docker images, etc… with this command:
compact vdisk
The filesystem allocation is 1007GB and only 4% is used.
How do I fix this?
All the forums and questions ...
2
votes
1
answer
29
views
How to determine what program is writing error log every 10 seconds?
A long time ago on my Macbook I worked through an online tutorial on automating tasks: Automate the Boring Stuff.
I've since gotten a new laptop. On the new laptop, I've tried to get rid of the folder ...
0
votes
0
answers
73
views
How to correct the indentation of Python code with BBedit? Or some other tool?
I have a Python code of about a thousand lines, contained in a .py file, and I would like to fix, possibly automatically, the indentation (i.e. at the first level four characters, then eight, and so ...
0
votes
0
answers
61
views
How can I install python3-dev for armhf using debian multiarch?
I also posted this question here https://stackoverflow.com/q/77693879/7926069 but was told this site may be a better fit so I crossposted. Hope that's okay!
I have been going in circles trying to ...
0
votes
1
answer
250
views
How to run an application installed via pip?
I've used pip before to install libraries to use them in my python scripts. Now I've installed ranger-fm from pip.
Silly question: how do I run it?
I did not expect to run it by simply entering '...
1
vote
1
answer
59
views
How to call ifcconvert from the terminal
I want to convert icf files to objs, to that effect I want to use this tool:
https://ifcopenshell.org/downloads.html
I installed it through python like this:
pip install ifcopenshell
However, I am ...
0
votes
0
answers
53
views
How to run Apache airflow that is installed by PyPy as systemd?
I installed Apache airflow using PyPy and the executable is in
/home/my_user/anaconda3/envs/my_env/bin/airflow
The installation is working fine and I wanted to make it a systemd.
[Unit]
Description=...
1
vote
0
answers
50
views
How to differentiate between directories created manually and directories created by installed programs?
On my Ubuntu laptop, I want to differentiate between directories I created manually and directories created by programs that I install for coding purposes (in Python).
I have searched a lot, but it ...
2
votes
1
answer
2k
views
How to install sox for PyTorch audio?
I want to run PyTorch code on Linux. I start a virtual machine on AWS with AMI Deep Learning PyTorch, but, surprisingly, PyTorch is not installed. So I run:
python3 -m pip install torch torchaudio
...
0
votes
1
answer
44
views
Macro to keep 3 rows visible under the selected row in LibreOffice Calc
In Calc or MS Excel when one is finished editing a cell in a row, pressing Enter leads to the next row below. Keep doing that and eventually you arrive at the last row visible on the screen. Here when ...
0
votes
0
answers
54
views
Positioning an ffmpeg text while wrapping text in newlines
I would like to automatically wrap text in multiple lines if it is too long to fit on the screen.
I know about the subtitle option but it is not what I am seeking for. When generating a long video ...
0
votes
1
answer
92
views
How do browsers based on Chromium import passwords from Chrome?
How do browsers based on chromium import passwords from Chrome?
Browsers like Vivaldi Brave, Edge, Opera, etc… all have feature to import passwords from Chrome, and some even have ability to import ...
0
votes
1
answer
95
views
Can't use pipenv after adding to $PATH
I'm using a Linux box on which I don't have sudo privileges. I have python and pip installed. I've run pip3 install --user pipenv, and confirmed that ~/.local/bin/pipenv exists. I then added PATH=~/...
0
votes
1
answer
148
views
Arbitrary font type with ffmpeg
I set up a script that generates a simple video with one mp3 audio and one text on screen. I would like to add the option to specify a font type and use that for formatting of the text on the video.
...
0
votes
0
answers
35
views
How to setup Not Exactly C or nxt-python on Arch Linux for lego mindstorms in 2023?
I have an old NXT Lego-Mindstorms Robot. I did some major digging, but I havn't been able to connect to the Robot via USB with my arch linux system.
When I type nxt-test, I get the following error ...
0
votes
1
answer
108
views
Python Can Run with Typing "python.exe" Rather Typing "python"
I have added python to env on PATH correctly C:\Users\username\AppData\Local\Programs\Python\Python38\
But now I need to type python.exe to start it rather than typing python like before
And it will ...
0
votes
1
answer
768
views
conda create --name doc-env python==3.10 but the version installed remains 3.18
I try to install python 3.7 with conda but every time I seem to get python 3.11. Then I tried to explicitly specify the channel with conda create --name doc-env python=3.10 -c conda-forge I noticed ...
0
votes
0
answers
40
views
Flask application running on nginx . File read from folder ok but 500 error while file save
Hello I am running nginx server on ubuntu system .
file read from web app is OK .
file save or file write to local folder system is getting error with 500 internal server error .
root 12145 0.0 ...
0
votes
0
answers
39
views
virtualenv and pip version inside
I installed fresh Ubuntu 20.04 (which I believe comes with python3.8) and then additionally installed:
sudo apt install python3.9
sudo apt install python3.9-dev
sudo apt install python3-pip
I want to ...
0
votes
1
answer
154
views
Is there any way to reset the rotation flag of videos while using concat to combine them?
as title. I'm working on an un-chaptering script through the ffmpeg python library, and I've set up a very basic script for concat'ing several files. this is currently what I have:
if (os.path.isfile(...
0
votes
0
answers
186
views
Ubuntu VM with Cups Server and docker container with pycups: cups.IPPError: (1030, 'The printer or class does not exist.')
I have an Ubuntu VM with the cups server installed, configured and running.
I can print to every printer from the web interface with no problems.
Inside this VM there is a docker container with a ...
0
votes
1
answer
335
views
(venv) prefix on bash terminal prompt in all directories
I was initially very happy to see my terminal prompt prefixed with (venv) because I was inside the folder where I am learning python, and in that folder, I created a ./venv folder to hold my virtual ...
1
vote
0
answers
74
views
Using aspell to check many files in a cancellable way
I'm on macOS and using zsh. I have about a hundred Markdown files which I would like to spell check from the command line. It seems like aspell is the right way to do this, however I want to be able ...
1
vote
0
answers
82
views
How to use Firefox Containers with Python (instead of Firefox Profiles)
I have a python script for an automation tool using selenium that requires using multiple accounts (tens & hundreds) using Firefox. Thing is, I can't login-logout the accounts, so to use multiple ...
0
votes
1
answer
3k
views
Stable Diffusion Model Fails to Load. What's causing the error?
Seems like a memory related issue but I thought my system should be able to run Stable Diffusion. Iam using Ideapad Gaming 3i with Nvidia GeForce GTX 1650 (4GB VRAM) + 8GB physical memory
I have no ...
1
vote
0
answers
77
views
Installing Python package PATH error
I used this prompt in Windows Powershell py -m pip install pandas.
I got back this message saying it was installed but not the proper PATH. Does anyone know what this means and is this going to be a ...
0
votes
0
answers
18
views
Jupyter lab on ubuntu does not start browser
I'm using an Ubuntu VM in parallels (running on OSX M1 Processor).
Jupyter lab works fine on my base conda environment. When I launch it from an environment I created, nothing happens.