No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
13 Posted Topics
Hey, when I execute the following code I get "App instance has no attribute rolls" I have no clue as to why this is and any help would be awesome, Thanks. import Tkinter class App: def __init__(self, master): self.sticky_all = Tkinter.N+Tkinter.W+Tkinter.E+Tkinter.S self.frame = Tkinter.Frame(master) self.frame.pack() # Dice Buttons. self.bd4 = … | |
Hey, Guys and Gals. For some reason the variable text_list seems to be modified after the variable final has been modified. text_list is a list of text :) Full code is below. Any other hints and tips would be great Thanks a bunch. decode_list = [] key = 0 final … | |
It seems like dataRecived is not "firing" but I cannot work out why. Any ideas? Thanks [CODE] # Basic Chat Server # Imports from twisted.internet import protocol, reactor import pickle import string PORT = 6661 connections = [] class User(protocol.Protocol): def connectionMade(self): self.transport.write("Welcome") def dataRecieved(self, data): print data def connectionLost(self, … | |
Where are the connections stored, are they in a list, how to I access them? I have a (-messy-) program that will allow the users to set there name and when they send input to the server it will come up with "Received: Blah from username" but I would like … | |
I have put some xml data in a file the python code below and have been trying to figure out how to get the data from the file add another "person" and then save to the same file again. [code=python] from lxml import etree from lxml.builder import ElementMaker E = … | |
How can my "Player" class access a function of my "Map" class? The place I want it in is commented. Thanks. [code] #include <iostream> #include <string> using namespace std; class Map { public: Map(); ~Map(); void Map::print(); int Map::sendroom(int x_coord, int y_coord); private: int i; int p; int w; static … | |
How would I fill a two-dimensional array up with numbers. map_height = 9 map_width = 8 I have this code: [code] for (i=0; i<map_height; i++) { for (p=0; p<map_width; p++) { room_numbers[i][p] = w; w++; } } [/code] But when I try to print it out it comes up with … | |
Is there an easy way to handle input from an entry box, in my project I am working on I have to call functions twice which ends up making a large mess of everything. Like if I call the [code=python] import tkMessageBox from Tkinter import * def yes_no_ask(answer): guidisplay.actiondisplay.configure(state=NORMAL) guidisplay.actiondisplay.insert(INSERT, … | |
So I have this simple list and scroll bar combo and I have been trying to make it stay at the bottom of the scroll bar as the text is added so it looks like the scroll bar is just to look back over the previous text. Like in a … | |
Is there anyway to compare lists or check to see how many of the objects in one list are the same as the other list? eg: L1 = [dog, cat, john, moo] L2 = [dog, cow, moo, stuff] there is two of the same "things" in it I'm trying to … | |
Hi, how would I get the timer() class to change time display()'s self.time I'm new to threads and classes and have been sitting here thinking about it for the last half hour and still have know idea Thanks heaps for any help. [code=python] # Count down timer import time import … | |
Hi Is there a way to check if a float is a whole number eg 10.0, 7.0 or somthing.0 I'm doing problem 5 on project eular Mayby I have the complete wrong idea here is my code: [code] numbertobetested = 0.0 loop2 = 1 while loop2 == 1: numbertobetested = … | |
How do you assign a random int to a variable more then once say i use this code [code] import random x = 1 while x == 1: random = random.randint(1,100) print random raw_input ("Push <enter> to print another random number") [/code] It will print out the first random number … |
The End.