#1
  1. No Profile Picture
    Demonic Swordsman DGQB
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Apr 2003
    Posts
    1,043
    Rep Power
    83

    General Python question


    Can Python scripts be used to manipulate text files (like Perl) and be executable in UNIX?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    325
    Rep Power
    12
    yes.

    perl is better for text manipulation than python.

    Python, however is better for application development, and anything where a script over 100 lines is needed, since perl scrips over 100 lines are pretty much unreadable unless you wrote it urself.
  4. #3
  5. Wacky hack
    Devshed Novice (500 - 999 posts)

    Join Date
    Apr 2001
    Location
    London, England
    Posts
    513
    Rep Power
    14
    lazy_yogi, that's not necessarily true. If you're a good programmer, you're strict about how you lay out and comment your code, and you write clear code without too many crazy hacks, Perl is no more difficult to read than Python. It's just that Python forces you to write clear code
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    325
    Rep Power
    12
    [QUOTE]
    If you're a good programmer, you're strict about how you lay out and comment your code, and you write clear code without too many crazy hacks, Perl is no more difficult to read than Python.It's just that Python forces you to write clear code


    umm ... that's true as far as layout goes.

    But, in perl there is many, MANY ways to accomplish most tasks. So when reading someone elses code, they likely did it very differently to you. Unless you know every way to do everything in perl, it's likely you'll be lost most of the time when dealing with other people's code. In python (same as ruby) there's one way to do everything, so once you see a piece of code, you kow whta it does.

    Eli
  8. #5
  9. Wacky hack
    Devshed Novice (500 - 999 posts)

    Join Date
    Apr 2001
    Location
    London, England
    Posts
    513
    Rep Power
    14
    No, I think it applies to the code itself as well as the layout. You can write truly crazy code with lots of clever little hacks in, or you can write clear, by-the book code. So long as you write it well, it should be no harder to understand than Python.

IMN logo majestic logo threadwatch logo seochat tools logo