15,181 Topics
| |
I want to create an ultimate list ctrl based table where the user can sort the columns by clicking on the column header. Here's the code I attempted: [CODE]import wx import wx.lib.mixins.listctrl as listmix from wx.lib.agw import ultimatelistctrl as ULC APPNAME='Sortable Ultimate List Ctrl' APPVERSION='1.0' MAIN_WIDTH=300 MAIN_HEIGHT=300 musicdata = { … | |
I am having a little trouble ending my program when I click on my End Program button. The current code that I have keeps making the program freeze when I try to exiting via the button. Also, I am having some issues with my Auto Button not working. Any help … | |
I made a function which will look up ages in dictionary and give out there name my dictionary si for example {george:16,amber:19} i made this [CODE] search_age = raw_input("Provide age") for age in list.values(): if age == search_age: name = list[age] print name[/CODE] but i know how to compare and … | |
I know this thread has been done alot but i cant find anything that i think i would like to do i want to make a program in python i have a pretty basic understanding of python and i really like it but i want to make somthing thats going … | |
Hello, i need some help with code, i need to be able to print something that function returns then i press button on panel1 it should return text to panel2 textctrl in wxpython. Here is some bit of code.(i just cut code that i think is needed for this) [CODE] … | |
Hi guys! Pretty easy question below From the code below 'data' is made by a column of numbers, let's say 12 numbers (see below) 56.71739 56.67950 56.65762 56.63320 56.61648 56.60323 56.63215 56.74365 56.98378 57.34681 57.78903 58.27959 [CODE]def block_generator(): with open ('test', 'r') as lines: data = lines.readlines ()[5::] for line … | |
I am working on a python version of the game Lingo. Here are the rules: [I]"Suppose the secret word is bones. Suppose you guess the word books. The computer will mark your guess as [b][o](o)k[s], where [b], [o], and [s] are letters that are in the correct position in the … | |
Hi, I'm trying to add new information, with several if loops, to a new file with append.() but I'm not sure that this works. The new file will also include some data from the f_file, that is why the if loops are there. [CODE]f=open('filename', 'r') new=open('filename', 'w') for data in … | |
HI This is sathya seelan.. I want to develop a simple web application using python... it has to be like a mail interface msgs needed to be stored and login details should be stored in database pls help me with a code snippet | |
I want to draw like this [url]http://ompldr.org/vYjN1ZQ[/url] by using the example : [url]http://code.activestate.com/recipes/410158-fractal-tree/[/url] or anything the algorithm is [code] def Calculator(Total): numpyArray = numpy.zeros((Total, 2)) for i in range(1, Total+1): #if i == Total+1 or i == 1: numpyArray[i-1, 0] = ((2 * i) - 1) numpyArray[i-1, 1] = (Total … | |
I need to create this game in Python but I'm really confused on how to write the code! The game Accordion is played with a deck of 52 cards. Beginning with one card, cards are laid out in a row to the right. As each card is played, its compared … | |
Hey, I am confused how to display an image in the same window. This is my code for removing a certain color(removing green) from a picture, saving it and then it displays into a different window. [B][U]I need it in same window and to be below the original image.[/U][/B] any … | |
I need to do a for loop that helps me rotate an image. Design a function that uses nested for loops to rotate an image 90 degrees clockwise. Could you guys help me Im lost..... :-/ | |
I need to read in a list from a text file, put that list in a list, read in the amount of credits the students earned as an int, and than add 16 credits to the list. Here is my code so far: [CODE]myList2 = [] myList = [] myFile … | |
I know this forum isn't to give away the answers, but could someone maybe help me get started? My biggest problem is figuring out where to start. Even the pseudo code doesn't help me very much. I don't know how to use an excel file in a program either. I … | |
I have this code below where I have to make it a function. I'm confused. I tried [CODE] def drawLine(img): .... .... .... [/CODE] Do I set the location of the picture as my variable? and then calling it? How would I call my parameter when I want to check … | |
Hi, I have this problem where I have to make a function that takes one parameter and draws two vertical lines, one is a red line from (50,0) to (50,300) and one made up of randomly colored pixels(150,50)to (150,250). I didn't define my function yet but for some reason my … | |
Hello everyone, :) I have exercise for class that I can't complete, I don't understand why my loops aren't working The question--- Write code that will print a multiplication table for 10 positive integers across the columns and 10 positive integers down the rows. Prompt the user for the starting … | |
import MontyLingua theTagger = MontyLingua.MontyLingua() String = "when was tom born?" #tokenized the String tokenizedString = theTagger.tokenize(String) chunkedString=theTagger.chunk(tokenizedString) #error coming here #Tag the tokenized String tagString = theTagger.tag_tokenized(tokenizedString) print tagString #A more simple way to tag the String tagString = theTagger.jist(String) can anyubody help me why error is occuring there … | |
Hi all, I have been trying to economize some code. I am trying to nested three notebooks into each other and that looks something like this: [CODE] #!/usr/bin/env python import os import sys import datetime import numpy as np from readmonifile import MonitorFile from sortmonifile import sort import wx class … | |
Hey, So I am a very experienced PHP programmer and completely new to python, I was wondering if someone could assist me with this program I am trying to make, The idea is simple The program has 10 different fortune quotes, the user needs to be able to tell the … | |
[CODE]# a very simple Tkinter editor to show file read/write dialog from tkinter import * from tkinter.filedialog import * class App(object): def __init__(self, master): frame = Frame(master) frame.pack() self.text = Text() self.text.pack() menu = Menu(master) root.config(menu=menu) # file menu filemenu = Menu(menu, tearoff=0) menu.add_cascade(label="File", menu=filemenu) filemenu.add_command(label="New") filemenu.add_command(label="Open", command=self.file_open) filemenu.add_command(label="Save", command=self.file_save) … | |
What does xrange do in python?? And how do I implement a similar function in Python3?? | |
Hi , I am trying to save the output of "help('tkinter')" in a text file. But i get error. I want to know if there is a Way to get the output of help file redirected to a file , or save in a variable. By the way , the … | |
How come unittest.TestCase doesn't exist for me? [CODE] Traceback (most recent call last): File "D:\My Projects\TAGEngine\TAGEngine\trunk\unittest.py", line 1, in <module> import unittest File "D:\My Projects\TAGEngine\TAGEngine\trunk\unittest.py", line 4, in <module> class CheckStructureAcceptance(unittest.TestCase): AttributeError: 'module' object has no attribute 'TestCase' [/CODE] | |
How would I go about detecting keystrokes on the keyboard? | |
This is similar to earlier posts in DaniWeb by vegaseat, but it demonstrates getkey with withdrawn tkinter, restart inside object by re-calling it's __init__ method. | |
Hi all, I'm fairly new to python and I'm stuck with a problem. What I'm trying to do is write a recursive function that takes a list of integers and returns true if the list contains a single pair of integers whose sum is negative, and false otherwise. For example: … | |
[CODE]from tkinter import * def handler(event): print("Clicked at", event.x, event.y) class Application(Frame): def __init__(self, master=None): Frame.__init__(self, master) self.grid() for r in range(6): self.master.rowconfigure(r, weight=100) #Creating custom buttons self.master.columnconfigure(0, weight=100) Button(master, text="Red",command=self.colorit).grid(row=6,column=0,sticky=E+W) self.master.columnconfigure(1, weight=100) Button(master, text="Blue").grid(row=6,column=1,sticky=E+W) self.master.columnconfigure(2, weight=100) Button(master, text="Green").grid(row=6,column=2,sticky=E+W) self.master.columnconfigure(3, weight=100) Button(master, text="Black").grid(row=6,column=3,sticky=E+W) self.master.columnconfigure(4, weight=100) Button(master, text="Open", command=self.hanlderf).grid(row=6,column=4,sticky=E+W) Frame1 = … | |
hello I'm trying to create program to check for the user password"only numbers" if it's correct then go to the next step. if not just type Invalid password the password should be store in another file which is "password.txt" this is my code but I couldn't make the program check … |
The End.