Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [python]

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

0
votes
1answer
31 views

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

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
22 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
34 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 ...
0
votes
1answer
26 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 ...
-1
votes
0answers
16 views

Python Selenium WebElement element = invalid syntax [migrated]

I have this python code for Selenium but I have "invalid syntax" highligthing element whenever I run it. { WebElement element = driver.find_element_by_link_text("Cancel") actions builder = ...
0
votes
0answers
7 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
46 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
43 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
25 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
40 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
34 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
33 views

Installing pip pywin32 on Kali Linux

I ran into a problem while programming with Python and PycharmCE on Kali Linux OS. Running: pip install pywin32 Outputs: Collecting pywin32 Could not find a version that satisfies the requirement ...
-1
votes
0answers
8 views

URLError: <urlopen error [Errno 110] Connection timed out> [migrated]

for i, _child in enumerate(df['SECFNAME']): url = parent_link+_child print(url+"\n") url_list.append(url) response=request.urlopen(url) raw=response.read().decode("utf8",errors="...
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 ...
-3
votes
0answers
22 views

Curl problem in Python [migrated]

I'm using python 2.7 and I need a python script like following. The problem is waiting file download everytime for result if curl time condition is True. I want to get result without waiting file ...
0
votes
1answer
14 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
43 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
20 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
17 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
21 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
46 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
19 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
36 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
21 views

How can I escape braces in string to be fed to sub process [migrated]

import subprocess profile_val = 'ishan' cmd = 'instaloader --post-metadata-txt="{likes} likes, {comments} comments, {caption}" --login=blabla_id --fast-update' + ' ' + profile_val) ...
0
votes
0answers
12 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
11 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: ==&...
-1
votes
0answers
5 views

How to compute the distance matrix in pyspark? [migrated]

I have a dataset with 1,00,000 records. I need to find euclidean distance matrix for this dataset. It should create 1,00,000*1,00,000 matrix. In python we have squareform(pdist(x)). As i cannot ...
0
votes
0answers
18 views

Linux command to decompress the files in directories and add them back to one archive

Is there a way to decompress gz files in the directory, sub-directory and then add them back to a new gz archive with the same directory and sub-directory structures. There are more than 8k files and ...
1
vote
1answer
18 views

Running Multiple Line Commands with Python

Python has an option that allows us to pass python statements as an argument to the program. An example usage is $ python -c "print(\"I'm running Python.\")" I'm running Python. In Python's man ...
-1
votes
0answers
11 views

Unable to set jupyter notebook password on Linode

Following the Linode documentation to set jupyter notebook server on my linux machine using Apache web service. While setting password for Jupyter notebook I am getting an error [C 06:18:46.762 ...
-1
votes
0answers
8 views

Usr local bin copied from one rhel to other rhel machine

Usr/local/bin + lib, share, lib64, include .. all folders are copied from one rhel to other rhel machine. now if i run a executable inside bin, will it work? For example, I setup just the python3 ...
1
vote
1answer
40 views

glibc-2.14 compatibility

I'm developing an python application for my company on a RHEL 7.4, development environment. In my prod env, I'm running a RHEL 6.8 (soon to be upgraded). The problem is that I ran my application on ...
0
votes
1answer
42 views

convert string with hidden characters to normal string

is there anyone has an idea about how to remove hidden characters from a string in shell. this is an exemple : #echo $a; [root@localhost ~]# but when i showw hidden characters : #echo $a | cat -v [...
1
vote
0answers
33 views

How to deal efficiently with “Address already in use”?

If I attempt to run my own Python program which listens on a particular port, I may get: socket.error: [Errno 98] Address already in use If the program didn't terminate gracefully. While this may ...
0
votes
1answer
47 views

Passing Bash array to Python script

I am having problem in sending bash array problem_list to python script update_contest.py. Here is my code : bash file : echo $problems declare -a problem_list for i in $problems; do ...
0
votes
0answers
30 views

Why is my PATH so small when opening SSH session through python subprocess?

I'm currently working on a project that requires me to use a python subprocess to execute "i2cset" on a Raspberry Pi2 through SSH but my code keeps telling me that my Raspberry Pi can't find "i2cset". ...
-1
votes
0answers
54 views

youtube-dl can't download from oreilly for change login member

How i can fix it in safari.py in youtube-dl? I used Last version youtube-dl i get this error [safari:course] Downloading login form ERROR: Unable to extract csrf token; please report this issue ...
0
votes
4answers
68 views

How to install Python pip on Nixos?

I can't seem to find the appropriate package that install's pip on Nixos?
0
votes
0answers
40 views

Vapoursynth installation problems

I am trying to install SVP (SmoothVideo Project) on Linux Mint 19.1 and I am running into problems with Vapoursynth installation. When I try to do the part "Building 3rd-party apps from sources -> ...
-1
votes
1answer
27 views

How to remove leading numbers and whitespace from a document with python

I have long file with the following format. 123.I am biniyam sdfjhjkhkjsfsd \n sdfhhkjhkjhksdfl \n 14.I am in cybersecurity \n fdkjskdlfnmnjhuksnfe,h \n 872.I love soccer. \n I wanted to ...
1
vote
1answer
54 views

OS X security blocking brew installation of python

Running Darwin Home 18.5.0 Darwin Kernel Version 18.5.0: Mon Mar 11 20:40:32 PDT 2019; root:xnu-4903.251.3~3/RELEASE_X86_64 x86_64 Trying to finish updating python... but failing to link it cause of ...
2
votes
1answer
64 views

Best way to create a user with a password without any user interaction? (asking user for password) (Ubuntu)

I'm creating a python script that will create user accounts with an username and a password from an excile file. I'm having trouble finding a one line command that will create an user with a password ...
0
votes
1answer
103 views

Unable to install PIP on Linux

I am trying to install pip on my Linux environment, but it is not installing properly. Python version - 2.6.6 When I try to install pip using the following command, python setup.py install ...
0
votes
0answers
34 views

Using Anaconda Python and Atom Platformio Ide Terminal

I'm trying to run some Python scripts in Atom using the platformio-ide-terminal, but it's not running the scripts as when I just open a terminal. I have Anaconda installed and that's how I'm running ...
0
votes
1answer
54 views

Default python command points to anaconda instead of /usr/bin/python

I've somehow messed up my python installation, while trying to update to Ubuntu 19.04 from 18.10. The python command points to my anaconda's python instead of /usr/bin/python. > which python /...
0
votes
1answer
52 views

Run Selenium Python script without headless mode on Linux Server

I have a script that I want to run on Linux server That script downloads CSV file from amazon after log in. I have achieved the goal with Chrome web driver (Chromium) using selenium in Python. My ...
0
votes
0answers
18 views

Occurred an error when trying too install packages for python

When I tying to install some package with pip for python in raspbian I occurred an erros as showes in picture http://uupload.ir/files/vasg_20190428_135436.jpg
0
votes
1answer
87 views

pip install opencv-python gives error on Raspbian

I'm using a Raspberry Pi 3 B+ with Raspbian installed. When I run pip install opencv-python I get the following message: Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple ...
0
votes
1answer
18 views

How to create a process that runs a script until another process ends

I want to monitor the power that my system needs when i run a Benchmark. When the Benchmark ends the monitoring process should be killed . The monitor script is written in python. How do i do that?