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
4 views

Add exception to UFW Firewall for python http server directory listing in Route IP 10.42.0.1 Ubuntu?

i'm trying to list a directory using this python command: sudo python3 -m http.server --bind 10.42.0.1 80 But, ufw firewall blocks the traffic of the route ip 10.42.0.1, and the devices connected to ...
0
votes
1answer
18 views

Run command based on IP address received

I'm looking at if I can have a bash/python script that triggers a command based on the IP address Linux has received via DHCP. e.g. DHCP received: 10.50.10.51 /24 runs command XYZ DHCP received: ...
0
votes
2answers
43 views

check ssh-key multiple servers

I need to make a script to check authentication of an user with ssh-key on multiple Redhat servers, approximately 980 servers. User can edit script for userID and private ssh-key location. Script ...
0
votes
1answer
23 views

Copying files, verifying and then zipping with a shell script

I am looking to create a script - a linux or a python scrip so that it can create the following things for me as well as Verify the files for me which are copied from a folder. I Have two folders: ...
1
vote
1answer
10 views

How to schedule a python script cron job that have packages in virtual environment?

I have my env where I installed all needed for me packages. And where I have my script that I want to put to the crontab. What I did, but there are a problem that when crontab running my script, of ...
1
vote
1answer
38 views

Can unicode characters be programatically defined in python 3.7?

I'm trying to write a python 3.7 function that prints the unicode character for a playing card (using wikipedia as a reference). Each of the unicode character is a string that can be represented as '\...
0
votes
0answers
14 views

paramiko.ssh_exception.ChannelException: (1, 'Administratively prohibited') [on hold]

I got the error "paramiko.ssh_exception.ChannelException: (1, 'Administratively prohibited')" when trying to run python script on vCenter Appliance
4
votes
2answers
303 views

Why does pip3 install in ~/.local on Debian?

I'm testing Debian 10 in a VM to check if i can use it for my stream servers (headless minimal netinstall). Why does pip3 install, e.g supervisor, in ~/.local? I did read the release notes but ...
0
votes
1answer
34 views

Python upgrade does not work

I'm trying to update from Python 3.6.8 to Python 3.7. I followed these steps: sudo apt-get install python3.7 sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1 sudo ...
1
vote
0answers
29 views

How to run Django on Unix server (MobaXterm)?

While server (127.0.0.1) works just fine on PC using Pycharm which uses the Django 'GUI' framework, I've tried to execute the command on unix server (MobaXterm) but it just says that 10.1...1..69 (my ...
-3
votes
0answers
27 views

Which project I should do [closed]

Which Project can I do during my 15 day vocation In shell scripting and in combination with python for Debian distribution
0
votes
1answer
14 views

Busybox init, Kivy python application appears to block execution of ifup

I am experimenting with Buildroot, trying to create a minimal system to optimise cold boot time into a Python application (Kivy GUI). I chose to use Busybox init process because this is supposed to be ...
0
votes
0answers
15 views

Alter environment variables within a shell script runned by systemd

I would like to run a script as a systemd service, the script is a bash wrapper script that runs a python script. The python script needs to run in a specific conda environment. I have tried setting ...
1
vote
0answers
24 views

How to configure Atom for Python?

I installed atom-python-run for running python in Atom. But when I installed python extension in VS Code, then a massage came in that pylint not installed. And I clicked in install button. then a ...
0
votes
0answers
8 views

Using pip and conda to install packages inside virtual envs

I have virtual envs created by Conda. When I am inside virtual envs, I can install packages by either conda or pip. Conda and pip install same program inside virtual directory without checking of the ...
3
votes
1answer
80 views

Why do two users get different versions of the same binary?

I have just updated a package using python-pip. Two different users get different versions of the binary: andrew$ which aws /usr/bin/aws andrew$ /usr/bin/aws --version aws-cli/1.16.194 Python/3.5....
-3
votes
2answers
45 views

Python: removing jpg files without matching txt files

I kindly ask for guidance or support on how to approach coding a Python script to remove .jpg images without.txt files. Presently, I have a train folder with folders images and labels. I am planning ...
0
votes
1answer
39 views

Python script runs manually but not in cronjob

