I'm trying:
import commands
print commands.getoutput("ps -u 0")
But it doesn't work on os x.
os instead of commands gives the same output:
USER PID %CPU %MEM VSZ ... |
Is there a cross-platform way to list the processes running on one's computer through a python script? For Unix based system "ps -ef" works, but I am new to Python and ... |
I amm writing a little python script that will grab information from VMs of Windows that I am running.
At the moment I can list the processes on a 32bit XP machine ... |
I want to get the list of running processes on the Mac, similar to what you get from 'ps -ea'
I have tried ?os.popen('ps -ea') but this only lists a small subset ... |
I have a list of 16 elements [a00,a01,a02,...,a15] and would like to compute a list [b0,b1,b2,b3,b4,b5,b6,b7] where
b0 = a00*256+a01
b1 = a02*256+a03
b2 = a04*256+a05
(etc.)
what's the easiest way of doing this? (I'm ... |
I want to process the data in the file "output.log" and feed it to graphdata['eth0]
I have done this but it process only the first line:
logread = open("output.log", "r").readlines()
for line in logread:
...
|
Suppose I have a bulleted list like this:
* list item 1
* list item 2 (a parent)
** list item 3 (a child of list item 2)
** list item 4 (a child of ...
|
|
I'm using a third party library that starts various sub processes. When there's an exception I'd like to kill all the child processes. How can I get a list ... |
I have popened a process which is producing a list of dictionaries, something like:
[{'foo': '1'},{'bar':2},...]
The list takes a long time to create and could be many gigabytes, so I don't want ... |
I want to calculate the center-of-mass using the map function. I don't want to use for loops. Help with bottom two lines?
class Obj():
def ...
|
I am running python 2.6.5 on Ubuntu 8.10.
For a project I am working on, I need to run several processes concurrently and save each of their outputs into their own respective ... |
I get a folder with 1 million files in it.
I would like to begin process immediately, when listing files in this folder, in Python or other script langage.
The usual functions (os.listdir ... |
I have a list of files that I am moving from source to dest
for track in self.TrackOlv:
print "-iterate TrackOLV"
...
|
Both list comprehensions and map-calculations should -- at least in theory -- be relatively easy to parallelize: each calculation inside a list-comprehension could be done independent of the calculation of all ... |
While processing a list using map(), I want to access index of the item while inside lambda. How can I do that?
For example
ranked_users = ['jon','bob','jane','alice','chris']
user_details = map(lambda x: {'name':x, 'rank':?}, ranked_users)
How ... |
I want to list all the dlls loaded by a process, like this:
How could I get the information with Python on Windows?
|
i'm trying to make a web only using couchdb and couchapp...
but for some reason i need external process using python..
and now i'm stuck how to handle post variable in python...
i'v read ... |
I am having an issue with writing a list to a file. I am annotating certain files to change them into a certain format, so I read sequence alignment files, store ... |
I have a list of lists, say:
arr = [[1, 2], [1, 3], [1, 4]]
I would like to append 100 to each of the inner lists. Output for ... |
Possible Duplicate:
Monitoring certain system calls done by a process
I need a list and sequence of the system calls(like read, write, open, save operations ) ... |
I've found similar but not identical questions 742371 and 4081217 with great answers, but haven't come to a solution to my problem.
I'm trying to process items in a list ... |
The solution to this is likely obvious to many of you, but I'm stuck so I thought I'd ask.
I have two lists in the following format:
target_list =['apples 1', 'oranges 1', 'bananas ...
|
In the following program, when I append the process to a list (a seemingly pointless thing to do), it runs as expected. But if I remove the append, the processes destructor ... |
def store_negative_numbers(full_list_of_values): notdone = 1 while notdone == 1: for i in enumerate(full_list_of_values[:]): if i[0] == len(full_list_of_values) - 1: notdone = 0 break elif i[1] ... |
|
Re: list active process under windows by annannienann Mon Aug 17, 2009 3:21 am This might be of some use to you. Code: Select all import csv import os import sys import subprocess _TASK_STR_TEMP = \ """Image Name: %s PID: %d Session Name: %s Session #: %d Mem Usage: %d K""" class Task: def __init__(self, image_name, ... |
I was playing around with mutating a list while using it as the source for a list comprehension, and I was a little confused by the output. Here's what I did: Code: Select all >>>x=range(100)[::-1] >>> x [99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, ... |
Help with lists using file processing. by Prempt Fri Apr 27, 2007 9:09 am Hello all. My apologies in advanced if this is not 100% correct formatting for the forum. I have been trying to figure this out for several days now and have come up empty. I am taking Python in a college class and I really love using ... |