Stefano Mtangoo 455 Senior Poster

Nope, sorry same thing. You're saying that link allows you to download 2.8 and it works?

I have not tested whether Installation works or not. But this is a link I retrieved in my FreeDownload manager, I downloaded long ago. I tested it in FDM and it started downloading. I expected it to work since it is direct Link to download a file
Sorry :(

Stefano Mtangoo 455 Senior Poster

I'm sorry for that!
Here is a mirror I have tested and it works. Hope you will try it soon before all goes wrong

http://garr.dl.sourceforge.net/sourceforge/wxpython/wxPython2.8-win32-unicode-2.8.10.1-py25.exe

Stefano Mtangoo 455 Senior Poster
Stefano Mtangoo 455 Senior Poster

what editor do you use?
Get ulipad
http://code.google.com/p/ulipad/

shadwickman commented: ulipad is amazing, thanks for mentioning it! +3
Stefano Mtangoo 455 Senior Poster

How far have you tried/brainstormed?
Hint: Check os.path.join() and lower() function

Stefano Mtangoo 455 Senior Poster

http://alleg.sourceforge.net/readme.html
it says alleg is for multimedia and games.
So to my understanding, it is simply aimed not at General GUI but geared to multimedia/games

Stefano Mtangoo 455 Senior Poster

Oh! Learning wxwidgets and C++ are easier, at least for me it have been. You use C++ codes. Only there are ready classes that you inherit to make your GUI and all the widgets. So with GUI, you must be immersed in C++ OOP concepts especially Inheritance.

That Book plus tutorials like one in www.zetcode.com should boost you up. But In case you choose wxWidgets as your GUI toolkit.
Here are GUI toolkit (Heavy weight ones) that closely compete:
1. wxWidgets
2. QT
3. GTKmm

So once you choose one, you have a go! :)

Stefano Mtangoo 455 Senior Poster

Go for wxWidgets. It is simple and have heavy documentation.
Go to :
www.wxwidgets.org
and
www.zetcode.com
With a bonus of free official book in Bruce Perens open source series, It is really best stuffs
http://www.phptr.com/content/images/0131473816/downloads/0131473816_book.pdf

Stefano Mtangoo 455 Senior Poster
Stefano Mtangoo 455 Senior Poster
import wx
import wx.calendar

class MyFrame(wx.Frame):	
	def __init__(self, parent, title):
		wx.Frame.__init__(self, parent, -1, 'tLapse', wx.DefaultPosition, (560, 472), style=wx.CLOSE_BOX | wx.SYSTEM_MENU | wx.CAPTION | wx.RESIZE_BORDER | wx.FRAME_NO_TASKBAR | 0 | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX)
		self.panel = wx.Panel(self, -1)

		self.button1 = wx.Button(self.panel, -1, 'Quit', (448,400), (75, 20))
		self.button1.Bind(wx.EVT_BUTTON, self.exit_now)
		self.button1.SetFont(wx.Font(8.25, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, 'Microsoft Sans Serif'))
		self.button1.SetCursor(wx.StockCursor(wx.CURSOR_DEFAULT))

		self.textbox1 = wx.TextCtrl(self.panel, -1, 'Time in hours', (336,64), size=(100, 20), style=wx.TE_PROCESS_ENTER)
		self.textbox1.SetFocus()
		wx.EVT_TEXT_ENTER(self.textbox1, -1, self.OnEnter)
		 
		self.textbox1.SetBackgroundColour(wx.Colour(255, 255, 255))
		self.textbox1.SetFont(wx.Font(8.25, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, 'Microsoft Sans Serif'))
		self.textbox1.SetCursor(wx.StockCursor(wx.CURSOR_DEFAULT))

		self.label2 = wx.StaticText(self.panel, -1, 'Enter time in hours after which the selected program will open:', (8,64), (316, 17))
		self.label2.SetFont(wx.Font(8.25, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, 'Microsoft Sans Serif'))
		self.label2.SetCursor(wx.StockCursor(wx.CURSOR_DEFAULT))

		self.label3 = wx.StaticText(self.panel, -1, 'Welcome to tLapse. Select the program which you want to open:', (8,16), (332, 23))
		self.label3.SetFont(wx.Font(8.25, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, 'Microsoft Sans Serif'))
		self.label3.SetCursor(wx.StockCursor(wx.CURSOR_DEFAULT))

		self.textbox2 = wx.TextCtrl(self.panel, -1, '', (48,112), size=(279, 146), style=wx.TE_MULTILINE)
		self.textbox2.SetBackgroundColour(wx.Colour(255, 255, 255))
		self.textbox2.SetFont(wx.Font(8.25, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, 'Microsoft Sans Serif'))
		self.textbox2.SetCursor(wx.StockCursor(wx.CURSOR_DEFAULT))

	def OnEnter(self, evt):
                time_user=self.textbox1.GetValue()
		self.textbox1.SetValue("")
                self.textbox2.write(time_user)

	def exit_now(self, event):
		self.Close()
                
