lllllIllIlllI 178 Veteran Poster

The print statement in python (except python 3) automatically adds a newline at the end.

Wait, i think that in python 3 there is an automatic \n at the end of lines. Here are the default args for print()

print - sep = ' ', end = '\n', file = sys.stdout

So that seems to point towards print actually adding a new line to the end.

Also if you do not want this then just go

print ("Hello there", end = '')
lllllIllIlllI 178 Veteran Poster

Well i would take a look at wx.ButtonPanel, it does the things you want, it can act like an awesome toolbar as well as having an image/gradient as the background. I would love to attach some code as an example but my computer has decided it really dosent want to co-operate right now.

But have a look at the wxPython demo. That shows it with a gradient, its soposedly not that hard to change that to a bmp.

lllllIllIlllI 178 Veteran Poster

Well i know that some of them pop up a new windows for a raw_input/input while others ask you to enter it in the debug window down the bottom or something simmilar.

I know that for many people the pop up box is great but personally i really find it annoying after a while so i generally stick with ones that do not use pop ups.

lllllIllIlllI 178 Veteran Poster

Actually guys i made a programming script that does time travel! :P Its called changing the system clock! And i think that thats the best your going to do for the meantime.

kanaku commented: I know I shouldn't be approving this much sarcasm... but LOL +2
lllllIllIlllI 178 Veteran Poster

For a python tutorial that is good for Python 3.0 Ene Uran pointed us to this link:

http://www.swaroopch.com/notes/Python_en:Table_of_Contents

It has an up to date tutorial brought to you from the people who made dive into python. So if your confused by lots of the posts here because python does not seem to be working have a look at that link, cause you most likely are dealing with python 3.0.

lllllIllIlllI 178 Veteran Poster

This is an example of how to use the with statement in python 3.0:

with open('test.txt') as f:
    print(f.readlines())

	
# output >> ['test']
lllllIllIlllI 178 Veteran Poster

Just an idea but in the regular expression you look for a string that goes "group:" with a colon while in the text file you have it like "group=" so that could be screwing it up.

Murtan commented: I suspect you're right, regexs are picky that way +2
lllllIllIlllI 178 Veteran Poster

There is a great module called winsound.

import winsound
winsound.PlaySound("soundFile.wav",SND_ASYNC)
raw_input()

Just make sure to change the name of the file. FOr more reference check out this page:
http://python.active-venture.com/lib/module-winsound.html

lllllIllIlllI 178 Veteran Poster

Ah, your problem is the following.
You have put in your raw_input() to open the file e:. The problem with that is that you are asking it to open a full directory, not just a file. I had this same problem instead with writing files. You need to specify an actual FILE to open, not a folder or anything else.
So if you put in e:\test_file.txt into the raw_input() and there was a text file called text_file then your program would work.

lllllIllIlllI 178 Veteran Poster

Just make sure that both things you want are methods. I think you will want to do something like:

import wx #if using wxPython
import thread

class Frame(wx.Frame):
    #all the code stuff

def image(path):
    #image stuff

# then you go:
app = wx.App(0)
f = Frame()
thread.start_new_thread(app.MainLoop,())
thread.start_new_thread(image,(path))
shadwickman commented: Threading idea/example was a HUGE help! +2
lllllIllIlllI 178 Veteran Poster

Woops, should have called them paramaters. If you have any that are needed then you put them as the second paramater but if there are no paramaters needed for the MeWin method then you dont need to have a second paramater.
Note that you dont put parentheses after the self.MeWin the the wx.CallAfter.

Stefano Mtangoo commented: Brilliant Boy! +2
lllllIllIlllI 178 Veteran Poster

you can also use eval or exec on the text file if it was like this:

t = 1
variable2 = 10
string = 'hello'

if you had this in your program

f = open('variables.txt')
for line in f:
    eval(line)
    #or exec(line)

That will then set up all of your variables.
Hope that helps

lllllIllIlllI 178 Veteran Poster

That is because when you go self.weapon.attack it logically goes, well self.weapon is a function in the class and then it looks for the variable attack as part of the method weapon. This is a problem and you should change this.

I noticed a lot of the things that you are using in your code have not actually been declared. Make sure to declare all of your variables.

lllllIllIlllI 178 Veteran Poster

Is this what your talking about?

import random
count = input("How long shall the sequence be?")
seq = ''.join([random.choice('AGTC') for x in range(count)])
print "Length:",count
print ">",seq
lllllIllIlllI 178 Veteran Poster

Hi
i have been spending the last few days deciding on an IDE that would let me program in Java, C++ and python and notepad++ looked pretty good. The only issue is i cant work out how to make the program run once i have made it. I looked in google and i couldn't find any tutorials to set it for python but if anyone could help that would be greatly appreciated.
Thanks!

lllllIllIlllI 178 Veteran Poster

Try this: write a program that tests someones reaction times and records them in a text file and then makes comparisons to see the level of improvment or the lack of.

sneekula commented: nice idea +4