So this is a super weird issue. I have a python script that calls many bash commands via subprocess.call based on certain criteria. Now, the script runs just fine manually but when thrown into a ...
0
votes
1answer
36 views

File read, compare and replace based on comparison in text file

Hi i need guidence to write code for file processing. i have one file which having ~ as delimeter and each line is keyword is 1st column. First i have to find the lines which matches with ^6999 Then ...
0
votes
1answer
60 views

Centos 7 python update package python-2.7.5-80 rpm

I am looking for this RPM python-2.7.5-80.el7_6.x86_64.rpm to address the security issue. yum update not getting this package? Any idea how to get this version of rpm for centos 7? Thanks Update ...
0
votes
1answer
56 views

Installing pandas under python 3.7.3 in debian 9

I have a problem installing Pandas under Python 3.7.3 on a MOXA linux computer running Debian 9. It has a Armv7 Cortex-A8 600-1000 MHz processor. I tried: sudo apt update sudo apt ugrpade sudo apt ...
1
vote
1answer
45 views

Pop!_OS: Spotify Downloader (spotdl: command not found)

I recently installed spotdl (Spotify Downloader) by following the instructions given at GitHub's Installation page. However, when I try to run the tool and execute the commands provided at the project ...
0
votes
0answers
11 views

Access to opt directory [duplicate]

I have a software installed in opt directory - [root@ada-spa oracle]# ls -al total 144560 drwxr-x---. 4 root root 4096 Jun 21 17:19 . drwxr-xr-x. 18 root root ...
0
votes
1answer
27 views

start python script in byobu session at startup

I would like to start a python script at startup inside a byobu/tmux session (and create the session if it doesn't exist), so I can attach to it later. I created a start_script.sh containing the ...
0
votes
0answers
25 views

How to install 32-bit python package on 64-bit system with conda install

I am running ubuntu 16.04 and using 64 bit version of anaconda. I am looking to create 32-bit python virtual environment in a 64-bit machine. Is it possible to do this?
0
votes
1answer
22 views

pass a string with non printable char in hexa to a

I want to pass a string in hexa : 'c3:87:80:00' by instance to a binary I've tried : ./<bin> "$(python -c "print 'c3:87:80:00'")" and ./<bin> "$(printf 'c3:87:80:00')" I've also ...
0
votes
0answers
22 views

Process freezes when using plotting with multiprocessing in Python

I'm parallelizing a process by using the multiprocessing module. The function that is parallelized does plotting and using savefig module saves the plot in pdf format. However, when the code is run, ...
0
votes
1answer
35 views

Is it possible to put the output of one command into the middle of another [duplicate]

I am asking if there is a way to automatically put the output of a command into the middle of another. multimon-ng outputs: ZCZC-WXR-TOR-029037+0030-1051700-KEAX/NWS and i want that output to get ...
0
votes
0answers
26 views

bash -c history produces no output [duplicate]

I am trying to parse and edit the output of the bash builtin command "history" in a language such as C++ or Python. The minimal Python 3.5 program I've tried #!/usr/bin/env python3 import ...
0
votes
1answer
38 views

Background process killed after terminal closes

I have a pubsub python script. When I run the receiver script and send to the background using nohup and &, and close the ssh session, the process is killed. Is there any way to run receiver all ...
-1
votes
1answer
39 views

make a pseudo device like /dev/random that outputs primes?

/dev/primes is what I want without writing C code just python which I have known and easily written the program. The device file should be similar to /dev/urandom that outputs primes instead of ...
0
votes
0answers
15 views

Gnome Tweaks on Manjaro does not launch

I am running Manjaro Gnome on Surface Pro 3 and lately, I'm no longer able to launch the Gnome Tweaks application. I have looked at other posts with the same problem and for other people, it was due ...
0
votes
2answers
49 views

Why does second part of shebang have a priority?

I have python script running under different python executable than default one. I have python executables both in /usr/bin and in /mydir/mybins. If I run, I get: $which python /usr/bin/python And ...
1
vote
1answer
149 views

Upgraded Python, and now I can't run “yum upgrade”

I have upgraded my system (CentOS 7) to Python 3.7 and it seems that has broken a ton of things. In particular, I can't perform a yum upgrade ... [myuser@server ~]$ sudo yum upgrade Loaded plugins: ...
1
vote
0answers
37 views

Can't use pip in red hat 4.4.7

I've installed python 3.7 and pip, but running pip gives me an error: pip3.7 install django pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. ...
0
votes
4answers
41 views

Processing files in specific order

I have 40k images in a folder. The file names follow the following pattern: 1558058263_18ea873ddcf8c65e.jpg 1558408930_63c29ce4462ec194.jpg 1558062887_18ea873ddcf8c65e.jpg In this the first part ...
0
votes
0answers
36 views

How to append two fasta files?

I have two fasta files as shown below, File:1 >Contig_1:90600-91187 AAGGCCATCAAGGACGTGGATGAGGTCGTCAAGGGCAAGGAACAGGAATTGATGACGGTC >Contig_98:35323-35886 ...
-4
votes
1answer
97 views

Writing a Python Script which uses pyWin32 in Kali Linux

I'm trying to make a Python script which runs in windows, but because of reasons I have to write it in Kali Linux. Since it doen't exist on Linux, I can't add the additional libraries I need. Should ...
1
vote
0answers
11 views

how to run multiple instances of a local zimserver in python

I downloaded offline zim archives of websites such as wikipedia.com, stackoverflow.com, unix.stackexchange.com etc. and serve them via below script. #!/usr/bin/env python3 import os import ...
0
votes
1answer
16 views

Mv files listed in txt file up a directory [duplicate]

This is my first time asking a question :) I am new to bash scripting but pretty good with python. I have a directory with a bunch of files, and I have a text file that contains a subset of file names ...
1
vote
0answers
18 views

