15,181 Topics

Member Avatar for
Member Avatar for chris99

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 …

Member Avatar for woooee
0
128
Member Avatar for Frensi

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") …

Member Avatar for TrustyTony
0
2K
Member Avatar for rbyrd

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 …

Member Avatar for rbyrd
0
135
Member Avatar for padton

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 …

Member Avatar for vegaseat
0
441
Member Avatar for vickim360

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

Member Avatar for vegaseat
0
857
Member Avatar for paine_today

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 …

Member Avatar for paine_today
0
143
Member Avatar for calder.hutchins

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 …

Member Avatar for calder.hutchins
0
152
Member Avatar for vickim360

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***** …

Member Avatar for vickim360
0
239
Member Avatar for pbnoj

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. …

Member Avatar for Gribouillis
0
4K
Member Avatar for aaaaaaaaa

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: …

Member Avatar for Gribouillis
0
351
Member Avatar for AutoPython

[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 …

Member Avatar for nytman
3
1K
Member Avatar for padton

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)

Member Avatar for TrustyTony
0
228
Member Avatar for RLS0812

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.

Member Avatar for TrustyTony
0
231
Member Avatar for tirexxerit

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.

Member Avatar for tirexxerit
0
193
Member Avatar for Frensi

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 …

Member Avatar for Sky Diploma
0
370
Member Avatar for Jacklittle01
Member Avatar for ihatehippies

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

Member Avatar for Gribouillis
0
262
Member Avatar for 2hamed

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, …

Member Avatar for 2hamed
0
761
Member Avatar for runlevel3nut

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 …

Member Avatar for vegaseat
1
180
Member Avatar for padton

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 …

Member Avatar for padton
0
280
Member Avatar for shubham bhat
Member Avatar for LinaClark

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 …

Member Avatar for rrashkin
0
205
Member Avatar for bottlecaps

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 …

Member Avatar for socialshouting
0
195
Member Avatar for runlevel3nut

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 …

Member Avatar for runlevel3nut
0
286
Member Avatar for knd15

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 …

Member Avatar for vegaseat
0
239
Member Avatar for krystosan

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 …

Member Avatar for vegaseat
0
148
Member Avatar for satsujin

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 …

Member Avatar for satsujin
0
3K
Member Avatar for MissAuditore

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 …

0
82
Member Avatar for jkembo

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 …

Member Avatar for jkembo
0
13K
Member Avatar for SoulMazer

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 …

Member Avatar for Gribouillis
1
721

The End.