I learned how to start a python program from inside the python interpreter using exec, and I tried opening up more than one program at a time. It worked!
>>> f=open('Gridtest.py')
>>> exec f
This is going to be cool, because I can easily start other programs from inside python!
This is a personal record of my python programming experiences. It will allow me to see how I am progressing as I learn a new language.
Saturday, July 23, 2011
Wednesday, July 20, 2011
I love the bluefish editor for javascript!
I found a great linux editor for java script, and it is called bluefish. I love it, and I just found it a few minutes ago.
Saturday, July 16, 2011
I love Tkinters grid manager!
I wrote a simple GUI, and used the grid manager to arrange the widgets. I think I am going to like it better than Tkinter's pack.
from Tkinter import *
#I love Tkinter's grid manager! This is a simple example.
root = Tk()
def startVirus():
print('Erasing hard drive now.')
Label(root, text="First").grid(row=0)
Label(root, text="Second").grid(row=1)
ent = Entry(root)
ent2 = Entry(root)
ent.grid(row=0, column=1)
ent2.grid(row=1, column=1)
btn = Button(root,text='Start the Virus',command=startVirus)
btn.grid(row=3, column=1)
root.mainloop()
from Tkinter import *
#I love Tkinter's grid manager! This is a simple example.
root = Tk()
def startVirus():
print('Erasing hard drive now.')
Label(root, text="First").grid(row=0)
Label(root, text="Second").grid(row=1)
ent = Entry(root)
ent2 = Entry(root)
ent.grid(row=0, column=1)
ent2.grid(row=1, column=1)
btn = Button(root,text='Start the Virus',command=startVirus)
btn.grid(row=3, column=1)
root.mainloop()
Sunday, July 3, 2011
This is my first pickle in python.
I learned how to pickle a list using the pickle module. This is a neat way to store lists, dictionaries, or just about any python object. This is better than storing in a text file because when you unpickle the data it is restored to its original data type.
Subscribe to:
Posts (Atom)
Followers
Blog Archive
- June (1)
- March (3)
- February (1)
- July (3)
- May (1)
- April (1)
- March (1)
- January (1)
- December (1)
- November (4)
- July (3)
- May (2)
- April (1)
- March (6)
- February (2)
- December (1)
- November (1)
- September (3)
- August (3)
- July (1)
- March (3)
- January (1)
- December (5)
- November (2)
- October (1)
- September (2)
- August (1)
- July (4)
- May (3)
- February (1)
- January (1)
- December (1)
- November (2)
- October (2)
- September (9)
- August (2)
- May (1)
- April (1)
- March (6)
- February (5)
- January (3)
- August (2)