15,181 Topics
| |
I'm trying to make a calculator with Tkinter but I'm having trouble using a for loop to make the number buttons. I'm using a for loop as they are nearly identical. Here's the loop: class Calculation: def __init__(self,master): i=1 rowi=1 columni=0 self.num = "" self.button = [] frame=Frame(master) frame.grid() self.returnScreen … | |
I'm making a little program with tkinter and trying to get this timer to work. I'm getting a "'float' is not callable" error. Does anyone know what I'm doing wrong? The error happens when it tries to call 'self.clock_start()' def create_widgets(self): #create the main frame self.root = Tk() self.root.title("Learning Timer") … | |
| When using this code to insert 5, then 18, into a binary search tree, the data value 18 is placed as the left child of the root instead of the right child. The statement if data < node.val: (in the insertR method) doesn't seem to be working correctly. Can someone … |
Hi all, I seem to be having problems with summing all the values in a .csv file with the following format: 3.2323232312 7.5345345675 3.3423565624 etc... I have opened this with a spreadsheet at it seems the floats are all in column[0] and each number is on a different row. with … | |
Hello everyone, I am trying rotate in pygame, but I can't. What would be the best way to rotate something around its own center?? Thanks | |
I am importing a library into a script that is being used in a php document, but for the script to run, I need to import a library that is rather large. Is it possible to permanently import the library so I do not need to load it up each … | |
So i have looked in this forum and grabbed a piece of code that let me encrypt text using a cypher. I have changed it so that you can input your own text to be encrypted and a little more. I am 15 and this is my 2nd day learning … | |
Hello. I have been having trouble with this pygame program. I am trying to imitate a wind turbine. However, when I run the command, it returns with a blank black screen with a square. What is wrong?? Here's the program: import pygame ############################################# # Written by P****** ******* and V***** … | |
Hi there, My problem involves reading in and working with an excel file that contains blank cells randomly throughout the spreadsheet. The reason there are blank cells is because I have expression data for various cell types but for some of the cell types the expression data was not available. … | |
So I have a YML file, and I'm trying to convert it to a different format. I found a YML format converter script and edited it to the best of my ability, and this is what I've come up with: #!/bin/python try: import yaml except: print "Failed to import module: … | |
[B]!USING PYTHON 3.1![/B] Hello DaniWeb! Today I'm going to be posting a [B]simple[/B] threading tutorial. First of all, what is threading? Well, threading is just another way of doing a side task without interrupting the main program. Now here's a simple example. Let's say we are going to make a … | |
There must be a better way of writing the following code, I would really appreciate your suggestions and coding. I am new with python. Thanks. A1 = os.path.join(pathname, "x") A2 = os.path.join(pathname, "x", "y") A3 = os.path.join(pathname, "x", "y", "z1") A4 = os.path.join(pathname, "x", "y", "z2") createPath(A1) createPath(A2) createPath(A3) createPath(A4) | |
What is the Python (2.7) equivalent of the PHP $_POST, $_GET, $_SESSION and $_COOKIE, and how are they used ? After almost 2 years of trying I have finally gotten Python to work on my WAMP server - only to find that it is severely lacking in web page functionality. | |
Hi, I would like to understand what does the following "<<" does in the following statement? (ord(msg[i+1]) << 8) As it is two less than sign, I couldn't find some meaningful response on google:( thanks. | |
I'm creating a little space shooter game. I need to limit the amount of times a player can fire, I'm setting a 2 second limit. But whenever I try to implement that it just won't work. The bullets keep firing multiple times a second. Here's my code, I'd be very … | |
| |
I came across this project that could be really helpful.. if I was c++ literate. I know enough c++ to be dangerous and thats about it. Thanks in advance for anyone who wants to take a crack at it. ps credit to: http://www.codeproject.com/Articles/13839/How-to-Prepare-a-USB-Drive-for-Safe-Removal | |
I'm trying to write program in Python using PyOpenGL which I need to use glutMouseFunc for some mouse functionality but when I run the program I get the following error: Traceback (most recent call last): File "teapot.py", line 80, in <module> glutMouseFunc(mouseHandle) File "/usr/lib/python2.7/dist-packages/OpenGL/GLUT/special.py", line 137, in __call__ contextdata.setValue( self.CONTEXT_DATA_KEY, … | |
First, what do I need to add to my Win 7 SP1 in order to execute Python scripts? Second, what's a good Win x64 IDE that's super simple, free of too many bells and whistles, and good at testing and debugging basic textmode Python scripts? I need to be able … | |
Hi all, I am trying to use the following python code to read data from two .csv files which have data in the following format, e.g. 1, 23.27, 23.21, 83.22 2, 34.25, 65.31, 34.75 ... etc I seem to be getting an error around during execution of the function. I … | |
Hello, I am a newb all the way around and I hope that I explain this thoroughly in order to get the help I need. I have a mysql db inside of my python program that generates a hint. I need to have a random number (which will later be … | |
So essentially I'm completely lost with this problem our professor gave us. I was absent for the lecture, and he isn't very keen on uploading the lecture notes before our assignments are due. Anyway, the program to be written goes something like this. We need to write a non-graphical program … | |
I'm self-studying python, and more advanced python programmers have pointed out to me that I'm learning an obsolete instruction set and the use of obsolete tools thanks to being taught about an old version of python rather than the most current one. The website where I'm self-studying also offers chances … | |
| I know this maybe easy but I need help with creating a fibonacci sequence array from a to b. This is my code so far: def FibL(a,b): list = [] if a == 0: return 0 elif a == 1: return 1 else: return FibL(a-1) + (a-2) for i in … |
I am trying to move the items up and down depending on the call made, so I have came up with this def changePriority(self,*args): crntRow = self.listWidget.currentRow() total=self.listWidget.count() if args[0]=='up': if crntRow > 0 : crntItem= self.listWidget.takeItem(crntRow) self.listWidget.insertItem(crntRow+1,crntItem) if args[0]=='down': if crntRow + 1 < total: crntItem=self.listWidget.takeItem(crntRow) sel.listWidget.insertItem(crntRow-1,crntItem) else: print … | |
Hi folks, I'm trying to use the subsample method in the PhotoImage class to resize an image I have in a list that links to a Label widget in Tkinter but python says there is no such method. I know I could use Image.resize before calling Photoimage but since I'd … | |
Hi, My code: Print Y fig = plt.figure(figsize = plt.figaspect(0.5)) ax = fig.add_subplot(1, 1, 1, projection='3d') surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap = cm.gist_rainbow, linewidth=0, antialiased=False) print Y ax.yaxis.set_major_formatter(matplotlib.dates.DateFormatter('%H:%M:%S\n%m/%d/%Y')) #ax.yaxis.set_major_locator(dates.MinuteLocator()) fig.colorbar(surf) plt.show() Result: [[ 1.34503975e+09 1.34503975e+09 1.34503975e+09 ..., 1.34503975e+09 1.34503975e+09 1.34503975e+09] [ 1.34503980e+09 1.34503980e+09 1.34503980e+09 ..., 1.34503980e+09 1.34503980e+09 … | |
Hello everyone, I need some help, I would like to merge two cells together within a row only (e.g) in a CSV file using python. So far, I have 4 columns in the file, but now I would like to merge two cells in one, but I don't have any … | |
Hi all, I'm working on a (Python) program which, in short, is a threaded TCP socket server which creates a new "tab" in a wx.Notebook widget for every incoming connection it sees. I've run into a strange problem where when I call notebook.AddPage(...), one of three things happens: 1. A … |
The End.