Re-loading updated modules
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
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
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
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 ":"
> 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