Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15
Hello, I'm trying to learn some programming and starting out with Python as it seems to have many fans and seems to be widely used in the UNIX world. I ...
  1. #1
    Linux User netstrider's Avatar
    Join Date
    Jul 2005
    Location
    South Africa
    Posts
    474

    Python please

    Hello,

    I'm trying to learn some programming and starting out with Python as it seems to have many fans and seems to be widely used in the UNIX world. I have done some tutorials and so forth from various websites and I've joined the python mailing list.

    However I have been wondering if there is anyone here who are willing to help me with this personally or someone who also wants to learn programming so we can do this together? Often I find myself struggling and I think two heads are better than one.

    I'll be waiting in anticipation :P

  2. #2
    Linux Engineer Freston's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    1,047
    Jep. I've been wondering whether I should start with Perl or Python, as I sometimes reach the edges of what can be done in bash (and that is quite a lot). I've read some tutorials, but it's hard to do it on your own.


    I always feel it's best to learn from a practical project. If you are interested, I suppose what we could do is translate a script I wrote to Python. It's pretty variated in terms of functionality. It also does what it is supposed to do. But rewriting it in Python would allow for cleaner code and more advanced functionality. At least, that is what I hope for

    Is that an idea?
    Can't tell an OS by it's GUI

  3. #3
    Linux User netstrider's Avatar
    Join Date
    Jul 2005
    Location
    South Africa
    Posts
    474
    Yep!

    Sure as hell is an idea and I'm very excited... Have also looked into the possibility of learning pearl and ruby, but I hear pearl has a lot of modules and stuff and is a very large language so I thought since python is pretty much equally effective and easier (smaller etc.) I'll go with that.

    So when do we start :P ?

  4. #4
    Linux Engineer Freston's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    1,047
    I'll put the script in Programming/scripting

    So you can have a look at it. It's pretty self evident, as I have commented on it. Just read it and let it sink. We'll talk again tomorrow, as I believe it is even later in South Africa than in the Netherlands.
    Can't tell an OS by it's GUI

  5. #5
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,340
    I probably will be able to join you because its been a while since I've done any python stuff and would like a refresher. I've actually been reading a book on Ruby and I think it will be the next language that I will tackle when I have the time.

  6. #6
    Linux Engineer Freston's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    1,047
    Link is up

    Welcome aboard daark.child!

    Sorry 'bout the script though. It's a work in progress.
    I picked it because it seemed like a good place to start. Something practical and not to complex. But with a wide variety of problems to solve. Most of them already solved or solvable in BASH. That might give a good reference point.
    Can't tell an OS by it's GUI

  7. #7
    Linux User netstrider's Avatar
    Join Date
    Jul 2005
    Location
    South Africa
    Posts
    474
    Thanks freston,

    Remember though that I haven't done ANY programming before (not even some bash scripting) so it might take a while for me to figure things out. I did download the script and saved it.

    I'm not sure what it's supposed to do. Asks me a yes/no question and whichever I say is "wrong"...

  8. #8
    Trusted Penguin elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    2,287
    Look at this line of code - see if you can get this one

    if [ $INPUT = 'justwork' ]

    Anyhoo a brief intro to programming. Linky
    If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)


    My new blog. It's probably not as good as I think it is.

  9. #9
    Linux User netstrider's Avatar
    Join Date
    Jul 2005
    Location
    South Africa
    Posts
    474
    if varialble "input" equals (string) "justwork" ?

  10. #10
    Trusted Penguin elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    2,287
    Yes - If that condition is true then perform the action...

    So, based on that, what do you input to make it just work?
    If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)


    My new blog. It's probably not as good as I think it is.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •