Python? WTF Am I Doing?

I finished my low-poly, base level “weadling” to use in my trial version of Mudbox last night.  I am enjoying Mudbox a lot more then I do ZBrush.  It just seems easier to pick up.  I’m sure it’s not as robust as ZBrush but it allows me to get in there and be creative a lot faster then I could in the other.  I’ll post some screens of my WIP when I get home.

So for a few weeks now I have been contemplating trying to teach myself a little “programming”.  I figured what the hell…it was either that or the guitar.
I went to python.org and downloaded the api..installed the windows version and away I went.   I must be sick in the fucking head!
I found a site that deals specifically with python and total newbies.   The tutorials were pretty good from my perspective, and I’m sure they are way beneath anyone with some sort of programming knowledge.  I figured that after a couple of years of this, I will probably be able to spell my name:

>>>print “Bruce ” + “Patnaude”
>>>print “Bruce Patnaude”

My problem is…what the hell is the difference between those two commands?  I thought learning nurbs, spline cages, and shaders was hard….jeeesh.

Anyway, I think I’ll continue to plug away at it for an hour or so at night….see where it goes.  I wonder how much an acoustic guitar costs nowadays?

>>> ^z

10 Responses to “Python? WTF Am I Doing?” »»

  1. Comment by Alan | 03/16/07 at 7:33 pm

    Bruce you programming noob!

    The difference mainly is that in the first instance, you’re printing two strings and in the second instance you’re printing one string.

    One thing about programming… there are always a bunch of ways to do the same thing.

  2. Comment by Toto | 03/16/07 at 8:52 pm

    Hehe yeah I admit, I am a noob when it comes to that. Should be fun anyway.

  3. Comment by bloo | 03/16/07 at 10:19 pm

    Did you lose a bet or something?

  4. Comment by Alan | 03/16/07 at 10:20 pm

    Yeah what’s the deal?

  5. Comment by Toto | 03/17/07 at 12:59 am

    Nah nothing like that…..just curious.

  6. Comment by Gnpatton | 03/20/07 at 9:51 pm

    Don’t 3d programs make use of their own scripting language? Are you trying to learn programming to master these scripting languages better?

  7. Comment by Bryan N. | 03/20/07 at 11:48 pm

    Some programs like Maya have their own (MEL) but others use a variety of languages. For instance, XSI uses Python, Perl, JScript, and VBScript on the fly and the API is open to all of them. It’s very nice since you don’t have to learn a dozen different languages to do something. Python is quickly becoming the default for most people. It can be extremely helpful to know this stuff for repetitive or complicated tasks but a PITA for most of us to learn. 🙂

    One thing I love about XSI is that every single action you do shows up in the script editor in the language you prefer so you don’t have to be a scripting genius intimately familiar with the API to make your own custom scripts. Instead you can just perform the action once, go into the script editor, highlight the part of the script you want for a tool, and then drag ‘n drop it onto a toolbar to save it and create a button. This can be a real time saver for repetitive tasks. My most used custom toolbar aligns points together on two axis and I have three of those – one for each ortho view. Rather than selecting two points, scale X local COG – enter 0 and hit enter, scale Y local COG – enter 0 and hit enter, I can just select the points and click the 0scaleXY button I created.

  8. Comment by Toto | 03/21/07 at 1:30 am

    Yessir

  9. Comment by Oliver Smith | 03/22/07 at 1:04 am

    Most programming languages have a secret agenda – they attempt to ‘evaluate’ everything – to turn it into a single entity.

    Try typing this into Python:

    5 + 10 * 2 / 3

    It doesn’t do anything, right?

    That’s because Python “evaluated” it.

    So try this:

    print 5 + 10 * 2 / 3

    What it prints out is the result – the evaluation – of the math (11.66666667), because that’s what it sends on to print.

    In older languages, you might have had to write something like:

    x = 5 + 10 * 2 / 3
    print x

    Modern languages do that for you – the secret agenda.

    So your second line is really:

    name = “Bruce” + “Patnaude”
    print name

    You have to look past the familiar words, tho: The things in quotes aren’t words, they are strings – sequences of characters. The language knows nothing about whats inside of them. When you “add” them like that, it just creates a new “string” which contains all of the characters from the first followed by all of the characters from the second — i.e. “BrucePatnaude”.

    If you want to make the two lines of code actually do the same thing, you need to write:

    print “Bruce” + ” ” + “Patnaude”

    I’ll bring some aspirin in for you tommorrah 😉

  10. Comment by Toto | 03/22/07 at 1:09 am

    God, you suck Oli. I thought I was getting the hang of it.

Leave a Reply »»