4,305 Posted Topics

Member Avatar for Zidane

You can use Hide and Show, here is an example ... [code=python]# create two frames with wxFrame, only one is showing import wx class Frame1(wx.Frame): def __init__(self, parent, mytitle): wx.Frame.__init__(self, parent, -1, mytitle) self.SetBackgroundColour("green") # pass frame1 to frame2 as instance self self.frame2 = Frame2(None, 'Frame2', self) # create input …

Member Avatar for vegaseat
0
108
Member Avatar for csurfer
Member Avatar for GrimJack
0
332
Member Avatar for sravan953

Your problem can best be solved by going to GUI programming (has an event loop) and have the user click a button to quit.

Member Avatar for Stefano Mtangoo
0
134
Member Avatar for Shraddha Kiran
Member Avatar for Shraddha Kiran
0
157
Member Avatar for seank
Member Avatar for Achayan

The values you gave are not really printable characters, but in general ... [code=python]c = "%s" % '\x1a' print c [/code]

Member Avatar for vegaseat
0
128
Member Avatar for somekid413

Judging from the traceback, there could be an font file you don't have. Another potential reason could be that you are using Tkinter and PIL together and get the "Image" namespace conflict due to the way you import the modules.

Member Avatar for vegaseat
0
682
Member Avatar for StarZ

Put the proper code inside the loop and it will work ... [code=python]fout = open("pa16names.txt", "w") while True: name = raw_input("Enter your name (just Enter to exit): ") fout.writelines(name + '\n') if name == "": break fout. close() print fin = open ("pa16names.txt", "r") print "The names you've entered into …

Member Avatar for vegaseat
0
178
Member Avatar for planetPlosion

Generally, to find the difference of two texts you can use Python module difflib ... [code=python]# use Python module difflib to find the line by # line differences between two texts # modified to work with Python25 and Python30 """ line markers ... '- ' line unique to sequence 1 …

Member Avatar for vegaseat
0
89
Member Avatar for mattyd

Looks like WinZip is screwing around with their '.zip' format making the files incompatible with different versions of WinZip and other products like WinRAR and 7Zip. Stay away from WinZip and use something more modern like WinRAR. I brought up the issue in the ModChamber. In the meantime compress to …

Member Avatar for vegaseat
1
244
Member Avatar for pymatio

You could do it as simple as this ... [code=python]html_str = """\ <html> <head> <title>Bring up an image with sound</title> </head> <body> <IMG SRC="train.bmp" WIDTH=320 HEIGHT=210 BORDER=5> <bgsound src="train.wav" loop=2> </body> </html> """ tag_close = html_str.count('</') # each close tag also has an open tag, so deduct it tag_open = …

Member Avatar for vegaseat
0
3K
Member Avatar for vmanes

About as practical as a Hummer. For those of us who throw their remote at the TV during a bad program or a losing sports game, this one will bounce right back!

Member Avatar for vegaseat
0
112
Member Avatar for sravan953

First of all do not use 'str' as a variable name, it is a Python function. Here is an example of the loop ... [code=python]mystr = "aasd<script>" for c in mystr: if c == '<': break else: print(c) [/code]

Member Avatar for siddhant3s
0
106
Member Avatar for sravan953

subprocess.call(["program-name", "arg1", "arg2"]) takes an executable program with arguments. You are giving it an html script code. That won't work!

Member Avatar for vegaseat
0
164
Member Avatar for leegeorg07

If you have the Windows OS, here is an example ... [code=python]# change color in the python.exe console display (Windows) # color is a two digit hexadecimal number # the first digit is the background # the second digit is the foreground (text) # 0=black 1=blue 2=green ... to E=yellow …

Member Avatar for leegeorg07
0
2K
Member Avatar for infinitelygreen

For Windows download the installer: setuptools-0.6c9.win32--py2.5.exe After installation you find easy_install.py in directory: C:\Python25\Lib\site-packages\setuptools\command