class MyApp(wx.App):
	def OnInit(self):
		frame = MyFrame(None, 'App')
		frame.Show(True)
		self.SetTopWindow(frame)
		return True

app = MyApp(True)
app.MainLoop()
Stefano Mtangoo 455 Senior Poster

I have never done RAD GUI designing.
I tried recently wxGlade and In minutes I was able to do alot. It is ugly but really powerful. It generates clean pyCode and I recommend it. Take simple tutorial it come with and there you have your flight. I think it should have been designed like wxformbuilder but I thank them even for "ugly" wxglade

scru commented: props to you for being able to stand the ugliness. +6
Stefano Mtangoo 455 Senior Poster

Just in case you don't fine wxGlade or BoaConstructor to be quite what you need (or if you just can't get past how ugly they are), you can try QtDesigner for pyQT (comes with the pyQT package).

Be sure first you like their GPL/Commercial licence. I lately visited PyQT web and sad enough, they still stick to their Old bad (at least to me) Licence. I would like to see them switching to LGPL as the QT 4.5.x That would be great!

Stefano Mtangoo 455 Senior Poster

Good start is wxPython's web www.wxpython.org
Then Go to their wiki. If you will walk there there is a link to Jan Bodnar's site www.zetcode.com/wxpython and www.learningpython.org Also there is a mouse vs python (google it) Are great sites for tutorial.

Hard coding is better than GUI Builder, for your code will be cleaner and better documentation :)

Stefano Mtangoo 455 Senior Poster

and consider wxPython as to my HO is the best toolkit. I'm waiting for PyQT to switch to LGPL Like its father QT. Until then I recommend wxPython.
www.wxpython.org

For simple stuffs, Old good TkInter might help! :)

Stefano Mtangoo 455 Senior Poster

Consider the shadwickman's saying.
But easy answer is use of break to terminate the loop. any loop can be exite anytime using break statement

Stefano Mtangoo 455 Senior Poster

Big up Ene!
Good work! I didn't knew that Python is that much intelligent
+1 :)

Stefano Mtangoo 455 Senior Poster

Embedding image? Yes possible but sound? Not sure!

Stefano Mtangoo 455 Senior Poster

Alternatively you can add python to your environment variables so that you just navigate to the file in command prompt and type command: python yourscript.py and there you go!

Stefano Mtangoo 455 Senior Poster

This tutorial helped me alot to start wxPython
http://zetcode.com/wxpython

Stefano Mtangoo 455 Senior Poster

It have been easier for me to "Hard code" than using designers. You have complete control over the code and can do any change and of course code re-use :)

Stefano Mtangoo 455 Senior Poster
Stefano Mtangoo 455 Senior Poster

