• Welcome to Computer Association of SIUE - Forums.
 

LOTM: Python Thurs April 23rd

Started by Travis W, 2009-03-25T10:19:13-05:00 (Wednesday)

Previous topic - Next topic

Travis W

I meant to make this thread earlier but completely forgot until i read Tangent Orchard's post.
We will be hosting a LOTM installment on the Programming Language Python on Thurs. April 23rd in EB 1024 at 11am.
The presenter is Micheal Parish (sorry if i spelled your name wrong).
If you have any questions or comments you can post them here.

Travis

William Grim

For any of you willing to venture into python yourself, it's really quite an easy language.  This tutorial from python.org is fantastic.  You can be up and running with some pretty complex solutions to problems in 24 hours with some of the nuances of the language coming to you later.
William Grim
IT Associate, Morgan Stanley

Travis W

The time on this presentation is being changed due to a conflict with our Springfest booth  :hammer2:
It will be moved to later in the day.
I will post the new time when i get it.

Travis

Tangent Orchard

Quote from: Travis W on 2009-04-13T19:41:25-05:00 (Monday)
The time on this presentation is being changed due to a conflict with our Springfest booth  :hammer2:
It will be moved to later in the day.
I will post the new time when i get it.

Travis
Awesome, I might be able to come now. :D I've always wanted to see what Python's like.  (Apparently I'm too lazy to research it myself or something.)  (Busy with homework!  There we go.)

Travis W

Just got the word.
The new time is 3:30 in room EB0012 still on Thursday April 23rd :yes:

Travis

Tangent Orchard

Quote from: Travis W on 2009-04-15T23:00:14-05:00 (Wednesday)
Just got the word.
The new time is 3:30 in room EB0012 still on Thursday April 23rd :yes:

Travis
Cool.  (You'll also want to update the header on the Forum Index. ^_^)

Robert Kennedy

Nice...I don't even have to get up from my seat after Databases.  The LotM will come to me. 

Travis W

It has just been decided at today's meeting that we will be providing pizza and soda at the presentation. :wavetowel:


Travis

rdurham285

How long is the presentation??

I have to work at the bowling alley until four.

Would I be rude walking in late?

Mark Sands

No, you would not be rude walking in late -- people have to leave for class all the time. Although you'll probably miss the pizza and a good portion of the presentation. I'm guessing it'll last close to an hour, but I'm judging from past presentations.
Mark Sands
Computer Science Major

Robert Kennedy

I know most of the people that attended the presentation were Juniors and Seniors...but if there's anyone out there that wants to take a look at Python from an introductory programmers perspective, there's a course entitled A Gentle Introduction to Programming Using Python on MIT's open courseware website.  At first glance it looks like its roughly on par with the CS 140 course offered at SIUE. 

William Grim

Did you guys record video?  I'd say just throw it up on youtube.
William Grim
IT Associate, Morgan Stanley

Jarod Luebbert

Quote from: William Grim on 2009-04-23T21:08:12-05:00 (Thursday)
Did you guys record video?  I'd say just throw it up on youtube.

YouTube only lets you upload 10 minutes of video. It's uploading to vimeo as we speak. I'll post the link soon.
Jarod Luebbert
Computer Science Major

Jarod Luebbert

Here you go guys: http://bit.ly/g8mud

Sorry for the poor audio and lack of editing at the end (mostly directed towards Mark). Were still trying to figure out the best way to record these and edit them together as fast as possible while maintaining quality. The slides should be posted up soon.
Jarod Luebbert
Computer Science Major

Mark Sands

Site update: The site's "done" as it can be, just needs to be pushed. So I'll see about the switch this week.. hint: if you're curious its in "beta".. ;)
Mark Sands
Computer Science Major

Tangent Orchard

Well done, Michael. =) I forgot to ask during the presentation, but you mentioned you normally write Python code in a normal text editor like Notepad or something.  How do you take it from there to an executable?

Jarod Luebbert

Quote from: Tangent Orchard on 2009-04-24T21:26:15-05:00 (Friday)
Well done, Michael. =) I forgot to ask during the presentation, but you mentioned you normally write Python code in a normal text editor like Notepad or something.  How do you take it from there to an executable?

Usually python programs are distributed as just .py or .pyc files, but there are bundling tools out there that create an executable. This is good if you want to be able to distribute your programs without having to worry about if the user has Python installed or not.

To create a .pyc file just:

import py_compile

py_compile.compile("mymodule.py")


And that should generate the bytecode.

You can use http://www.py2exe.org/ for windows or http://undefined.org/python/ (py2app) for mac to make an .exe or .app file.
Jarod Luebbert
Computer Science Major

Mark Sands

Quote from: Tangent Orchard on 2009-04-24T21:26:15-05:00 (Friday)
Well done, Michael. =) I forgot to ask during the presentation, but you mentioned you normally write Python code in a normal text editor like Notepad or something.  How do you take it from there to an executable?

or if you're on a *nix box and you just want to run a simple script, from command line: python filename.py
Mark Sands
Computer Science Major

and459d2

another way on a unix system is to specify the directory where the python binary is located at the top of your file..

Example:   #!/usr/bin/python 

                then on the command line type sudo chmod +x "python-file.py", and then you have an executable python script.

William Grim

The recommended magic file type is actually

#!/usr/bin/env python

This is so your PATH gets checked.
William Grim
IT Associate, Morgan Stanley

raptor

President of CAOS
Software Engineer NASA Nspires/Roses Grant

Robert Kennedy

There's not nearly enough ways to run a .py file it seems. 


rbalfan

I found this in another forum.

Code (python) Select

python -c 'print "\n".join([" ".join(["*"*n for n in t]).center(9) for
t in [(3, 3), (9,)] + map(lambda n: (n,), range(9, 0, -2))])'

raptor

 *** ***
*********
*********
*******
  ***** 
   ***   
    * 
President of CAOS
Software Engineer NASA Nspires/Roses Grant

Mark Sands

Scott's 500th post was a heart, via a python script. win.
Mark Sands
Computer Science Major