lllllIllIlllI 178 Veteran Poster

Dinnertime! Chicken and cheese toastie :P

lllllIllIlllI 178 Veteran Poster

Personally I think what he is coming out with now is all BS to cover the fact that he is a Mac/Apple/Linux etc. fanboi.

It seems a convenient way of saying "Yeah, i lost" without actually saying anything about it.

lllllIllIlllI 178 Veteran Poster

The depth of your belief in Windows as a good operating system has quite frankly surprised me.

How shallow your basis for for arguments were quite frankly suprised me.

lllllIllIlllI 178 Veteran Poster

If by unparsed HTML via script you mean get the source code for a page. Then you do that by using urllib

import urllib

#This is a file like object. 
data = urllib.urlopen("www.daniweb.com")

#So we have to read() it to get the text
print data.read()

Hope that is what you meant :P

SoulMazer commented: Very helpful and follows through +2
lllllIllIlllI 178 Veteran Poster

And seeing its against the rules. Personally (as i said above) i think it should be closed. Moderators?

lllllIllIlllI 178 Veteran Poster

Really, is this going anywhere? I mean is there any point to us continuing to post here? If you want a good discussion you have to give and take, not just instantly say "Your wrong..." because we are right some of the time, and part of a discussion is to admit that.

So grow up and stop trolling.

lllllIllIlllI 178 Veteran Poster

This thread sounds like it needs closing :S

lllllIllIlllI 178 Veteran Poster

WOW,,, you are awsome..

*shakes head* stop. think. No he is not hacking in.. Its sarcasm

lllllIllIlllI 178 Veteran Poster

Mmm, i guess in the end its only rep :P

sknake commented: yup +0
lllllIllIlllI 178 Veteran Poster

Yeah, im not so sure i like the new system. I dont see why someone as useful to daniweb as MosaicFuneral is should only have the same amount of rep power as someone who has only been here for a month.

I think it would be better back at the other system, but seeing this whole problem arose from people not wanting to bury new users i think we should just have a system where you are able to allocate just how many rep points you want to give.

So yeah, my vote is for the old system back.

lllllIllIlllI 178 Veteran Poster

Wait! I only have +1/-1 with 419Reps, but someone with: 46Reps can have +2/-1, and 105Reps gets you +7/-3???

How does this all work now, or is this over the being an ass to DW?

Yeah actually that is really confusing. Just looking around profiles i stumbled upon SoulMazer they have a +2/-1 as their rep power, even though they only have 12 rep points, 70 posts, and have only been on the site since September last year.

Thats a difference of 2 months, and yet that seems to be the thing making the difference. As Mosaic Funeral has loads more posts and tons more rep.. Just wondering how much posts are rep are actually being considered when rep power is being created if that is the case?

lllllIllIlllI 178 Veteran Poster

So, no. I'm no trying Vista or Vista Seven.

Then there it no point trying to preach your ideas to us because your ideas are outdated.

lllllIllIlllI 178 Veteran Poster

Soo, dani. Any chance of having that system they have at Dev Shed Forums?

lllllIllIlllI 178 Veteran Poster

if you havent tried vista or windows7 you arent in a position to talk about the good and bad points of windows vs other systems...

Exactly, things have changed. Once you have educated yourself, then you can start arguments.

lllllIllIlllI 178 Veteran Poster

Okay i have just finished reading the whole thread... And i noticed something you said:

Um, tried Microsoft works back in the bad old days (Windows 3.1) and never touched it since, it was so bad.

Wow, it was bad back then?! Woop Dee Doo. Things get upgraded, you would know that. I used Ubuntu on and off over the past few years. It got better as it was upgraded, lots better. Still every time i went back to windows because you know what? I could double click on a setup and have it work. I didnt have to go to the repositries, make sure i have all of the setup packages. And in the end i could find all the tools i needed on windows.

So if Ubuntu gets lots better with releases, why wouldn't windows? I am still using XP and it works really well, i never have driver issues, crashes, or anything that i cant fix in 10 minutes or less.

So if you havent used windows properly since 3.1 you really should be getting yourself a bit more educated. Its like me saying the latest ferarri has terrible handling and i hated it and its fuel economy. But seeing i am not old enough to drive i obviously don't know this first hand. All you are feeding us and news posts and "I think windows sucks because..." yeah sure opinion is great, but let it be educated.

William Hemsworth commented: Very good points. +0
Will Gresham commented: Agree +0
nav33n commented: well said +0
tux4life commented: Makes a lot of good points. +0
lllllIllIlllI 178 Veteran Poster