Member Avatar for infinitelygreen
0
96
Member Avatar for max.yevs

The Tkinter GUI toolkit is simple enough and comes with most Python installations. For typical example take a look at: [url]http://www.daniweb.com/forums/post888276.html#post888276[/url]

Member Avatar for vegaseat
0
150
Member Avatar for Salem
Member Avatar for GrimJack

I think he used to believe in evolution, but now believes in creationism. Changing your mind is the prerogative of old folks.

Member Avatar for GrimJack
0
718
Member Avatar for sravan953

Firstly note that 'file' is a Python function name and should not be used for a variable name! Python has module linecache to do what you so desire ... [code]import linecache filename = "html.html" # read a selected line (first line is 1) # note that each line will have …

Member Avatar for vegaseat
0
8K
Member Avatar for ithelp

The only perfectly empty space I know of, is in the cranium of certain politicians. Yes, in that space many scientific laws malfunction.

Member Avatar for vegaseat
0
143
Member Avatar for ithelp

[QUOTE=sneekula;885091]The { and } keys.[/QUOTE]Hmm, maybe you inherited the keyboard from a Pascal, Java, C#, C or C++ programmer. My first intro to the {} pair was with Pascal comments. On my own keyboard it must be the space bar. Any lettering is totally worn off! :)

Member Avatar for vegaseat
0
164
Member Avatar for rithera

Looks like it depends what your encoding type is set to. Your server or your editor may do the encoding for you. When I use your 'grab the page data from WoWArmory' code with the DrPython IDE, I get the proper special characters you want in its output window. My …

Member Avatar for rithera
0
122
Member Avatar for gujjar19

Try something like this ... [code=python]def extract(text, sub1, sub2): """ extract a substring from text between first occurances of substrings sub1 and sub2 """ return text.split(sub1, 1)[-1].split(sub2, 1)[0] text = '<SYNC Start=106377><P Class=ENCC>' timestamp = extract(text, 'rt=', '><') filename = 'grey-anatomy_' + timestamp + '.bmp' # test it ... print(filename) …

Member Avatar for gujjar19
0
83
Member Avatar for mindfad

What is your error message? Do you have the module psychopy and module numpy installed on your PC's version of Python? These two modules do not normally come with the Python installation, and have to be downloaded separately.

Member Avatar for mindfad
0
161
Member Avatar for drjay1627
Member Avatar for jlm699
0
113
Member Avatar for brashli

For what you have in mind you need to use a list, not a string ... [code=python]mylist = ['Corn', 'For', 'Grain', 'Irrigated', '1970', 'Colorado', 'Chaffee', '8', '10', '15', '11199199', '1', '100', 'acres', '75', 'bushel', '7500', 'bushel'] acres = int(mylist[-6]) bushel1 = int(mylist[-4]) bushel2 = int(mylist[-2]) print acres, bushel1, bushel2 # …

Member Avatar for jlm699
0
153
Member Avatar for sravan953

Even if you use the modified code below, it will take almost forever ... [code=python]import random import string combos = list(string.ascii_lowercase + string.digits) #log=open('log.txt','r') #search = read_log=log.read() # for test only search = 'killzone2' combo = '' while combo != search: # build up string combo the same length as …

Member Avatar for vegaseat
0
130
Member Avatar for SoulMazer

Hey Snee, very interesting use of whitespace to make the quiz dictionary easier to construct.

Member Avatar for SoulMazer
0
135
Member Avatar for hughesadam_87

Here is a cute example of the use of a Python class. It shows you how the class is used to group functions/methods together, and how one class can inherit another class or multiple other classes ... [code=python]# basic experiments with Python class class Cat(object): # this is public cost …

Member Avatar for vegaseat
0
414
Member Avatar for Ancient Dragon
Member Avatar for jephthah
0
127
Member Avatar for jephthah

If carbon would be all bound in solid insoluble rock, there wouldn't be any life.

