View Source Files

Discussion in 'Programming/Scripts' started by flebber, Apr 7, 2007.

  1. flebber

    flebber New Member

    Hi

    I am learning python and wanted to view the source files of a few programs to learn how they were getting the job done. I am on PCLOS 07 (Mandriva Base) and thought the files would be in the usr/src or usr/share directories however I cannot locate them.

    Am I missing something ? Where Should I be looking.

    Cheers
     
  2. flebber

    flebber New Member

    All the tutorials just say "Look at the Source" but with no explanation how. I have done more research into it.

    In the /usr/lib I see a lot of files of the "file.so", in /usr/bin I have found most of it. Also have found that KDE apps source has a good online browsing facility http://techbase.kde.org/Getting_Started and also this site called Cross Referencing linux http://lxr.linux.no/blurb.html.
     
  3. falko

    falko Super Moderator Howtoforge Staff

    What exactly is the problem:
    - You can't find the files you're looking for, or
    - You don't know how to open them to see their contents?
     
  4. flebber

    flebber New Member

    Well I was reading the the "Cathedral and the Bazaar" by Eric Raymond and The learning python book 2nd edition by Mark Lutz, and both refer to reading python source of current programs to learn better technique and understanding.

    So my questions was yes where is the source ? I have now found some of it, and those I have opened with Kate to read. Are there more is there a better way to view them ?
     
  5. falko

    falko Super Moderator Howtoforge Staff

    The location depends on each single Python application.

    To view the sources, you can use any text editor like gedit, vi, nano, joe, ...
     
  6. flebber

    flebber New Member

    So using slocate for example would be the best method to identify all file locations for each program them.
     
  7. falko

    falko Super Moderator Howtoforge Staff

    You could download the sources and unpack them on your desktop computer (before installing them).
     

Share This Page