[K12OSN] Programming Languages
Huck
dhuckaby at paasda.org
Thu Jul 22 16:53:52 UTC 2004
Shawn posted a few really good links in regards to Python for students...
unfortunately I've moved computers and all my old saved mails didn't
come with me ...
I get my python from http://www.activestate.com...they have it available
for many platforms...
Python is easy enough to learn and works on multiple platforms...has
wxPython which lets you make "windows" programs...
here's a little commandline script I've developed to make usernames for
me =)
Those of you who are programmers thank you for disregarding the lack of
optimization and succinct commenting =)
Input is a textfile with <firstname> <lastname> of user each entity on
seperate lines
Example follows:
#Funkified by Huck on 20/06/04 dd/mm/yy
#string required for the manipulation of strings
import string
#making a nifty menu system below
def print_menu():
print '1. Press 1 to (i)mport the namelist.txt file'
print '2. Press 2 to (g)enerate usernames'
print '3. Press 3 to (p)rint new usernames.txt file'
print '4. Press 4 to E(x)it the Program'
numbers = {}
menu_choice = 0
print_menu()
while menu_choice != 4:
menu_choice = input("Type in a number (1-4):")
if menu_choice == 1:
#Open the file "namelist.txt"
in_file = open("c:\\namelist.txt","r")
#variable "textfile" gets filled with info from namelist.txt
textfile = in_file.readlines()
#Close the file "namelist.txt"
in_file.close()
elif menu_choice == 2:
#The Loopy Loopy
namenum = 0
out_file = open("c:\\my documents\pythonscripts\usernames.txt","w")
print namenum
while namenum < len(textfile):
#Manipulate the namelist into pieces we can handle
mystring = textfile[namenum]
newlist = mystring.split()
fname = newlist[0]
lname = newlist[1]
fname = fname[:2]
lname = lname[:4]
#Concatenate and Write to File
out_file.write(lname+fname+"\n")
print lname+fname+" has been written to file."
namenum = namenum+1
print namenum
out_file.close()
namenum = 0
elif menu_choice == 3:
#Gimme some output baby!
in_file = open("c:\\my documents\pythonscripts\usernames.txt","r")
funkytext = in_file.readlines()
in_file.close()
print funkytext
elif menu_choice == 4:
pass
else:
print_menu()
print "Goodbye!"
#That's All Folks!
enjoy!
--Huck
Liam Marshall wrote:
> In the past years, while working with the evil empire of Microsoft, I
> was teaching among other things, two programming classes. One Grade
> 11 class using the medium of Visual Basic, and one grade 12 class
> using the medium of Java.
>
> I have managed to convince the school to let me break away from the
> evil empire and go to linux in the lab completely. Specifically, I am
> using K12LTSP with thin clients. I have 32 workstations all
> connecting to my server now,( a bit of work but worth it compared to
> the wiping out of workstation hard drives and reloading from scratch
> that I do every year during the summer)
>
> I have Java workable on the workstations and am using an IDE from SUN
> (NetBeans IDE 3.6) it works great!
>
> Now I am looking for a replacement for Visual Basic, which will never
> work under Linux. It doesn't have to be Visual Basic, I was just
> using it before because frankly, it was an easy to learn language with
> alot of mouse work. The operative word is EASY. That way I could
> focus on the concepts of programming without having to focus on
> learning the mechanics of the programming language. With Visual Basic
> the mechanics comes more or less naturally.
>
> What I would like is some language usable with linux that is of a
> similar nature. I would prefer a language that has a nice visual
> component (IDE, read EASY) so that the students introduction to
> programming is not like throwing them into the deep end of the pool of
> programming.
>
> Does such an animal exist? And did I mention that it should be free,
> at least for schools? I convinced them to let me go to Linux at least
> partially with the argument that cost was minimal, if anything.
>
> Please advice. I appreciate all your help, in advance
>
>------------------------------------------------------------------------
>
>_______________________________________________
>K12OSN mailing list
>K12OSN at redhat.com
>https://www.redhat.com/mailman/listinfo/k12osn
>For more info see <http://www.k12os.org>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/k12osn/attachments/20040722/61d61097/attachment.htm>
More information about the K12OSN
mailing list