[Tutor] I'd like to sort (symbol, address) set by address

Andrei Kulakov ak@silmarill.org
Mon, 15 Jul 2002 11:10:55 -0400


On Mon, Jul 15, 2002 at 02:36:23PM +0100, Geonjae Lee wrote:
> 
> Hi all.
> I'm new to python.
> These days, I'm trying to use python for my work.
> My symbol file contents are like below.
> 
> ===================================================
> 
> C$$zinit$$Base		11da1c0
> C$$zinit$$Limit		11db840
> watchdog_data$$Base	1101584
> watchdog_data$$Limit	11015d0
> 
> =====================================================
> 
> What I'd like to do is to sort my symbol files by address(second item).
> I think first I have to convert second item value to integer. 
> so Is there any methond that change input(hex) to integer ? 
> 
> And second, how can I sort by second item ? 
>
You have to create a list of tuples (2nd item, 1st item), then simply
do mylist.sort() method. 

> 
> I'd appreciate any help. Thanks.
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
> 
> 

-- 
Cymbaline: intelligent learning mp3 player - python, linux, console.
get it at: cy.silmarill.org