foreach($array as $value) simply means, for every element in the array, assign its value to $value.
foreach($array as $key => $value) assigns the index of the array to $key and value of that index to $value.
:S I hope I am not confusing you!
This is almost similar to for loop.

for($i=0;$i<count($array);$i++) {
  echo "Key is".$i."Value is".$array[$i];
}
//is same as
foreach($array as $key =>$value) {
 echo "Key is".$key."Value is".$value;
}

You can try some examples here:
http://www.php.net/foreach
http://www.tizag.com/phpT/foreach.php

Stefano Mtangoo 455 Senior Poster

In python, the interpreter will only be meek if you define a variable before you use it. It seems you try to use the variable before defining it. This is where the py Interpreter becomes harsh!

Stefano Mtangoo 455 Senior Poster

where is the code?
I cannot guess what you have written unless you post it

Stefano Mtangoo 455 Senior Poster
Stefano Mtangoo 455 Senior Poster

After looking the image file, it looks like ownership problem. Try to copy that file into another Location and try to double click and see

Stefano Mtangoo 455 Senior Poster

Check default program setting on Ctrl panel.
Then select VLC and set it to all files it is supposed to open.

Stefano Mtangoo 455 Senior Poster

Write "CODE=python" enclosed in square brackets then paste your code from your editor and end it with "/CODE" also in square brackets.
Note, all are without Quotes

Stefano Mtangoo 455 Senior Poster

Use code tags to preserve pythonic look and catalyse rate of answering your question

Stefano Mtangoo 455 Senior Poster
Stefano Mtangoo 455 Senior Poster

Isn't file list a string? Then I guess it should be able to play that. But here is the way I suggest, instead of using directly file names, use indices and random module:
1. Load all paths into list
2. Load random module
3. After music has ended, use random module to select a random index
4. play the file whose index is chosen

here is the random module issue

http://www.google.co.tz/search?q=python+random+module&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a

Stefano Mtangoo 455 Senior Poster
Stefano Mtangoo 455 Senior Poster

Have you contacted tomtelaw?
He was in Pygame business and I think he can help alot. I cannot join this for now, I have alot to do, but wherever I will be able to add anything, I will. Good luck with your project and.....Good idea :)

Stefano Mtangoo 455 Senior Poster

Heeh, wxDemo is a good friend, it have got alot of examples and infact, though little complex in some cases, but they help alot

Stefano Mtangoo 455 Senior Poster
Stefano Mtangoo 455 Senior Poster

dont worry I don't judge you because you are a year 8!
heeeeh

Stefano Mtangoo 455 Senior Poster

Instead of PMing you, why not post here. Unless for private things (which PM stands for), you should be displaying things here.

No critic/hurt inteded, but just correction, if you don't mind

Stefano Mtangoo 455 Senior Poster

I prefer wxpython.
Honestly I will never move to Python 3 until wxpython comes out!

Stefano Mtangoo 455 Senior Poster

I don't know if The formula is right (check and change it), but my aim is to show you how to do it rather than accurate answer. So try to poke around :)

import math

def main():
     value = float(raw_input("Please enter the Number: \n "))
     freq = float(raw_input("Please the number of times to loop: \n"))
     # I assume the formula is formula is ((freq + value/freq) / (2))
     container = freq
     t = True
     while t:
          final = (freq + value/freq) /2
          print final         
          container = container - 1
          print container
          if container == 0:
               t = False
     math_value = math.sqrt(value)     
     print "final guess answer is: %f Compared to %f from math.sqrt()" %(final, math_value)

main()
Stefano Mtangoo 455 Senior Poster

Try Exercising with this :)

def MakeDict(dict_name):
    dict_name = dict()
    return dict_name


def AddName(Name, key_name, dict_name):
    dict_name[key_name] = Name
    print "Added " + str(Name)+ "at " +str(key_name)
    
#now we will use our dictionary
#create dictionary
mydict = MakeDict("evstevemd")
print mydict

