Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Python????? The other programming language you never thought of! 2

Status
Not open for further replies.

onpnt

Programmer
Dec 11, 2001
7,778
US
Hi all, I just wanted to share my recent new challenge. Well, my recent, "I got real bored and wanted to learn something new"

A while ago I began a bit of programming in Python mainly on the forms level (non-web). Well, as you all know any programming language that has an active scripting engine can be used for ASP. So, I went into trying it out. Personally, I think I've found my main language for ASP future projects after a bit of freshening. As most say the term "vbscript is a ugly language" This is your way out of using it. And for all you php, perl gurus, well you're going to fall in love with ActivePython!

Here are a few reasons I tried this language out
<src=&quot; &quot;>
1. Very easy syntatical structure

2. Completely object oriented - Python supports all of the OO catch phrases like custom object creation (classes), multiple inheritance, and polymorphism. As a bonus, classes are 100% mutable for runtime manipulation.

3. Code encapsulation and reuse: By using namespaces, modules, and packages, Python facilitates divide-and-conquer programming techniques and the packaging of frequently used code into reusable modules.

4. Named exception handling - Python supports true exception handling. On Error Resume Next? Gimme a break.

5. And finally, probably the most important perk... It's free!

Here is another good article explaining some benefits of ActivePython

You can download ActivePython for running on UNIX, on the Mac, MS-DOS, Windows, Windows NT, and OS/2 here:
Installation is as easy as writing a fi statement.
In case IIS has issues, which I did not on Win98 and Win XP Pro, this link should help

You can get some documentation and tutorials at these links. These are also the ones I found very useful.

The all mighty reference to syntax and programming in Python Book Mark this link



____________________________________________________
The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-2924

onpnt2.gif
 
As always - an execllent post - thanks for the info. If it ever slows down a little here, I'll give it a try.

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
I did and I have to agree, it really is a great language. I've written a few small things in it so far, but loking at some of the stuff out there I'm pretty surprised at everything people have done with it. From websites to mini-game engines and everything in between.

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
minilogo.gif alt=tiernok.com
The never-completed website
 
[smile] thanks mwolf00

you know the sad thing. I (think) got Tarwn into trying this and now of course being who he is, is way ahead of me in playing with it. [sad]

____________________________________________________
The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-3811

onpnt2.gif
 
Looking at both of your signatures, I'm guessing that I should get a site up at some time. You guys make me look like a slacker...

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
[lol]


____________________________________________________
The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-3811

onpnt2.gif
 
Well, you have some time, until I figure out exactly what that power surge did to my computer last night I'm going to be a little busy...of course I don't have the hardware to play video games anymore, so that will free up an additional hour every day...

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
minilogo.gif alt=tiernok.com
The never-completed website
 
hour?!? I think you're being a bit fibby there

____________________________________________________
The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-3811

onpnt2.gif
 
[laughtears]

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
Heh, about an hour, give or take an additional hour ;)

Heh, no really, I average about an hour a day or stress relief purposes. If I ever set up those temp trends to go for a month or something you wil be able to verify it by the spikes, 39 degrees C is Half-life, 42 degrees C is Poostal 2 or Freelancer. Anything less is me doing to much at once :p

Speaking of temp trends, I'm looking into rewriting the process that pushes the data to the webserver in Python. I'm wondering if it might not do better as far as parsing and such are concerned, which would leave me open to send data from the filesystem and winamp much easier.

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
minilogo.gif alt=tiernok.com
The never-completed website
 
Hmm - my PC (Athlon) runs about 60C to 65C - you must have awesome fans or Pentium Chip (is it THAT much cooler?)

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
Good fans and Pentium, 33C idle, 30C in the middle of the night when I'm asleep, I think I saw it get up to 43C once (since I switched out hardware and fans).
Plus I have a 30% overclock on my processor :)
P4 1.6a =&gt; 2.13Ghz

All of the hardware is listed on my site in the personal section, I think I listed fans and heatsinks and so on also. I'll have pictures next week somtime, supposed to get my new camera on friday.

[yoda] Hijacked this post we have

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
minilogo.gif alt=tiernok.com
The never-completed website
 
Another great Python ability:
Say you have a custom library in a COM object that is only supported as a COM object and you don't have the time to write custom wrappers?
There is a win32com library you can use to instatiate COM objects. The best method of doing this is to use a built in tool called the &quot;COM Makepy&quot; utility to make a python wrapper. Then you can access the COM object from python almost exactly as you would from any other language. The only major differences I have seen is in the Unicode encoding and some minor issues with passing values to methods that insist on ByRef.

-Tarwn

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
minilogo.gif alt=tiernok.com
The never-completed website
 
I just can't get over this. passing a array to a function.
let's see you do that with vbscript or jscript. unless there's something I missed all these years without getting type mismatch errors
example:
'vbscript version [as close as I could get it]
Dim MyNames : MyNames = Array(&quot;spongebob&quot;,&quot;fred&quot;,&quot;elmo&quot;)

Function changeFred(arrayChg)
arrayChg = &quot;square pants&quot;
changeFred = arrayChg
End Function
' notice the direct placement at the element needed
document.Write changeFred(MyNames(1))
'ouputs sponge bob

'Python
' def change(arrayChg):
' arrayChg[1] = &quot;square pants&quot;
'
' MyNames = [&quot;spongebob&quot;,&quot;fred&quot;,&quot;elmo&quot;]
' change(MyNames) # pass the entire array to the function
' print MyNames # outputs [&quot;spongebob&quot;,&quot;square pants&quot;,&quot;elmo&quot;]

____________________________________________________
The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-3811

onpnt2.gif
 
Sounds like we'll need a python forum soon, huh?

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
*cough*
forum278
 
[lol]

____________________________________________________
The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-3811

onpnt2.gif
 

hey that was a great post!!! thanks for all the information!!! i just have one question though... :) i'm using tkinter as gui toolkit for python, can you give me some hints?? thanks!!! and one more question, how do i load images in tkinter? into what folder should i save the pic so i can be able to load it?? thanks alot!!!

thanks for all those who keep on posting here!!! you're really of big help to those starting programming!!! thanks alot!!! hope you continue posting for more help!!!!
 
Hi stars19
Here's alink that should help you on the image load in tkinter. I would start a thread in the Python forum though for any further assitance.

see you on the other side [smile]

____________________________________________________
The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-3811

onpnt2.gif
 
Ok, so I need to check out python also...

for onpnt
VB has a param array arguement as well in vb (han't tried in asp vb) you can declare an arguemnet as variant(bad,bad,bad) and pass it an array.

also
and .net does provide direct support for arguements that are arrays.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top