15,181 Topics
| |
Hi guys, I have an assignment for a class [url]http://www.cs.sfu.ca/CC/165/popowich/assign-3/assign3[/url] that's due in 3 days. I am totally confused with this as I've never programmed before. If anyone can help in anyway with this assignment it would be greatly appreciated, I really need the marks. And if you're using any … | |
I have to write a program that converts user entered Kilometers into Miles. But, I need to use two functions in addition to main program which is... [code] def main(): print "This program converts distances measured in kilometers to miles." kilometers = input("What is the distance in kilometers?") miles = … | |
The last time I posted a question here, I got a rather nasty response, so please just constructive stuff! I want to make a scrollable entrybox for Tkinter GUI, the scrollbar shows up and works, but text does not move. Am I missing something? [code=python] import Tkinter as tk root … | |
Is possible to do this: [code] from Tkinter import* scy=Scrollbar() scy.pack(side=RIGHT,fill=Y) scx=Scrollbar(orient=HORIZONTAL) scx.pack(side=BOTTOM,fill=X) canvas=Canvas(xscrollcommand=scx.set,yscrollcommand=scy.set) canvas.pack(fill=BOTH,side=LEFT,expand=1) scx["command"]=canvas.xview scy["command"]=canvas.yview canvas["scrollregion"]=(-1000,-1000,1000,1000) mainloop() [/code] in wxPython?? Thanks for all post, i am new in wx:lol: | |
I have written this program and I've having a problem making a function out of it, can you help? import math from graphics import * def drawface(): center = input('What is the center of the circle(enter as Point(x,y))') size = input ('How big is the face?') win = GraphWin() circ … | |
Hi! I am doing alredy 3 months on big program. The program solve equation. There is still a lot of things i have to repair, but it works fine;)For example, it can solve this:(5/x)/(4/x)+5*(5x+6)=|x+5|+x. The solution is: -1.14130434783 But i have different problem. Maybe you know program like this: [IMG]http://images.5star-network.com/screenshots/large/r/a/rapid-pi.gif[/IMG] … | |
Hi all, im gumster new to DaniWeb, been programming vb for numerous years moving to python anyway, Im trying to create a small authentication module for a program im making where it asks for the username and password, i was just wondering how i go about masking the password so … | |
So I have to enter a lot of text for display by Tkinter, and I've been rather miffed that I can't seem to find a way to get Eclipse (PyDev) to do any kind of auto-wrapping. Wrapping the lines myself with [inlinecode]"string1" + \ "string2"[/inlinecode] is, of course, beyond annoying. … | |
I want to be able to use scales to let the user answer various questions on screen. However, though I can get scales to work fine in other programs, in this one in particular they seem to have bugged out. What's happening is that, if I set [inlinecode]showvalue = False[/inlinecode], … | |
Hi, I'm trying to pin an image to a button, using the 'image' option. I've looked about on the net and it seems the best way to do it is to create the image in a PhotoImage object. I've done this and then stuck it onto the button but for … | |
How can I let the Tkinter Button command do more than one function? | |
hi , i just start to learn python. i am doing window browser using python for that i am using tkFileDialog module. But when i select any folder, at the same time i want to display the files and folders which contain in that folder. Exactly like window browser. So … | |
I am designing a 2 player car racing game, and I need to be able to control both cars at the same time from the keyboard (using the arrow keys for one and a,s,d,w for the other) I can get them to work when the other one is not being … | |
Hi, I want to create a little Frame class that has two labels built in, the code snippet below is the class. [CODE=python] class DescriptionFrame(Frame): def __init__(self, master, title="", text=""): Frame.__init__(master) self.title = title self.text = text self.titleLabel = Label(self, text=self.title, font=("Times", 12, "underline"), fg="darkred") self.titleLabel.grid(row=0, column=0, sticky=W) self.mainLabel = … | |
Can someone please explain to me how to animate a sprite, using an image with a set of poses? For example is it possible to specify one part of an image, or do i have to use seperate image files for each pose? And lastly, how exactly would one go … | |
Here's something that I've wished for a number of times so far: the ability to create a function (taking X) that creates X variables, even if they are all initialized to the same value. For example, [inlinecode]f(3)[/inlinecode] would assign [inlinecode]var1 = 0[/inlinecode], [inlinecode]var2 = 0[/inlinecode], and [inlinecode]var3 = 0[/inlinecode]. My … | |
I recently made a python module which calls functions from a c program. I used SWIG to generate the wrapper code from an interface file, and compiled the module into a dll which i can import in python and call functions from. While some of the functions are working fine, … | |
Basically I'm trying to take a Template String and store it in a variable for later use. I'm new with Python and programming languages in general so I'm finding difficulty in doing this. This is the code I'm using to generate the string: [code]from string import Template s = Template('$who … | |
hi all , I like to write a program which I input the dates and amounts of say 10 checks , and print out the total amount of checks and number of days thet are apart from each other on another entry widget . the code I have done sofar … | |
Hello everyone, I am new to python and I want to register and unregister the variables from a session (As we do in PHP using session_register() and session_unregister() function),So that i do not need to transfer them in the URL of my site. Can anybody tell me how can i … | |
Hi, I've a CGI form script. I'm testing it to see if it's possible to grab the headers sent by the client's computer when the form is submitted. Here's my code: # start code import httplib conn = httplib.HTTPConnection("www.somesite.org") conn.request("POST", "/scripts/test.py") r1 = conn.getresponse() header = r1.getheader('user_header') conn.close print header … | |
I'm somewhat new to Python and want to clear a few things up regarding running scripts. Alright, so here's what I want to do: I want to run a script inside of a script, and then have the first "parent" script continue running normally. I have tried using both execfile() … | |
Hi, Im having trouble with the piece of code below, i want to have the image change every time you press the button. This code is from a larger project but this is the bit that i cant get to work. Any ideas? [code=python]import Tkinter import random import Image, ImageTk … | |
Hi, I'm working on a OOP school project, and I'm trying to add a web interface to it; however, my experience working with html forms is limited. Anyways, I'm trying to set up a user login, where the user enters some info onto a form. I want to pull the … | |
I am very new to python and am learning it just for fun. I am attempting to use it for a small application that shuffles a string list. I need to get a list of about 50 last names in a random order. I tried doing [code] items = [thing1, … | |
This is a modified program from the word count program that I posted about. I am trying to calculate the average word length in a sentence. Here is my code so far: [code] def main(): print "This program will calculate the average word length in a sentence" print s = … | |
I have for instance this function I wrote and want to assure that the argument is a number when I call the function. [code]def hypotenuse(n): "return the length of the hypotenuse of an isosceles triangle" return (n*n + n*n)**0.5 sides = 3.7 print hypotenuse(sides) [/code]Any ideas how to do this? | |
Hi I'm writing a programme that looks up data from 3 different Chinese dictionaries and then formats and displays them in html using the default browser of the system. So far it works well, but it could be better. The issue I have here is that I want each character … | |
im making this game that is called PyTanks. If you want to know more about it please visit [URL]http://pythongaming.py.funpic.org/pythonmadegames.html[/URL] ... Anyway, I ran across this problem, how do you delet or remove a letter from a string. Lets say that my string is- string = "open sesame" I want to … | |
Hi, I need to grab a specific information in the /proc/cpuinfo (MODEL NAME) and print it on the screen in python. How do I do that. Thx for helping this newbie |
The End.