Yeah thats a bit messed up. With my rep of 180 i have +2/-1?! :S

lllllIllIlllI 178 Veteran Poster

Yeah i must say i agree with Vernon. I think it would be great if we were able to change the amount of rep we gave.

To make it easy, you could have a default value that automatically went on to save time if needed. But if you wanted you could change. :)

lllllIllIlllI 178 Veteran Poster

I agree with Niek_e its just a number. Nothing to get too fussed about. :)

EDIT: yeah i know this is kinda a turn around from the start of the thread ;)

lllllIllIlllI 178 Veteran Poster

There are a great many prime number generators in the code snippet sections :)

http://www.daniweb.com/code/forum114.html

Otherwise, i would look at techniques to find primes. Then come back with some code if you have any issues.

Here is a great idea http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes

lllllIllIlllI 178 Veteran Poster

mmmm.. I understand what everyone is saying, and i agree it would be great. And i do upvote if i believe it was a good point. But i just dont like the fact that a new person can come over and down vote everything.

Oh well, hopefully as a responsible community we will be able to fight this by upvoting when necessary :).

lllllIllIlllI 178 Veteran Poster

I have noticed in the Python Forum there is nothing but -1's on all of the threads except one.

So what i was wondering is can we limit the amount of down's a poster can do?

For example a member such as myself could do up to 10 down points per day, while JBennet will be able to do 50 and a new member will only be able to up ones that they fund useful. This will stop useless downing.

Just hopefully that will stop a new person just going around stuffing up the system.

tux4life commented: Good suggestion. +0
lllllIllIlllI 178 Veteran Poster

Okay, sounds fun.

1. What i would do is not change where the buttons are, but what colour they are. This means that in your code you can have a sizer easily but the buttons can still change colour meaning blue will not always be down the bottom left of the screen.

2. Use a sizer, find a tutorial and run through it until they make sense. Remember there several types of sizers so take a look at them all.
As well, i wouldnt use PNG's to colour my buttons i would use a regular wx.Button with no text and just use this call to change the colour button.SetBackgroundColour("Green") A great sizer tutorial is here http://zetcode.com/wxpython/layout/

3. That one may be a bit harder seeing you are going to use sizers. An idea you could play around with is making the other buttons dissapear completely and then perhaps you could use the wx.EXPAND flag in your sizer and that would make it expand as soon as anything else wasnt there.

4. Oh gosh, i hate this kind of problem. When i am lazy i just use a simple exec("path/to/script.py") and that just restarts the program. But hopefully someone else will show you a better way to do that :)

Hope that helps :P

lllllIllIlllI 178 Veteran Poster

Ooh exciting. I'm liking these site changes :)

lllllIllIlllI 178 Veteran Poster

Don't forget netbooks, increasingly popular with the tech savvy user :)

Ah happygeek, i knew you wouldn't forget me :)

lllllIllIlllI 178 Veteran Poster

So is there any way to tell (apart from actually checking the threads) if your posts are being up/down rated?

lllllIllIlllI 178 Veteran Poster

Check what python version you have, i think you may have python 3.1 which means that you would not have such thing as a raw_input statement.

So instead of raw_input , just replace it with input . That should sort things out.

Also remember for posting in the future, it is a lot easier for us to understand your problem if you post your error message

Hope that helps :)

lllllIllIlllI 178 Veteran Poster

Just like any new fad ... I came, I saw, it entertained me for a little while, I got bored, I left.

Correct me if im wrong but arent you using it at the moment? There is a whole forum devoted to them..

lllllIllIlllI 178 Veteran Poster

BTW, have you thought about how your going to get the username and password out of the TextCtrl?

It shouldn't be to hard, have a look at the API for the wx.TextCTRL
http://www.wxpython.org/docs/api/wx.TextCtrl-class.html
One of the functon is GetValue() that returns a string of the value in the textctrl, simple :)

lllllIllIlllI 178 Veteran Poster

Well i just think it would be nice to be able to see what was actually being posted about in the tag cloud.

lllllIllIlllI 178 Veteran Poster
lllllIllIlllI 178 Veteran Poster

I have just started to learn this: http://www.youtube.com/watch?v=0dPS-EHl-FE

lllllIllIlllI 178 Veteran Poster

I am a peinist. I spend my time composing, and singing. :P

lllllIllIlllI 178 Veteran Poster