Member Avatar for jephthah
1
149
Member Avatar for TerabyteST
Member Avatar for aot

wx.ALIGN_CENTER_VERTICAL in the sizer associates with the radiobox widget and not the individual radiobuttons in the widget. You have to change the style in radiobox to get a row or column layout for the radiobuttons.

Member Avatar for sneekula
0
1K
Member Avatar for ShawnCplus
Member Avatar for harrykokil

Here is one way to do this ... [code=python]# use Tkinter's dialogs to ask for input # dialogs are askfloat, askinteger, and askstring import Tkinter as tk from tkSimpleDialog import askinteger def get_age(): # keeps asking until you enter an integer value age = askinteger("Age", "Enter your age") int_var.set(age) root …

Member Avatar for vegaseat
0
89
Member Avatar for ihatehippies
Member Avatar for vegaseat
0
114
Member Avatar for billymcguffin

PyMedia is a little old and crusty, development seems to have stopped in June 2006.

Member Avatar for vegaseat
0
83
Member Avatar for harrykokil

Here is an example ... [code=python]# disable a Tkinter button for a set time import Tkinter as tk def disable(): # 'normal' enables button again button['state'] = 'disabled' # enable button again after 3000 milliseconds button.after(3000, enable) def enable(): button['state'] = 'normal' root = tk.Tk() # disabled only works with …

Member Avatar for vegaseat
0
120
Member Avatar for Salem

Actually, compared to US political standards the amounts in question are pitifully small.

Member Avatar for Aia
1
291
Member Avatar for ithelp

There is always room for young C/C++ programmers, as the old ones forget how to do it.

Member Avatar for Ene Uran
0
188
Member Avatar for adamdidthis

Python would make this easily possible, but you need to tell us if ARG always turns into ARG1, or is the next ARG a ARG2 and so on?

Member Avatar for slate
0
76
Member Avatar for aot

wxPython has its own wait/delay functions: wx.Sleep(seconds) wx.MilliSleep(milliseconds) The best way is to use wx.FutureCall(), for an example see: [url]http://www.daniweb.com/forums/showpost.php?p=872314&postcount=108[/url]

Member Avatar for aot
0
255
Member Avatar for mohankumar554
Member Avatar for vegaseat
-1
62
Member Avatar for mohankumar554

[QUOTE=woooee;873192]Please don't spam this site or someone will report you and you will be banned. Since the OP didn't say which toolkit or OS was involved, it is obvious that there is no way to recommend anything, hence MESHIKUMAR and mohankumar554 are the same and are spamming.[/QUOTE] Thanks woooee! I …

Member Avatar for vegaseat
0
168
Member Avatar for kenji

If you change the print statement to a print() function you can do about 95% of the older sample code with Python3. Actually the print() function was there for Python25. Also, with Python3 the old raw_input() for strings is now input() for strings. So, go ahead and use the older …

Member Avatar for kenji
0
135
Member Avatar for OLer94

Looks to me that you are using operations for sets like copy() and add() with lists.

Member Avatar for woooee
0
235
Member Avatar for leegeorg07

Your problem is that readlines() attaches the newline character if present ... [code=python]password = open('passwords.txt') username = open('usernames.txt') #each line in passwords.txt will have another passwords password_list = password.readlines() username_list = username.readlines() # for test print only ... print password_list # notice the attached '\n' characters!!!! print username_list guessuser = …

Member Avatar for leegeorg07
0
544
Member Avatar for ! !
Member Avatar for Arkapravo
0
136
Member Avatar for DimaYasny

I remember trying to write a "Boa for Dummies" blow by blow instruction. Take a look at: [url]http://www.daniweb.com/forums/post400296-107.html[/url] It should at least give you a taste what things you are up to with a designer for your GUI programs. Believe me, Boa is one of the friendlier ones. A while …

Member Avatar for DimaYasny
1
1K

The End.