Re-loading updated modules

2006-06-27 Thread fileexit
Hi,
Shouldn't python recompile a module if there is a later version of the
code (.py file)? While i am debuging, i always have to exit python and
delete the pyc before every run, then start it again and import the
modules.  It seems that this is the only way for it to recompile the
new code.

What is going on? is this normal behaviour? I noticed that on both
Windows and linux (Fedora Core 4, and 5 and RHEL 4)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to run shell commands within python

2006-02-15 Thread fileexit
thanks... i was to hasty to post this question, i found a good answer
here:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/ffdab847125f81b6

-- 
http://mail.python.org/mailman/listinfo/python-list


How to run shell commands within python

2006-02-16 Thread fileexit
How can I execute shell commands from within python.  Specifically, I
am looking for something like the shell "cat".  But this also made me
wonder how to execute shell commands anyway, just if i needed to do
that in the future.

-- 
http://mail.python.org/mailman/listinfo/python-list


Regular expression gone mad

2006-02-20 Thread fileexit
Hi,
Would someone please tell me what is going on here??!! Why does the
following code work

>>> a=r"Mem"
>>> pat = re.compile(a)
>>> m=pat.search(ProcMem, re.DOTALL)
>>> m
<_sre.SRE_Match object at 0xb7f7eaa0>
>>> m.group(0)
'Mem'


But this one does not!!! (Search finds nothing)

>>> a=r"MemT"
>>> pat = re.compile(a)
>>> m=pat.search(ProcMem, re.DOTALL)
>>> m


ProcMem contains:

>>> print ProcMem
MemTotal:  8247952 kB
MemFree:   5980920 kB
Buffers:417044 kB
Cached: 703036 kB
SwapCached:  0 kB
Active:1440136 kB
Inactive:   370668 kB
HighTotal: 7405512 kB
HighFree:  5977600 kB
LowTotal:   842440 kB
LowFree:  3320 kB
SwapTotal: 8339440 kB
SwapFree:  8339296 kB
Dirty:  96 kB
Writeback:   0 kB
Mapped: 786672 kB
Slab:   359208 kB
Committed_AS:  2453912 kB
PageTables:  24696 kB
VmallocTotal:   106488 kB
VmallocUsed:  8700 kB
VmallocChunk:96708 kB
HugePages_Total: 0
HugePages_Free:  0
Hugepagesize: 2048 kB

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: spliting on ":"

2006-03-06 Thread fileexit

> yyy
> yyy
> yyy
> xxx.xxx.xxx.xxx
> xxx.xxx.xxx.xxx

of course you will get this result...

inside the loop, when line="xxx.xxx.xxx.xxx:yyy"
line.split(":") will give a list ["xxx.xxx.xxx.xxx", "yyy"], and
element -1 will be "yyy"

but when line="xxx.xxx.xxx.xxx"
line.split(":") will give a list ["xxx.xxx.xxx.xxx"], and element -1
will be "xxx.xxx.xxx.xxx"

So the result is very very normal

-- 
http://mail.python.org/mailman/listinfo/python-list