Skip to content
Advertisement

Tag: python

How to write a bash script which calls itself with python?

Can someone explain how this bash script works? The part I don’t understand is “””:”, what does this syntax mean in bash? test running result: Answer That’s clever! In Bash, the “””:” will be expanded into only :, which is the empty command (it doesn’t do anything). So, the next few lines will be executed, leading to exec. At that

Can’t output Python Print in PHP

I’m really stuck on this one, but I am a python (and Raspberry Pi) newbie. All I want is to output the print output from my python script. The problem is (I believe) that a function in my python script takes half a second to execute and PHP misses the output. This is my php script: I’ve included the commented

How to avoid defunct python processes in Linux?

With python3 (3.4.3) on Ubuntu 14.04 I have created a Forker class which I use in two different processes to create child processes. Here is the Forker class: In the two different Linux processes I derive from this class and then call e.g. something like: However, I still get a couple of defunct python processes: Maybe there is something I

differentiate sudo and

I would like to make my user run as sudo and as a normal user depending on his choice.He could use sudo or normal but on not using sudo I have to disable some functionalities to get rid of errors.So how could I know that user as given me sudo permissions to execute or not? I am building my application

Automating installation of tripwire via python in Linux

I am trying to automate installation of tripwire via apt-get through Python’s subprocess module in Ubuntu Linux. The problem I have is that during the installation process, Tripwire is prompting me for Postfix mail configuration, setting site.key and local.key through different set of configuration pages (see picture attached) which appear after apt-get has installed. How can I use subprocess module

Executing several commands at once [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago. Improve this question I am trying to write something in Perl (but I’m also happy with Python or PHP to do the same) which: Takes a list (of

Advertisement