15,193 Topics
![]() | |
Hey, I'm sorry for being such a python newb, but thanks for helping me out with the last one! Hopefully you guys will help a newb out again :) This time, I need to use a recursive function to basically do the same thing that the .replace function for strings … | |
Hey Guys, I have a test tomorrow and this question is going to be dead similar to my test question, and I'm a mech.E major but for some damned reason Python is a mandatory course for us. Please if any one could solve this I would be very grateful. Please … | |
Hi everyone! I have difficulties solving a plot issue: I have these two datas in an array: np.array([Q-value, length]) Q-value......length A.................60 B.................40 C.................90 B................150 C................230 A................220 I want to plot these like: Q-value..........total length A...................280 B...................190 C...................230 Though it seems easy above my "real" array contains a lot more values. … | |
My teacher gives a review sheet which is a lot like the exam if not the exam but with some minor changes. I'm stuck with these fill in the blanks. [CODE]Fill-In-The-Blank Word Frequency The following program gets the name of a file as a command-line argument, opens that file, reads … | |
Hi, I am a newbie here and a python newbie as well :) I am having trouble implementing a program in which you must use only recursive functions and no built-in python functions other than the len function in order to determine if there are duplicates of an item in … | |
Okay, I am writing a dopewars clone/wannabe in python. I have it pretty much the way I want it, except that selling items does not work. Buying them does fine, it is just selling them. Here is the code: [code] #!/usr/bin/env python # # pimp.py # # @authors: KarimRuan, # … | |
hello all, Can you tell me the syntax for setting stylesheets for tabs (sub-control) in tab bar like here [URL="http://doc.trolltech.com/4.3/stylesheet-examples.html#customizing-qtabwidget-and-qtabbar"]http://doc.trolltech.com/4.3/stylesheet-examples.html#customizing-qtabwidget-and-qtabbar[/URL] I've searched everywhere for the solution.. But no luck.. Can you please help me in this regard.. Thanks in advance.. | |
Hai friends, The problem here(in the code below) is i want to catch the minimize and close event of QTabWidget(by default this widget do not have any slot named close or minimize) to hide the widget.. so the only way the user can quit the application is by clicking exit … | |
I do php coding for some time and want to learn something new. After some researsh I ended up with 2 languages/frameworks but I can't choose between them. I'm a python programmer so python Django might be easier to start with. But I don't know a well-known website which is … | |
Hi, I am working currently with wxPython. I want to read out pdf pages(seperated files) and display them in wxPython and print them with win32print and win32ui. Is there the possibility to readout a pdf file and convert it to a wx.Bitmap or a wx.Image? please help. | |
[CODE]class calculator: def __init__(self, num, operator): self.__num = num self.__operator = operator def changeNum(self, newNum): a = newNum return a def getNum(self): return self.__num [/CODE] [CODE]def click(num): if num == "one": v = "1" elif num == "two": v = "2" elif num == "three": v = "3" elif num … | |
Hi friends I am new to python. I have doc file and jpg file. I want to append jpg file content to doc file. How to achieve this with python please help me. | |
[CODE]reader = csv.reader(open('new_mondy_csc_data_revise.csv'), delimiter=',', quotechar='"') header = tuple(reader.next()) print "%-14s|%-10s|%-5s|%-5s|%-11s|%-11s|%-11s|%-11s|%-11s|%3s" % header # read header line from csv print "-" * 45[/CODE] There are a total of 10 fields in the header across a csv file I want to print the first three instead, how can I do that? | |
self.button1 = Button(root, text = '1', \ command = self.buttonAction) self.button1.grid(row = 1, column = 0) self.button2 = Button(root, text = '2', \ command = self.buttonAction) def buttonAction(self): if self.button1 [COLOR="Red"]is clicked/pressed... [/COLOR]: value = 1 how do i express the word in red in python code?!!?? thanks :D | |
Thought someone might like this little script. Its an animated wallpaper. You'll need to draw the frames though. I used Windows paint to make the frames. I drew two stick people fighting. You'll need to know the basics about animation. I saved each picture as .bmp It worked with .jpg … | |
I wonder how the random.normalvariate function works. When I do the method below, I end up with negative numbers. I don't want that. How do I prevent that? And also, i want 10 numbers, but it always turn out 9 and a "none". What is none? How can i remove … | |
Hi guys! I need your help with a simple program I'm trying to make. It's supposed to read values from a file, covert them (and add/multiply), sort, and then view the values to the user. The values looks like this: [code]Stockholm 650000 55.5 2100 08 123 456 Whateverstreet 123 ... … | |
hello, long time lurker first time poster! currently writing a program that generates 100 random integer values in the range of 1 - 50, then displays how many of those numbers are in the range 1-10, 11-20 etc etc. i generated the numbers with no problem, but im not too … | |
[CODE]global Num1 from Tkinter import * Num1 = "" def buttonNPush(n): global Num1 Num1 = Num1+n print Num1 def clearScr(): global Num1 Num1 = "" root = Tk() textbox = Entry(root) textbox.pack(side=TOP) #Create Frame with buttons numbered 0-9 frameButtons = Frame(root) frameButtons.pack(side=LEFT) button1 = Button(frameButtons, text="1", command=buttonNPush("1")) button1.grid(row=0, column=0) button2 … | |
I'm trying to use my methods, but i always get " <bound method Deltagare.tavla of <__main__.Deltagare instance at 0xfba58>>" what does it mean? is something wrong with my class? | |
can you help me with this things? i really suck doing it in python... | |
Is there a way to get the date a file or folder was last modified into python? | |
I need to read in a large amount of data from a csv file into arrays. I am using Numpy as I need to later manipulate and plot the results. I have decided to use numpy.loadtxt as this appears to be the most efficient method to read in the data. … | |
[CODE]class Database(Student): def __init__(self): g = [] choice = ['Basketball','Football','Other','Baseball','Handball','Soccer','Volleyball','I do not like sport'] data = student.sport k = len(student.fname) print k freq = {} for i in data: freq[i] = freq.get(i, 0) + 1 for i in choice: if i not in freq: freq[i] = 0 for i in … | |
Okay, well I've been looking for at least an hour now for some straight-forward python-xlib documentation, and I have been unable to find any. Luckily...I have quite the easy problem. If somebody would be able to help me create a simple script that would say "Hello" every time the left … | |
How could one find the length of longest row of same elements in a list. For example if i have a list list = [0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1] and i … | |
Ive written a program to do with drawing a line from a centre point and it is meant to snake randomly from the centre. However, it seems to be incredibly biased as to where it decides to go. the 4 directions are as simple as up down left and right, … | |
I don't understand what those two things do and how they work i tried researching off google, but i couldnt get a direct answer | |
Hi! I'm trying to combine some frames in a GUI as a toolbar and content area. Currently I'm on windows and using python 3, and I want preferrably my app to work on *nix and mac as well. The problem is that in the following app, when I resize it … | |
A building has three elevators, 16-storey level. Write a program to simulate the operation of elevators. Requirements: 1. At the highest level can only be a downward trend, the lowest level can only be upward, the middle layer can be by any upward and downward; 2. Each layer is only … |
The End.