Hahaha, woops :P didnt see someone had already done it! :)

lllllIllIlllI 178 Veteran Poster

Yeah, this was more to give an example of recursion. But some good points :)

lllllIllIlllI 178 Veteran Poster

Yeah i was the same as kaninelupus until 2 hours ago when i got a flood of emails coming through.. :)

P.S. Woot! 700 posts!

Ancient Dragon commented: Congrats on your 700 post milestone :) +36
lllllIllIlllI 178 Veteran Poster

alrighty, here is moi... At a cafe i think, mum turned 41, i accidentally told her a happy 42nd birthday on the card. Woops :P

lllllIllIlllI 178 Veteran Poster

Your code has a couple of issues, if i am not wrong it will not actually start using threading with your code as it is. You need to add a couple of lines

class Thread ( threading . Thread ):
        def __init__(self):
            threading.Thread.__init__(self)

	def run ( Self ):
		subprocess . call ( "mycommand.exe" )

See how i have called the __init__ method on the threading.Thread class? This means that now it will run the __init__ method of the Thread class, which is needed for threading to work properly with classes.

So try replacing you current class with that and try again and see how it all goes :)

Hope that helps

shadwickman commented: Ah, good point. I missed that! :D +4
lllllIllIlllI 178 Veteran Poster

Learn python
http://docs.python.org/tutorial/

Come back when you can do all that and ask a much more specific question

Nick Evan commented: Sounds like descent advice to me :) +19
lllllIllIlllI 178 Veteran Poster

I would basically put all of this in the main function.

load = RockPaperScissors(3, 0)   	
#3 is the number of tries to star with, 0 is the number of points
output_rand = load.random()             
output_decision = load.decision(output_rand)         
output_score =load.score(output_decision)            
output_exit = load.exit()


while condition == 'true':
	print '--------------------------' '\n'
	load = RockPaperScissors(output_exit, output_score)
	output_rand = load.random()             
	output_decision = load.decision(output_rand)            
	output_score =load.score(output_decision)  
	output_exit = load.exit()

So then it will look like this:

def main()
    load = RockPaperScissors(3, 0)   	
    #3 is the number of tries to star with, 0 is the number of points
    output_rand = load.random()             
    output_decision = load.decision(output_rand)         
    output_score =load.score(output_decision)            
    output_exit = load.exit()


    while condition == 'true':
            print '--------------------------' '\n'
            load = RockPaperScissors(output_exit, output_score)
            output_rand = load.random()             
            output_decision = load.decision(output_rand)            
            output_score =load.score(output_decision)  
            output_exit = load.exit()

And then we can add in out exit condition.

def main()
    load = RockPaperScissors(3, 0)   	
    #3 is the number of tries to star with, 0 is the number of points
    output_rand = load.random()             
    output_decision = load.decision(output_rand)         
    output_score =load.score(output_decision)            
    output_exit = load.exit()


    while condition == 'true':
            print '--------------------------' '\n'
            load = RockPaperScissors(output_exit, output_score)
            output_rand = load.random()             
            output_decision = load.decision(output_rand)            
            output_score =load.score(output_decision)  
            output_exit = load.exit()
            if output_exit == False:
                return

And that will work if you have changed the exit function to the one i outlined above.

Hope that helps:)

lllllIllIlllI 178 Veteran Poster

I dont know if its just me, but that dosent quite make that much sense. Just spend a little more time outlining exactly what you actually want, what your problem is. What you have already tried.

Then we will be much better at helping :)

lllllIllIlllI 178 Veteran Poster

Then you will probably use something called recursion.
That is when a function calls itself. It is used in these kind of situations.

def recurse(num,count):
    if count == 10:
        return
    else:
        print num/2
        recurse(num/2, count+1)

recurse(100.0,1)

See, the recursive function has something called a base case. That is something that the recursive function knows what to do with and can stop recursing. So in this case our base case is that if the count is equal to ten then the function will return, therefore returning to the previous function. That in turn returns to the function it was called from up till the top one. But if it does not match the base case we print our new result and continue with recursion.

Hope that helps

EDIT: I made it 100.0 so that it would use decimal places where necessary.

sneekula commented: nice example +8
lllllIllIlllI 178 Veteran Poster

Showing images is easy with wx.StaticBitmap.
http://www.wxpython.org/docs/api/wx.StaticBitmap-class.html

NOTE:This code is borrowed from the sticky

# show  .jpg .png .bmp or .gif image on wx.Panel