Remote computer management [duplicate]

I have my PC with Ubuntu 19.04 on it, and I have "server" (it's old laptop with Debian 9 installed). However, getting physical access to laptop is complicated task, because it has some problems with ...
2
votes
1answer
49 views

How can I make a script that opens terminal window, executes commands in it and remains open on Scientific Linux?

I'm working in a remote server that uses Scientific Linux (version=7.6 (Nitrogen)). I did a simple web application in Python3, and I found myself constantly opening a Mate Terminal (though, any ...
0
votes
0answers
33 views

What permissions are required to see USB langid as a user?

As a user, I need to be able to read the langid of a USB device. Run as my user, the output of lsusb -v it gives me limited information on all USB devices (note second line) Bus 001 Device 002: ID ...
1
vote
1answer
18 views

Multiple keyboards — ignore one

I want to have two keyboards connected to my computer, from two different USB ports, of course. One shall work normally, but the other one I don't want the system to collect input from. That one I ...
0
votes
0answers
27 views

How to print on windows shared printer with python?

How can i print on a SMB shared printer on a windows client with python on a different computer with gnu/linux?
0
votes
2answers
53 views

Is there a python module for lsof?

Each time I try to update my Kali Linux by running sudo apt update I get the following error message Unable to lock directory /var/lib/apt/lists/ The way I fix this problem is by finding ...
0
votes
1answer
21 views

Escaping quotes and apostrophes through ssh command execution

I would like to execute the following command through ssh: echo "trap '/tmp/test &' 2 9" >> /tmp/output.txt I am trying to do as follows: ssh 127.0.0.1 -T "echo "trap '/tmp/test &' 2 ...
0
votes
1answer
38 views

Extract data based on second column [closed]

Now I have a file format like ACTG,CD1,234 BGTY,CD2,561 CFRT,CD3,27 DGTY,CD4,45 EYTG,CD5,23 FJUI,CD1,78 GYHJ,CD2,89 HYHG,CD3,107 IUHJHU,CD4,55 JMJGT,CD5,77 I want my output file like: CD1,ACTG,234 ...
0
votes
0answers
13 views

how does a system package know to look in the user python site-directory instead of the system python site-directory?

The virtualenv documentation 1 says: Using pip install --user is less hazardous but can still cause trouble within the particular user account. If a system package expects the system provided ...
0
votes
0answers
13 views

python written AUR helper should not lock packages for root access

I am writing a AUR helper in Python. It should download an AUR package and install it via makepkg and pacman -U <package>. I am encountering a problem here that prevents me to use makepkg: ==&...