View Full Version : python programming at work.... interesting
jin choung
06-30-2009, 11:26 PM
finally,
i have a non trivial excuse to actually code something.
it's a pretty simple file management script to help out with asset management and i'm just hacking it together in the ugliest way possible as long as it does what i want.
couple of insights:
- as it is in 3d, as long as you know WHAT you want to do and are familiar with a few of the methods (non technical meaning) involved, it's just a matter of looking things up for syntax and that's pretty simple. so i understand now how many folks program in lots of languages... it is not dissimilar from working in maya, zb and lightwave.
- no wonder linux users as well as old school command line computer users had a jump start on programming... doing a lot of file operations can be very very necessary and yet at the same time, very very tedious.
it almost PUSHES you into hacking just so that you can avoid ridiculous amounts of repetition. and the fact that linux have a grip and a half of different shells that are very very powerful gives you a nice baptism by fire.
working in windows, i guess i could have attempted this as a dos batch file but what the hey, might as well get a jump on python.... all the cool kids seem to be doing it.
- 64bit oses make everything harder... my preferred flavor of python - active python doesn't work on work's xp 64.... good thing idle is quite good.
that is all.
jin
p.s. i think i've finally discovered the (a) meaningful significance of python's mantra - "EVERYTHING is an object" - it means EVERYTHING including variables and stuff that you make up on the fly can and do have "dot operators" and embedded methods. this is the first time that python mantra actually meant anything to me.
Cohen
07-01-2009, 12:53 AM
Yeah python is pretty kewl, I program in java though (also opensource) :hey:
I'm not sure what kind of archiving program you would want to do in python that would be easer than a bat file.
- no wonder linux users as well as old school command line computer users had a jump start on programming...
Speaking of the command line, there are many nifty gems there that you can not do in a GUI, or if you could it would take you years, that you can do in a matter of seconds via command prompt. In terms of archiving, you could like call up a TREE command and list every directory of your entire systems foot print in one go, and use a copy command and past it in a spread sheet. Try doing that in GUI. =)- Maybe use some process like that with your content manager? :)
p.s. i think i've finally discovered the (a) meaningful significance of python's mantra - "EVERYTHING is an object" - it means EVERYTHING including variables and stuff that you make up on the fly can and do have "dot operators" and embedded methods. this is the first time that python mantra actually meant anything to me.
I'd say welcome to Object Oriented prorgamming (OOP)? Or in your case, POOP; Python's Object Oriented Prorgamming. **hehe, just kidding, I couldn't help myself. :p But there is soo much more to the idea of OOP than the concept of a class.dot operator and some method (thats really just mnemomics). Like the whole concepts of polymorhpism, inherentance, encapsulation, etc, thats the real kicker. Once you get grasp all that, then you can bear fruit. =)-
Anyways, OOP programming, whether python or not, is just awesome. :beerchug: Right now, I'm making an application that creates patterns of concentric rings using just a simple unit circle and some sine functions. Kindy neat for creating beautiful patterns. Maybe I port it to CORE later. :)
jin choung
07-01-2009, 01:01 AM
hey colin,
oh yeah. i'm all about the oop.... the whole blackbox concept alone just makes me tingle and it was one of the things causing me to push so hard back in the day for nodes.
but python's mantra of "EVERYTHING is an object" (which is not ubiquitous... c++ doesn't go around saying that for instance) was something that didn't have a meaningful manifestation for me until i saw that "EVERYTHING" can and DOES have a dot operator.
jin
p.s. thanks for the tips on shell stuff... every drop of info when it comes to shell scripting and programming will likely be something new to me.
Cohen
07-01-2009, 01:26 AM
but python's mantra of "EVERYTHING is an object" (which is not ubiquitous... c++ doesn't go around saying that for instance)
I don't know Python, but that sounds really cool at face value. But with Java, and C++ in my understanding, things that are not commonly thought of as objects, really are objects. For instnace, in java you instantiate primitive data types all the time, which are techincally nothing more than object reference variables, constructed by their parent class, inhereting any visible modifiers. And these are just primitive types. Strings also object referenece variables, same is true in C++. So I don't get super excited when I read that.
jin choung
07-01-2009, 01:43 AM
I don't know Python, but that sounds really cool at face value. But with Java, and C++ in my understanding, things that are not commonly thought of as objects, really are objects. For instnace, in java you instantiate primitive data types all the time, which are techincally nothing more than object reference variables, constructed by their parent class, inhereting any visible modifiers. And these are just primitive types. Strings also object referenece variables, same is true in C++. So I don't get super excited when I read that.
yeah... like i said, the significance of it, the emphasis on it, bounced off me for the most part until the dot operators epiphany.
despite the best efforts of introductory works like this to hammer it into me: http://www.diveintopython.org/getting_to_know_python/everything_is_an_object.html
jin
akademus
07-01-2009, 02:29 AM
Sounds very interesting. I, however, abandoned all programming long long time ago and just have no nerves to dwell back to it. Just a bit of expression writing in LW and AE.
Good luck Jin.
jin choung
07-01-2009, 03:01 AM
Sounds very interesting. I, however, abandoned all programming long long time ago and just have no nerves to dwell back to it. Just a bit of expression writing in LW and AE.
Good luck Jin.
thanks!
yeah, i hear you. programming's kind of a tough nut to crack for adults cuz we're so far beyond the trivial exercises but completely out of our depth in trying to program something when we can't readily download a utility for free off the web. that's why this file/folder manipulation exercise is such a cool thing for me. couldn't find anything else that would do what we needed but what we needed was extremely repetitious and compact. perfect adult exercise. (i do so love those 'adult exercises'.... >sniff<)
also, melscripting in maya really sucks you in, claws at you really until you're doing much more than you ever intended.... love maya for that.
but if you're involved in expression writing at all, you're already in pretty risky territory.
that's the gateway drug dontcha know. sure, just a puff or two of a cosine here and a couple of assignations to a variable there... harmless right?
and then POW, you're elbows deep writing a module in assembly language.
just say no to the command line.
jin
Titus
07-01-2009, 10:52 AM
Python is ok, but I'm more pragmatic and my choice of language depends on the task. I had the need for basic crowd control in a project, Perl was the solution to read and modify a .LWS:
http://garagepost.tv/peliculas/ola_test_jun29_h26a.mov
Stooch
07-02-2009, 01:37 AM
Python all the way for me. Got it working with Maya quite well. Doing alot of pipeline integration and various Maya/realflow tools.
akademus
07-02-2009, 02:33 AM
thanks!
yeah, i hear you. programming's kind of a tough nut to crack for adults cuz we're so far beyond the trivial exercises but completely out of our depth in trying to program something when we can't readily download a utility for free off the web. that's why this file/folder manipulation exercise is such a cool thing for me. couldn't find anything else that would do what we needed but what we needed was extremely repetitious and compact. perfect adult exercise. (i do so love those 'adult exercises'.... >sniff<)
also, melscripting in maya really sucks you in, claws at you really until you're doing much more than you ever intended.... love maya for that.
but if you're involved in expression writing at all, you're already in pretty risky territory.
that's the gateway drug dontcha know. sure, just a puff or two of a cosine here and a couple of assignations to a variable there... harmless right?
and then POW, you're elbows deep writing a module in assembly language.
just say no to the command line.
jin
Hehehe. You're right. I was fairly interested in Mel, but I simply wanted to do some other stuff during my work and after. I started off with C64 basic, moved to C later on, did some interesting stuff, but I figured I hate searching for faulty lines of code (it was the hard way back then).
Well, I managed to stay off cigarettes, alcohol and blond women, so I reckon I'll be able to stay off command line too :D
Good luck on your ventures, though!
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.