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 (http://www.stackoverflow.com) instead.

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

Merging Generated PDF Pages Using PyPDF [migrated]

currently working on a script which automatically fills up a fillable pdf file. Current challenge is that right now, all generated scripts are stored on multiple pdf files and what I wanted to do is ...
0
votes
0answers
7 views

cross val score returns NAN in sklearn [migrated]

I am getting nan score from cross_val_score. May I please know how to handle it.. Struggling since a day. from sklearn.model_selection import KFold, cross_val_score from sklearn.model_selection ...
0
votes
1answer
33 views

pip on Python 2.7 in RHEL using yum

I have tried to install pip for Python 2.7 on RHEL using sudo yum install python3-pip, and, while the installation gets completed, when I try to run pip it says that command is not found. yum list ...
0
votes
0answers
29 views

Could anti-cheat systems trigger false positives if I open my favorite games through Python using subprocess.Popen?

This may be hard to answer definitively. I feel like the answer is no, but I'm looking for people familiar with anti-cheat and/or operating systems in general to confirm or deny this. I know apps ...
0
votes
0answers
13 views

TypeError: __init__() got an unexpected keyword argument 'checksec' [closed]

I was watching this video https://youtu.be/GTQxZlr5yvE?t=2185 (Ippsec's Rope CTF) and he defines checksec argument here ! when I run the code i get this error Traceback (most recent call last): ...
-1
votes
0answers
75 views

Building a program in Pycharm for Ubuntu. How can I do it so that Ubuntu automatically opens Pycharm and Starts the Python Program?

First, I want Ubuntu to boot straight into the Desktop and automatically open Pycharm IDE. Then, I want it to automatically run the Pycharm Program left open or last worked on. Lastly, without me ...
1
vote
1answer
27 views

Installing yum on linux results in no module named yum error despite only have python 2.7

I am running on Kali 2020.2 (kali-rolling). I am trying to install things using yum. However, whenever I try and run such commands I receive the error : There was a problem importing one of the ...
0
votes
1answer
29 views

Incrementally cutting a video using python? [closed]

I have a large 20 minute video that I would like to cut 3 frames, every 2 seconds from the video and then compile that video in to some sort of readable video format afterwards. I have an advanced ...
-2
votes
0answers
10 views

Keep Running the Server GCP VM

I have installed superset in python virtual env on GCP VM. I am running the superset using following command inside the virutal env. gunicorn -w 5 --timeout 120 -b 0.0.0.0:8088 "superset.app:...
0
votes
0answers
24 views

How do I save a custom size screenshot on python? [migrated]

So I'm working on the little project and the problem I ran to is... I can take a screenshot with custom size but I cannot save it to disk. What should I do? import pyautogui as ImageGrab im = ...
1
vote
0answers
56 views

Errors with pip3 and apt after upgrading python and Anaconda (Debian 9)

In order to install PyMC3, I installed Python 3.8 from the official repository without realize that I already had Anaconda2 (with python 3.6). Python 3.8 worked fine but I wasn't able to make it ...
0
votes
0answers
15 views

Network issues with pip

I'm trying to get pip working behind my companies proxy network. Here is the pip verbose log: C:\Users\<Username>>pip install -v numpy Created temporary directory: C:\Users\<Username>\...
0
votes
0answers
19 views

macOS: 'conda init' fails with utf-8 codec can not decode byte 0xc3

Whilst trying to install Anaconda3 i run into this problem: (Python has been installed with home-brew before, the only version installed, as far is i can tell is python@3.7; Terminal locale should be ...
0
votes
0answers
14 views

Task Scheduler Windows 10, repeats every 30min instead of 1h

I created a task for running a python script every 3 hours for 12 hours a day, starting at 9 am. Problem is that it runs every 30 minutes instead. I changed it to every hour instead but still runs ...
0
votes
0answers
29 views

Ubuntu 18.04 to 20.04 - Unresolved issue occured while calculating upgrade

I'm trying to upgrade my ubuntu distro from 18.04 lts to 20.04 lts and I get this error message while it's calculating data, An unresolvable problem occurred while calculating the upgrade. ...
0
votes
0answers
11 views

Plink Hanging in Jupyter Notebook

I have a Jupyter notebook python script. I am trying to run a plink command via the command line within the script. For example, I can do something like !plink username@session ls and it works ...
0
votes
0answers
9 views

How to include additional files using cx_freeze module

I have recently made a minesweeper game using pygame, now I want to create a stand alone .exe file of my game. For this I approached the cx_Freeze module (since the pyinstaller was not helping me out)...
0
votes
0answers
11 views

/Users/RG/.zshrc:source:14: no such file or directory: /usr/local/bin/virtualenvwrapper.sh

I am following https://swapps.com/blog/how-to-configure-virtualenvwrapper-with-python3-in-osx-mojave/ I have installed both programs and now have added source /usr/local/bin/virtualenvwrapper.sh to ....
0
votes
2answers
92 views

How to start/stop a python script as a service at a specific time on CentOS?

I am trying to put a python script on a VPS running CentOS 7, that crawls some stock data online from a web service. What I want to do is to set this script as an OS service that start/stops at a ...
1
vote
1answer
116 views

2-pass batch video encoding using ffmpeg and/or python

I have a large set of video files I would like to encode to smaller files on a Windows machine. I want to use a 4K constant video bitrate and copy the audio. I've settled on using 2-pass FFmpeg to ...
0
votes
1answer
18 views

python 3.4 to python 3.5 upgrade

How do I upgrade from Python 3.4 to 3.5 or higher on a Raspberry Pi running Raspbian? I tried sudo apt-get install python3.5 with the following output: Reading package lists... Done Building ...
0
votes
1answer
17 views

Apache2 won't run cgi files based on shebang

I'm trying to use Python as the server-scripting language instead of PHP. I've configured localhost and php files run fine under it. If I create a file .../localhost/temp/test.cgi (making it ...
0
votes
0answers
21 views

Import error (Running python script on startup using rc.local)

My python 3.6 script works fine when running it in terminal when logged in, but when I try to run it in startup using rc.local, it comes up with an import cv2 error, meaning the opencv module is not ...
0
votes
0answers
4 views

Issues with fitLine() in opencv2 [migrated]

I'm trying to write a simple function that fits a line to a binary image: # threshold image thr = cv2.threshold(src, 0, 255, cv2.THRESH_OTSU)[1] # get angle vx,vy = cv2.fitLine(numpy.float32(thr), ...
0
votes
0answers
14 views

How to automatically set REPL to plain text when being executed on Sublime text 3 (Windows)

On sublime text 3, I installed sublimeREPL to enable user input when running a code and seeing the output. But whenever I run the REPL it's always set to python. How can I set REPL to plain text ...
0
votes
0answers
5 views

Is there any selective benefit in caching string instead of an object in Java? Does it differ in Python? [migrated]

I was once suggested by a dear colleague of mine, that it is preferable to store strings in caches instead of the objects themselves (say maps, JsonObjects etc.), for less active caches. The reason he ...
0
votes
0answers
3 views

VS Code | Python program | module import process not happening [migrated]

Environment I have a Python quickstart in VS Code as part of a multi-root workspace. I have manually added 3 files; tasks.json, settings.json and launch.json. Unexpected behaviour When i debug the ...
0
votes
0answers
13 views

Killing Python/TensorFlow process on Linux leaves undeletable files on Windows SMB share

When I run the following code on a Linux workstation, with the working directory on an SMB share on a Windows server, the file created by the TensorFlow file writer cannot be deleted: """Create an ...
0
votes
1answer
18 views

Geany “Syntax coloring” isn't functioning properly

I'm writing a python script on Geany. I really don't know what I did but it seems Geany isn't coloring python syntax properly in the editor. Some python commands and arguments aren't marked as blue ...
0
votes
0answers
13 views

How to Structure and Organize a Bookmark in a PDF automatically?

I have a PDF document, that has the following as Bookmarks. Original Bookmarks in the PDF I want to group each of these bookmarks in a proper structure automatically such that it looks like this as a ...
0
votes
1answer
45 views

FTP client in a docker container

I'm trying to connect to an FTP server programmatically. The language of my choice is Python, which is simple enough: from ftplib import FTP ftp = FTP(host=FTP_HOST, user=FTP_USERNAME, passwd=...
0
votes
0answers
29 views

File assocations inconsistent behaviour with Windows 10

After updating Python, my file associations somehow got messed up and I have been trying to get them to behave. Here's my test program PyArgs.py: import sys, os print ("Arguments count : " + str (...
2
votes
1answer
47 views

Running python script without typing its `.py` extension

I'm using Zsh on MacOS Catalina. I was reading Automate the Boring Stuff with Python and in it the author runs mapIt.py simply by typing mapit into the terminal. In order to do this I added a ...
0
votes
0answers
21 views

wifite is giving ZeroDivisionError

I'm using ubuntu 18.04 LTS. Tried pen-testing my own router by handshake capture using wifite2 (Version-2 to be noted). But when it starts attempting the password file which contains one entry only (...
1
vote
1answer
39 views

Common way to install packages in Windows

I'm not an expert on Windows, so my apologies if this question is either stupid or not of a good quality. I have a small software pipeline in Ubuntu (16.04 LTS) which is composed of few libraries (C++...
0
votes
1answer
31 views

Split PDF by size - Size of the split PDF increasing

I have created a PDF Splitter using PyPDF2. It splits PDFs that are more than 20Mb in size into multiple smaller PDFs. The logic I am using is to split all the Pages into single Page PDFs, find each ...
0
votes
1answer
20 views

How can I setup headers directives on my app engine?

So I was scanning my website for vulnerabilities and I found this one but I don't know how can I fixed it in the google cloud app engine: I really don't know where I should include the header ...
0
votes
1answer
157 views

How to activate python virtualenv through shell script?

0 I have to activate the virtual environment (venv) so I running these commands manually in terminal: source .venv/bin/activate # To activate the virtual env. and deactivate ...
-1
votes
0answers
9 views

Bulk edit date format in exported chats (.txt file) [migrated]

This is the chat file exported from an instgram .json file This is how I want to alter the date format to look like I am trying to edit the exported chat file in .txt format and change the format of ...
0
votes
1answer
1k views

Autoindentation in Vim for Python

I'm attempting to switch over to VIM right now, and would like to get it to indent automatically as an IDE would for Python. I've got the following .vimrc file syntax on set number autocmd FileType ...
0
votes
0answers
10 views

Adding pip, pip3, pip3.7 to PATH [duplicate]

Hi after the installation, I got this warning: The scripts pip, pip3 and pip3.7 are installed in '/Users/stevetsang/Library/Python/3.7/bin' which is not on PATH. Consider adding this directory to ...
1
vote
0answers
27 views

routersploit .rsr extension error message

Im posting this question here after recommendation by stackoverflow Im trying routersploit-multi-ip but I am getting the error: ./multi_ip_scanner.sh: line 9: scanner_output/192.168.10.2.rsr: No ...
0
votes
0answers
7 views

pylint extremely slow in sshfs partition

pylint is taking a huge amount of time to lint my *.py files that are stored in a remote partition, which is mounted via SSHFS. If I make a local copy of the files and run pylint on those local copies,...
0
votes
1answer
1k views

pip not found fresh Kali Linux installed

My Fresh kali Linux install doesn't find pip and so i can't run my scripts. So here is what i tried: kali# pip -V Command not found kali# whereis pip pip: kali# locate pip | grep /usr/bin /usr/bin/...
2
votes
3answers
4k views

Ubuntu 20.04: E: Unable to locate package python-pip

I have just installed Ubuntu 20.04 and I have come across an issue when trying to install pip. On my older machines running 18.04, the command ran fine and installed the package. However, when ...
0
votes
0answers
30 views

Cannot resolve “Internal: failed call to cuDevicePrimaryCtxRetain: CUDA_ERROR_INVALID_VALUE” error in Tensorflow

When I run this simple script, import os os.environ["CUDA_VISIBLE_DEVICES"]="0" import warnings with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=FutureWarning) ...
1
vote
0answers
25 views

simple way to remotely trigger my pc

I have a python script which updates data on my google sheets which I access through my phone alot. I'm trying to enable me to trigger that script remotely, even if I'm not at home (outside LAN). ...
0
votes
1answer
48 views

How to compress or normalise or level audio recordings?

I have an phone recording, where one person sound much MUCH louder than the other because it was recorded only on one side of the phone. The original audio I was given was in mp3 format, where only ...
0
votes
1answer
23 views

How can I run programs in tmux panes simultaneously?

I'm trying to make a script that opens up 4 tmux panes, and launch a python program inside of it. I want to do it simultaneously, but I don't know how. I tried tmux new-session "python 'DogeClickBot ...
0
votes
0answers
29 views

FFMPEG, running through subprocess, getting error: “pipe:: Invalid data found when processing input”

Im writing a program which getting the stream from ip camera, do with frame what i need and send to ffmpeg for transcoding. Then ffmpeg should convert video and send to output url. But when i running ...

1
2 3 4 5
60