-1
votes
1answer
54 views

concatenating multiple file contents

I have 2 folders containing files: FolderA: file_1M1.txt, file_1M2.txt, file_1M3.txt......... FolderB: file_2M17.txt, file_1M18.txt, file_1M19.txt........ I prepared lists of files on txt files: ...
1
vote
1answer
31 views

Automatically fill command line input of variable size

I have a Python script which asks for some arguments when running (using raw_input). I'd like to be able to run this script and feed it with some inputs (basically, I need to alternate between 2 ...
0
votes
1answer
25 views

Error With Git Tab Completion: “python: can't open file 'manage.py': [Errno 2]”

When I try to tab complete git commands, I receive this python error. Sometimes, it will still complete the command (but after the 3 lines of Python errors), and sometimes it does the following. Git ...
0
votes
2answers
49 views

Linux Distribute Big File and Gather Results

(Don't suggest Hadoop or map reduce solution even they sounds logically the same) I have a big file - 70GB of raw html files and I need to do the parsing to get the information I need. I have delt ...
0
votes
3answers
37 views

Python: Handle globbing within a script

$ script.py *.txt I want to run script.py on all .txt files in this directory, which include 1.txt, 2.txt, and 3.txt. There's two approaches I can think of to this: having the python script handle ...
0
votes
1answer
31 views

how to use os.system() in python for running an shell order

In some shell script, you need to confirm "yes" to run the shell, well, an easier way is using "yes" and pipe, like this: yes | test.py then, you can run the shell script automatically without ...
0
votes
0answers
18 views

Scrapy - Run with python or shell

I was just wondering if anyone could tell me the potential issues or advantages of running scrapy using the CLI or with python. I'm predominantly using python at the moment but currently I'm using it ...
1
vote
1answer
61 views

Python script to run shell command

I'm having a bit of trouble. I want to run a shell command within Python in a specific directory. Based on the code I found on the internet I need the following inclusions: import os import ...
-3
votes
2answers
59 views

How to convert this Python script to a shell script? [on hold]

This is a python script. with open('a') as f: a, b = f a, b = a.strip(), b.strip() it simply opens the file "a" and then first line becomes a, second line becomes b now i can use a and b ...
0
votes
1answer
54 views

Python: get output of the shell command 'history'

My end goal is capture the previous command executed in the terminal. Since ~/.bash_history doesn't include commands from the current terminal session, I can't simply read that file. From another ...
4
votes
1answer
71 views

Complete as-you-type on command line with python

I would like to write a small application/directory/file launcher in python. To make it fast i would like to autocomplete/autosuggest entries. But i want to display these suggestions as the user ...
13
votes
2answers
228 views

Vim [compile and] run shortcut

Basically what I want is a keyboard shortcut in vim that lets me [compile and] run the currently being edited C, C++ or Python program. In psuedocode: when a shortcut key is pressed: if ...
0
votes
2answers
47 views

Application gets closed when terminal is closed, how to stop this?

I have a expect script which is like this #!/usr/bin/expect spawn /usr/bin/firefox https://www.google.com/ soon as i the script is finished.. the terminal closes itself, which is no problem for me. ...
0
votes
2answers
43 views

Python script not returning correct error status

I am new to python,Need some help! PYTHON VERSION: 2.7 SCRIPT import subprocess import sys HOST="user@machine" COMMAND="ps -fu user | grep \"XYZ\" |grep -v grep |wc -l" #Command to be run ssh = ...
0
votes
0answers
24 views

Execute shell commands in Python to use DocSplit

I'm trying to use the command line utility DocSplit from DocumentCloud with Python. Running the commands on the command line works just fine but in python I get the following errors: 1) If I run: ...

1 2 3 4 5 56
15 30 50 per page