15,181 Topics
| |
Hi, I just received a project in my class where i have to write my own turtle class in python which I will have to use to draw a Koch snowflake. Currently I have no idea on how to get started on the turtle class? If anyone knows or has … | |
I wrote this python script (part of a bigger program) to launch a php script and wait for the output. The PHP script takes almost 15 minutes to run, as it is spawning several perl & C programs of its own. When I launch the php script by itself, it … | |
I am using Python and wxPython to attempt to make a 2d game. When w is pressed, the tiles (except the character) should move so it looks like you are moving. The problem is, when the key is pressed, nothing moves. I added a line of code(no longer there) to … | |
Hello All, Ii want to know how can i check whether the response from the server is inJSON format or XML format . Please let me know how to do this, | |
I am going through the Tk/Tkinter tutorial and when I try to run the menubar program I get two windows instead of a menubar on one window. Here is the code: [CODE=Python] from tkinter import * from tkinter import ttk root = Tk() root.option_add('*tearOff', FALSE) win = Toplevel(root) menubar = … | |
hi! i want to make a program, that moves an object in vertical line 'till the program ends,but when it reaches the upper border, automatically appear in the lower border. i have this [CODE]from utalcanvas import * import time show() window_size(500,500) window_style( "Mi Ventana", "black") window_coordinates(0,0,1000,1000) circulo = create_filled_circle(500,20,50,"green") for … | |
Hi, Python v2.7 Tkinter Windows 7 I am having some troubles drawing a line. I have called create_line inside a for loop, in which I gave it coordinates that are returned from another function. However, instead of drawing separate lines, it joins the lines together. Here is a snippet of … | |
Hey everyone, Yesterday I wrote a simple Hello World program and saved it as .py. However, when I tried to run the .py file it didn't have a default program. So, I went to 'Choose Default Program', found 'python.exe' and clicked it. 'python.exe' did not show up in the 'Choose … | |
I just started a new small python project on google code which goal is to easily create clickable graphs on a GKT+ goocanvas. The initial idea comes from this code snippet [url]http://www.daniweb.com/software-development/python/code/323792[/url] . I want to do about the same, but instead of simply drawing the graph, I want to … | |
Hello everyone, I am a student at ITT-Tech studying computer network systems and system security. I am programming now for programming class, but it is very addictive and I really enjoy it. in my spare time I enjoy survival training, time with my kids, reading, and traveling. | |
[CODE] import Tkinter as tk import Image, time, datetime def splash_screen(): root = tk.Tk() root.overrideredirect(True) width = root.winfo_screenwidth() height = root.winfo_screenheight() root.geometry('%dx%d+%d+%d' % (width*0.8, height*0.8, width*0.1, height*0.1)) image_file = "NHK.gif" image = tk.PhotoImage(file=image_file) canvas = tk.Canvas(root, height=height*0.8, width=width*0.8, bg="black") canvas.create_image(width*0.8/2, height*0.8/2, image=image) canvas.pack() root.after(10000, root.destroy) root.mainloop() return splash_screen() my_menu()# is … | |
Hey every one, the code above below a user to draw lines and create circles that will collide with the lines and have them roll down the lines. The problem im having is geting the screen to follow the circles. Also im having a problem having the user be able … | |
Here is function to count the number of elementary events for sum of multiple throws of n-faced dice. | |
We are developing application in python web development (No frameworks like Django) using just cgi module. In thing we have to use session management to transfer the variables between pages. I tried in google but no useful matter I found, if you know which module is to manage the variables … | |
I have a file with the following path :[code] D:/bar/クレイジー・ヒッツ!/foo.abc[/code] I am parsing the path from a XML file and storing it in a variable called "path" in the form of "file://localhost/D:/bar/クレイジー・ヒッツ!/foo.abc" Then, the following operations are being done : [code] path=path[17:] #to remove the file://localhost/ part from the path … | |
You need the Python tkSnack module to play notes of a given frequency and duration on your external sound system (attached to the PC's sound card). The code snippet gives just a tiny hint about the capabilities of tkSnack. It works with Tkinter, normally part of the Python installation. The … | |
Can somebody please help me with coding a program for online graph plotting using 'python flask'. The program has to take as input a .csv file and manipulate it and plot it accordingly. | |
Tuples are immutable objects, they cannot be changed says the Python manual. [code]my_tuple = (1, 2, 3, [4, 5, 6]) # this works my_tuple[3][2] = 7 # clearly the item at index 3 in the tuple has changed print(my_tuple) # (1, 2, 3, [4, 5, 7]) [/code] | |
I was planning to create a programme to try and locate text from an image I kknow that this is a complex issue but any assistance will be kindly appreciated,the programme should locate text and create a document containing the text found thanks. | |
I am not trying to use a setup.py, i just want to use the basic script. the website says as an example: [code] cxfreeze hello.py --target-dir dist[/code] thanks in advance! I tried this but it did not seem to work: (The Command Line is in the folder with the Shooter.py) … | |
I can access the parameters if the form submitted or hidden from the following snippet. form = cgi.FieldStorage() But I can't access the variables from URL. EX:- .../daniex.py?TYPE=R1 How can I get "TYPE" variable's value from python web lib? | |
I have this code: [CODE]import csv tally=0 i=0 n=1 numb=2 count = sum(1 for row in csv.reader( open('cities.csv') ) ) cityname = csv.reader(open("cities.csv", "rb")) citynames = [] citynames.extend(cityname) for data in citynames: citynames.append(data[0]) tally+=1 if tally>=count: break tally=0 cities_x = csv.reader(open("cities.csv", "rb")) cities_list_x = [] cities_list_x.extend(cities_x) names = [] for … | |
Hello, can anyone help me regarding how this can be done? I need to declare an 'array' which has 95 indices, and each entry holds 8 bits each of data. am doing this with: PORT_MAP_LEN = 764/8 bit_map_len = [0]*PORT_MAP_LEN but it is giving me list index out of range … | |
Greetings, I'm using PyQt4 and trying to add a QGraphicsItem exactly in the center of the current screen, by clicking a menu button. So each click will add an item in the center of my screen. My QGraphicsScene is very large (10k X 10K), so the QGraphicsView cannot show it … | |
I have the following txt file that has 4 fields that are tab separated: the first is the id and the other three show the results per test. 152 TEST1 valid TEST3 good TEST2 bad 158 TEST2 bad TEST1 bad TEST4 valid . . . Based on the above txt … | |
Hi all, I have been doing for fun this problem in projecteuler.net. The problem is as follows: +++++++++++++++++++++++++++++++++++++++++ Peter has nine four-sided (pyramidal) dice, each with faces numbered 1, 2, 3, 4. Colin has six six-sided (cubic) dice, each with faces numbered 1, 2, 3, 4, 5, 6. Peter and … | |
Hi, I use [B]pulp[/B] module to solve my some optimization problems. With integer numbers, it works like a charm. I wonder if it is possible for pulp to work with real numbers. Here is a sample optimization problem I build for my project. [CODE] prob = pulp.LpProblem("example", pulp.LpMinimize) # Variable … | |
I do Get errors with combo box selections. here is my combo selection attach to a button. [CODE] def Btn9(self, event): # wxGlade: Appli.<event_handler> if self.combo_box_4.GetValue()=="1": numglobals.frame_12.Show() elif self.combo_box_4.GetValue()=="2": numglobals.frame_13.Show() elif self.combo_box_4.GetValue()=="3": numglobals.frame_14.Show() elif self.combo_box_4.GetValue()=="4": numglobals.frame_15.Show() elif self.combo_box_4.GetValue()=="5": numglobals.frame_16.Show() elif self.combo_box_4.GetValue()=="6": numglobals.frame_17.Show() elif self.combo_box_4.GetValue()=="7": numglobals.frame_18.Show() elif self.combo_box_4.GetValue()=="8": numglobals.frame_19.Show() elif self.combo_box_4.GetValue()=="9": … | |
Hi, I have a list of lists such as : [[foo,1],[baz,1],[foo,0],[bar,3],[foo,1],[bar,2],[baz,2]]. I want to get all the different items in the inner lists and find the total number of them. I mean the result should be like : [[foo,2],[bar,5],[baz,3]]. How can I do this task? Thanks in advance. | |
I need to make an interactive program in Python that will start by asking the user to enter a list of numbers and then it will display the following menu. 1-Find The Maximum 2-Find The Minimum 3-Find The Average 4-Exit Please Enter Your selection Your program will accept a number … |
The End.