#Add some stuffs in dictionary
AddName("Boo! Boo!", "calf", mydict)
print mydict
Stefano Mtangoo 455 Senior Poster

hello again, Ive got the basics under my belt and ready to start making things happen:D.
I want to experiment with different things so could you show me to some good tutorials on some of the following things.

1. sending and receive messages through the internet-what library/Mod should i use? [sockets/urllib2/smtp modules]
2. Which would you recommend for a beginner wxWidgets, Tkinter or QT?
3. making a search script that returns results.. [what are you searching? strings, files...??]
4. Databases? [SQLite comes with python -- good start also mySQLdb()not sure if version 3.0 is out]
5. Making a mini notepad...[That is GUI, wxpython does that and more than that]
6. Returning information from a webpage...[already mentioned urllib2]

If you have any other helpful tips do let me know:).
(I'm using Python 3.0)
-thanks

Haven't looked at python 3.0, but I will answer according to what I know from python 2.5
Good start is python global module index at python documentation

Stefano Mtangoo 455 Senior Poster

the best debugging technique is putting print statement/function after few lines to see whether it passes a given statement

Stefano Mtangoo 455 Senior Poster

Try Code blocks. It is another good C++ compiler.
http://www.codeblocks.org/

Also I heard somewhere that this is the updated version of non-updated devC++
http://wxdsgn.sourceforge.net/

Stefano Mtangoo 455 Senior Poster

Using an SQLite database is the simpliest and best. It comes with Python and a tutorial is here http://www.devshed.com/c/a/Python/Using-SQLite-in-Python/

Yeah, SQLite is Ideal for that work. I advice you to take a leap. It is very simple and need no server (Zero config). Try it and you will enjoy. Here is a paper from www.python.org :
http://docs.python.org/library/sqlite3.html

Here google results
http://www.google.co.tz/search?q=python+sqlite&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

Stefano Mtangoo 455 Senior Poster

It is a programming class =)"you programs must match mine exact."

Mhh, I guess this teacher isn't teaching you programming, but conforming!! Programming is all about creativity and not copy and paste. Why does he want you to do that?

Stefano Mtangoo 455 Senior Poster

Are you using Remote Desktop?
How do you try to login? Your explanations are vague. Please elaborate more

Stefano Mtangoo 455 Senior Poster

I would like to learn regular expressions. I have no Idea what it is (I always see people here using). Can someone explain a litle and suggest good tutorial?

Didn't mean to deviate the thread, so keep your first focus on the thread, then you can answer my question

Stefano Mtangoo 455 Senior Poster

Here is another idea...

Just polishing what Kthom has written

infile = open("test.txt", "r")
uppercasecount, lowercasecount, digitcount = (0, 0, 0)
for character in infile.readlines():
    if character.isupper() == True:
        uppercasecount += 1
    if character.islower() == True:
        lowercasecount += 1
    if character.isdigit() == True:
        digitcount += 1
    print uppercasecount, lowercasecount, digitcount
print "Total count is %d Upper case, %d Lower case and %d Digit(s)" %(uppercasecount, lowercasecount, digitcount)
Stefano Mtangoo 455 Senior Poster

Whoop! I didn't saw that elegant example that Vega already wrote

Stefano Mtangoo 455 Senior Poster

Take this example:
you have class of pets and each have method/attribute. See how self applies. Not very neat (one can make it more tidy and neat) but gives idea.

class Dogs():
    def __init__(self)
    
    def OnBarking(self, voice):
        #make voice be attribute/belong of self which is now Dogs class
        self.voice = voice
        self.voice = "baah, baah"
        print "Dog cries wuh! wuh! Wuh!"

class Cats():
    def __init__(self)
    
    def OnMeowing(self, voice):
        #make voice be attribute/belong of self which is now cat class
        self.voice = voice
        self.voice = "Meeh Meeh Meeh"
        print "Cat cries Nyaau! Nyaau! Nyaau!"