import wx

class ImagePanel(wx.Panel):
  """ create the panel and put image on it """
  def __init__(self, parent, id):
    # create the panel, this will be self
    wx.Panel.__init__(self, parent, id)
    try:
        # pick your image file you have in the working folder
        # or use the full file path
        image_file = 'strawberry.jpg'
        bmp = wx.Bitmap(image_file)
        # show the bitmap, image's upper left corner anchors
        # at panel coordinates (5, 5), default is center
        wx.StaticBitmap(self, -1, bmp, (5, 5))
        # show some image information
        info = "%s  %dx%d" % (image_file, bmp.GetWidth(), bmp.GetHeight())
        # the parent is the frame 
        parent.SetTitle(info)
    except IOError:
        print "Image file %s not found" % imageFile
        raise SystemExit


# redirect=False sends stdout/stderr to the console window
# redirect=True sends stdout/stderr to a wx popup window (default) 
app = wx.App(redirect=False)
# create window/frame, no parent, -1 is the default ID
# also increase the size of the frame for larger images
frame = wx.Frame(None, -1, size = (480, 320))
# create the panel instance
imp = ImagePanel(frame, -1)
# show the frame
frame.Show(True)
# start the GUI event loop
app.MainLoop()

Hope that helps

lllllIllIlllI 178 Veteran Poster

Well this was fun, i made myself a little list comprehension to do this for me :)

#Your list is called f in my case 
>>> f = [150,2,16,5,5,1,3,2,1,3,6,6]
>>> print [str(g+1)+" : "+str(f.count(g+1)) for g in range(min(f)-1,max(f)) if f.count(g+1) > 0]
['1 : 2', '2 : 2', '3 : 2', '5 : 2', '6 : 2', '16 : 1', '150 : 1']

So you could appropriate that to do other things but at the moment it just outputs to the screen but im sure it could be used in other ways.

Oh and if there are huge differences between the lowest number and the highest number then maybe xrange would be more suitable. Also notice if there are no counts for the number then it is not added!

Wow, that was fun! :) Hope it helps someone

txwooley commented: Thanks. i'll try that out +1
lllllIllIlllI 178 Veteran Poster

What GUI engine are you talking about? No-one can help with that little information. Spend a little more time on your question and the answer will come a lot quicker.

Nick Evan commented: The newbies continue to grow more lazy +16
lllllIllIlllI 178 Veteran Poster

Well then i would have a look at wxStaticBitmap, that will handle your images no worries, then you can look at wx.Media.MediaControl for playing your files. Then you just have to bind the buttons in the usual way.

wx.StaticBitmap
http://www.wxpython.org/docs/api/wx.StaticBitmap-class.html

wx.Media.MediaCtrl
http://www.wxpython.org/docs/api/wx.media.MediaCtrl-class.html

I wrote tutorials on how to use both of them, find them at: http://wxpython.webs.com/tutorials.htm Take a look at tutorial 5 and 6

vegaseat commented: good refs +11
lllllIllIlllI 178 Veteran Poster

Well i could be a bit biased, i am very much a wxPython guy, i love it, its a smart, easy to use GUI. Oh and also, wxPython is cross platform

People tend to not use Tkinter, as it is not that powerful and does not have that many things going for it.

If you know GTK then there really would be no hard in using pyGTK, but i have found with switching between wxWidgets and wxPython that there isnt that much that is actually the same apart from what is looks like. The general things will stay the same, such as widgets and such, but the code style will be different.

siddhant3s commented: Thank You +3
lllllIllIlllI 178 Veteran Poster

This is the problem:

self.money - self.deposit = self.bankbalance

Change it to this

self.bankbalance = self.money - self.deposit

Your operations always have to be on the Right side of the "=" sign

lllllIllIlllI 178 Veteran Poster

You can return it like this:

def returnTwoThings():
    return 1,2

a,b = returnTwoThings()
print a 
print b
#output
#1
#2
lllllIllIlllI 178 Veteran Poster

there is a really quick way to get a list of even numbers:

list_of_evens= [f for f in range(1,500) if f%2==0]

that should give all the even numbers from 1 to 500 in a list

scru commented: Actually it's one to 499, but I agree that a list omprehension is the easiest route. +5
lllllIllIlllI 178 Veteran Poster

Try printing out what the answer is meant to be and what you are getting through the raw_input() that will show what is wrong quite easily.

SoulMazer commented: Continued, fantastic support. S/he followed through well, also. +1