import sys
my_process = os.popen("ps -ef")
for program in my_process.readlines():
print program[:-1]
make list from processes / per line, separate fields to list, print one field from lists
import os
import sys
import strings
my_process = os.popen("ps -ef")
for program in my_process.readlines():
program = program[:-1].split()
program[7]
write as function, return all programs running
import os
import sys
import strings
def list_programs():
list = []
for program in os.popen("ps -ef").readlines():
program = program[:-1].split()
list.append(program[7])
return list
if __name__ == "__main__":
for pgm in list_programs():
print pgm
using classess
class acl:
readgroups = []
def readwho(self):
print self.readgroups
newc = acl()
newc.readgroups = [ "aaaa" ]
newc.readwho()
['aaaa']
nesting classess
class allattrs(acl,version):
''' just a class '''
ou = allattrs()
ou.version="2"
ou.version
'2'
[ add comment ] ( 8 views ) | [ 0 trackbacks ] | permalink
>>> import re
>>> ip = re.compile('(\d{1,3})\.(\d+)\.(\d+)\.(\d+)'
>>> x = ip.search('ip: 5.6.7.8')
>>> x is None
False
>>> x = ip.match('ip: 5.6.7.8')
>>> x is None
True
>>> x.groups()
...
('5', '6', '7', '8')
>>> x.group()[2]
'6'
>>> x.group(2)
'6'
[ add comment ] ( 5 views ) | [ 0 trackbacks ] | permalink
http://rubidium.dyndns.org/cag/
Temperature compensated antilog circuit
http://www.seekic.com/circuit_diagram/B ... ERTER.html
A BJT is a Current Operated Transistor
http://www.learnabout-electronics.org/b ... ors_06.php
[ add comment ] ( 7 views ) | [ 0 trackbacks ] | permalink
http://pdf.dzsc.com/BCJ/ICL8049BCJE.pdf
[ add comment ] ( 7 views ) | [ 0 trackbacks ] | permalink
http://www.epravo.cz/top/clanky/dohoda- ... 79929.html
[ add comment ] ( 8 views ) | [ 0 trackbacks ] | permalink
http://www.perlfect.com/articles/cgi_env.shtml
$ENV{'REMOTE_USER'} will get the user id.
[ add comment ] ( 8 views ) | [ 0 trackbacks ] | permalink
http://www.qrp.pops.net/af-amp-2008.asp
http://www.scienceprog.com/dual-polarit ... ly-source/
LM317 Calculator V2.0
http://www.whatcircuits.com/lm317-calculator-v2/
[ add comment ] ( 10 views ) | [ 0 trackbacks ] | permalink
http://fluxmonkey.com/electronoize/opampFilter.htm
[ add comment ] ( 10 views ) | [ 0 trackbacks ] | permalink
http://www.infoworld.com/d/security/rev ... oid-189597
[ add comment ] ( 9 views ) | [ 0 trackbacks ] | permalink
http://diyaudioprojects.com/Technical/V ... Regulator/
[ add comment ] ( 9 views ) | [ 0 trackbacks ] | permalink