15,181 Topics
| |
I am writing a tic-tac-toe program and whenever my game gets to here it generates the following error: [CODE]# Display board function def display_board(board): """Display game board on screen.""" print "\n\t", board[0], "|", board[1], "|", board[2] print "\t", "------" print "\t", board[3], "|", board[4], "|", board[5] print "\t", "------" print … | |
I having a little trouble to figure out how can I replace the specific lines in a text file by the lines from another text file marching certain pattern. !?!? For example: I have two files: file1 and file2 , I want to search lines of the first file for … | |
Hi, I am asking here three question together rather than making separate threads for each question. I am making an application where I can load images in a canvas. I load the image with file menu askopenfilename dialog box. Something like this: [CODE]class MyApp(object): def __init__(self, master): frame = tk.Frame(master) … | |
despite its simplicity, for some reason, my code refuses to work, even though the encryption works [CODE] # add() is just (a+b)%2**32. for some reason, without the function, it doesnt work delta = 0x9e3779b9 sum = 0xc6ef3720 for x in range(cycles): # 32 data[1] = add(-add(data[0]<<4, key[2]) ^ add(data[0], sum) … | |
hi i'm new with python and django and i work on search page of my site. in my html search form, user can choose table(or field) which want to search. in server-side i use sequences of 'if' to find chosen table(or field) and related django model. [CODE]... #here assumed searched … | |
Hey guys, I made a class that I am using to save numbers for a larger Ping Pong stat tracker program I am making. I am having problems with it however and can't figure out how to solve it. The class is a basic save to file program. It takes … | |
When I run this code: [code]class C(object): print("Hello from inside class C") [/code]It gives the same result as if I had used this code: [code]print("Hello from inside class C") [/code]However when I use: [code]class B(object): def __init__(self): print("Hello from inside class B") [/code]The class behaves like I had expected. Does … | |
Hi Everyone, I am trying to start ASPEN, a python based web server on my computer. In my Windows 7 command line I input the following: [CODE]python.exe build\scripts-2.6\aspen[/CODE] It then outputs [CODE] launching child process starting child server aspen starting on ('0.0.0.0', 8080)[/CODE] But after I receive that input, the … | |
I am a beginner programmer who is moving on from the basics of python to wxPython. I have the book [I]wxPython in Actio[/I]n and am using it as a reference while I make GUI programs for fun (still haven't sat down and read through the book, will someday). I am … | |
Hi I have been having this issue for a while and cannot figure how should I start to do this with python. Actually Im not a programmer but would like to learn it. Not just because of this (what topic title) says but, for sure, for other advantages to. I … | |
Hi all, My first post here, but long time troller. I was looking for a GUI platform to develop on and couldn't decide between wxPython, PyQT and/or IronPython or Jython. I decided to go with wxPython after getting a couple of headaches elsewhere. I'd really like a quick IDE to … | |
Hi all, Are multiple conditionals at once okay in Python?? So for example: [CODE]if self.combobox.GetValue()!="" [B][COLOR="Red"]and [/COLOR][/B]self.FilePathTextBox.GetValue()!="": [I][functions and objects go here] [functions and objects go here][/I] else: self.SetStatusText('error') [/CODE] Mainly a question on style ... I tried it on my program, and the program seems to work fine. Is … | |
The situation is this: I use opensuse, which bundled with a python 2.4.X version, I installed it. Then I think python 2.6.4 is better, so I installed python 2.6.4 and all the later package I installed, were with python 2.6.4. In my project, I need a module named tkinter (python-tk) … | |
Hi there, using TKinter Is it possible to change a buttons text after you've clicked it? So if a button has text of "hi" and when clicked has text of "Goodbye"? [icode] button_switch = True def click(): global button_switch if button_switch: button_switch = False else: button_switch = True [/icode] This … | |
Hello everyone! I want to use bash from python, however the os.system([I]command[/I]) seems to act only on one command at a time. I want to use complete commands, also containing control flow statements, like If and While, and to call them from python. something like this code in bash: T1="foo" … | |
Hello all together first of all sry for my bad english Well i got a problem with some of my application. First of all i had to write an application which can drag rooms from a source window to 4 destination windows. That works fine . But if i drag … | |
Hello Python community, I have a basic question about the wx.DirDialog method/event handler system and how it works. I had a problem today, but solved it. Basically what I'm trying to do is have a frame, then use event handler wx.DirDialog to open up another dialogue where I can choose … | |
My following question regards a problem I am having remembering python code. It has been about a year and a half since I last opened the shell or wrote any sort of code. I am attempting to rewrite the bullseye program that was seen in the Greater New York Programming … | |
hello, pls, can anybody help? I try to print words which contains forbidden letters but counting without them and excluding the words which has the smallest number of letters. example: words = 'hello this is my test' forbidden = 'h, t, e' 1. hello this test -> these word contains … | |
I need a way to check what service a port is running in python, thanks for the help in advance. | |
This snippet provides 2 functions to create in memory a gziped archive of a sequence of files and directories, and to extract files from this archive. These functions are similar in effect to the linux commands [icode]tar czf[/icode] and [icode]tar xzf[/icode] but instead of writing an archive file on disk, … | |
Hi all! I've been working on some school/hobby project for some time now. It's a kind of a simple statistical tool for analysis of data from psychological experiments. Not being professional programmer I encountered a couple of problems concerning data storage. Let me explain the how the data is structured … | |
Hi all, My first post here, but long time troller. I was looking for a GUI platform to develop on and couldn't decide between wxPython, PyQT and/or IronPython or Jython. I decided to go with wxPython after getting a couple of headaches elsewhere. I'd really like a quick IDE to … | |
Hi all, first post so hopefully I'm in the correct place. I'm new to python/jython and am currently trying to write a hot-deploy script, in short its working, however I am now making it for mulitple applications. I'm really struggling to get the path to a JAR archive into a … | |
Hi, i'm trying to take the last list from a list of lists, use that as a start point, then iterate through the list of lists and find the closest match, then use that matched list as a base and iterate through the remaining lists for the closest match to … | |
I have two frames one parent and child. the parent will invoke the child. The program should not allow the user to access the parent until the user closes the child How can i achive it? Need a solution without hiding the parent | |
search(l, key): if len(l) == 0: return False elif l[0] == key: return True else: return search(l[1:], key) I was just wondering if there is any way that i can get rid of "elif" statement. The function is suppose to return False if the key is not in the list … | |
Hi, I'm having a syntax issue with timeit while trying to measure the time taken by a function meant to concatenate two linked lists. [CODE] def get_time() : import cell import timeit for i in range( 1, 16 ): lista = cell.make_list(i) #this function return the root of a sll … | |
hello friends I need to create a child window. but when i am triggering the same event mutiple window is creating. How can i check whether a the window is already visible or not? How can i focus on the same if it exists? | |
I've just joined the site, and I'm embarassed to be posting what is obviously a simple problem, but I've had no luck with figuring it out. I'm sort of new to dealing with GUIs, wx, and much of the CLASS structure of Python. I've put together a simple script below … |
The End.