On Mar 18, 7:33 pm, [EMAIL PROTECTED] (Aahz) wrote:
> In article <[EMAIL PROTECTED]>,
>
>
>
>
>
> tereglow <[EMAIL PROTECTED]> wrote:
> >On Mar 15, 1:47 am, [EMAIL PROTECTED] (Alex Martelli) wrote:
> >> tereglow <[EMAIL PROTECTED]> wrote:
>
> >>>grep^MemTotal /proc/meminfo | awk '{print $2}'
>
> >>
In article <[EMAIL PROTECTED]>,
tereglow <[EMAIL PROTECTED]> wrote:
>On Mar 15, 1:47 am, [EMAIL PROTECTED] (Alex Martelli) wrote:
>> tereglow <[EMAIL PROTECTED]> wrote:
>>>
>>>grep^MemTotal /proc/meminfo | awk '{print $2}'
>>
>> If you would indeed do that, maybe it's also worth learning something
On Mar 15, 1:47 am, [EMAIL PROTECTED] (Alex Martelli) wrote:
> tereglow <[EMAIL PROTECTED]> wrote:
>
>...
>
> > server using the /proc FS. For example, in order to obtain the amount
> > of physical memory on the server, I would do the following in shell:
>
> >grep^MemTotal /proc/meminfo | awk
Alex Martelli wrote:
> tereglow <[EMAIL PROTECTED]> wrote:
>...
> > server using the /proc FS. For example, in order to obtain the amount
> > of physical memory on the server, I would do the following in shell:
> >
> > grep ^MemTotal /proc/meminfo | awk '{print $2}'
>
> If you would indeed do
tereglow <[EMAIL PROTECTED]> wrote:
...
> server using the /proc FS. For example, in order to obtain the amount
> of physical memory on the server, I would do the following in shell:
>
> grep ^MemTotal /proc/meminfo | awk '{print $2}'
If you would indeed do that, maybe it's also worth learnin
On Mar 14, 10:57 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> In <[EMAIL PROTECTED]>, Laurent Pointal wrote:
>
> > Steve Holden a écrit :
> >> Regular expressions aren't really needed here. Untested code follows:
>
> >> for line in open('/proc/meminfo').readlines:
> > for line in open(
On Mar 14, 9:37 am, "tereglow" <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I come from a shell/perl background and have just to learn python. To
> start with, I'm trying to obtain system information from a Linux
> server using the /proc FS. For example, in order to obtain the amount
> of physical
tereglow wrote:
> Okay,
>
> It is now working as follows:
>
> memFile = open('/proc/meminfo')
> for line in memFile.readlines():
> if line.startswith("MemTotal"):
> memStr = line.split()
> memTotal = memStr[1]
> memFile.close()
> print "Memory: " + memTotal + "kB
Okay,
It is now working as follows:
memFile = open('/proc/meminfo')
for line in memFile.readlines():
if line.startswith("MemTotal"):
memStr = line.split()
memTotal = memStr[1]
memFile.close()
print "Memory: " + memTotal + "kB"
I'm learning the whole try, f
On Mar 14, 11:57 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> In <[EMAIL PROTECTED]>, Laurent Pointal wrote:
>
> > Steve Holden a écrit :
> >> Regular expressions aren't really needed here. Untested code follows:
>
> >> for line in open('/proc/meminfo').readlines:
> > for line in open(
In <[EMAIL PROTECTED]>, Laurent Pointal wrote:
> Steve Holden a écrit :
>> Regular expressions aren't really needed here. Untested code follows:
>>
>> for line in open('/proc/meminfo').readlines:
> for line in open('/proc/meminfo').readlines():
for line in open('/proc/meminfo'):
>> if line.s
> I come from a shell/perl background and have just to learn python. To
> start with, I'm trying to obtain system information from a Linux
> server using the /proc FS. For example, in order to obtain the amount
> of physical memory on the server, I would do the following in shell:
>
> grep ^MemTo
Steve Holden a écrit :
> Regular expressions aren't really needed here. Untested code follows:
>
> for line in open('/proc/meminfo').readlines:
for line in open('/proc/meminfo').readlines():
> if line.startswith("Memtotal:"):
> name, amt, unit = line.split()
> print name, amt,
On 14 Mar, 13:37, "tereglow" <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I come from a shell/perl background and have just to learn python.
Welcome aboard!
> To start with, I'm trying to obtain system information from a Linux
> server using the /proc FS. For example, in order to obtain the amou
tereglow wrote:
> Hello all,
>
> I come from a shell/perl background and have just to learn python. To
> start with, I'm trying to obtain system information from a Linux
> server using the /proc FS. For example, in order to obtain the amount
> of physical memory on the server, I would do the fol
Hello all,
I come from a shell/perl background and have just to learn python. To
start with, I'm trying to obtain system information from a Linux
server using the /proc FS. For example, in order to obtain the amount
of physical memory on the server, I would do the following in shell:
grep ^MemT
16 matches
Mail list logo