15,192 Topics
![]() | |
Write a unit conversion program that asks the user to identify the unit from which they want to convert and the unit to which they want to convert. Legal units are inches, feet, miles, millimetres, centimetres, meters, and kilometres. Convert from? Inches Convert to? Millimetres Value? 10 10 in = … | |
Hi folks I have just completed my first programme with help from yourselves. I cant understand why the code , if x ==1 or 2, wouldn't work in my programme below [code=python] # Convert C to F or F to C and return with result select = True while select: … | |
I am new to programing and am impressed with the ease of python/wxpython. I have written useful wx programs to enter data into MySQL databases, but am stuck on making a useful wxpython MySQL query progam. I have had success writing query apps in python. I'm hoping to find a … | |
is there any way to disable a loop when the user is inactive / when the screen saver is on? | |
Two up is a historically popular Australian gambling game ([url]http://en.wikipedia.org/wiki/Two-up[/url]) Two up was played at Crown Casino for a time with the following rules: •Spinner nominates “heads” or “tails” •If the spinner nominates “heads” and spins a series of three heads before being eliminated he/she is paid at odds of … | |
Hello, I know this is a very simple problem, but I am about to give up... Why couldn't I get the control keys do their job? Maybe someone whose eyes are more rested than mine can tell me. I will appreciate any help. I am dealing with pygame, and I … | |
Just want to create a flexible desktop that is independent from system. For my linux system. Like to have Clean Window and Transparent. 1. Looking for the basic on Xlib. Most of what i found is unclear where i start. I like to start simple and expand. a. Want to … | |
Chapter 9 of your textbook (and your lecture notes) refer to a racquetball simulation program (which is attached for your reference). Make the following modifications to the program: a) Ensure that to win a game (in addition to scoring 15 points) a player must obtain a 2 point margin from … | |
hello I have been doing a lot of Tkinter lately and I was wondering of there is a way i fit a scroll bar into a text wdiget using the .grid() method. right now the code i have writen is: [code]from Tkinter import * root = Tk() text = Text(root) … | |
Hello everyone.. I'm a new user of python.. I have encountered a problem while trying to find the inverse of a matrix even after importing numpy and scipy. The error is: >>> a=[[[1, 2, 3], [2, 3, 4], [3, 4, 5]], float] >>> print a [[[1, 2, 3], [2, 3, … | |
Oops, bad title... Better title: Python Serial Output Works Only Conditionally Hi, I am working on having python send commands to a microcontroller via the serial port. I want to write a python script that will send a single byte to the serial port and then quit. The script I … | |
Hi, I'm trying to make a program in python that solves word puzzles like this: "nj" (the answer to that is "ok") where each letter is off by one, for example a or c instead of b. the program is supposed to generate a list of possible words which will … | |
I would like to execute a script within a "form post" that downloads a python script. This is for the academic field, the python script is a grading script. The student must configure a case study and click a grade button (form post) that runs the python script against their … | |
Hello, This is driving me crazy so here it goes. I'm trying to create a program that finds the 1000th prime number. This is the code I started with to check if a number is prime: [code] numberofprimesfound = 0 numbertotest = 303 divisor = 2 if numbertotest%divisor == 0: … | |
I am currently learning Python and how to work with start and stop indexing. I am doing a project from the book I am learning from and I'm stumped...I need to display a full deck of cards, with [CODE]numbers = ("A", "2", "3", "4", "5", "6", "7", "8", "9", "10", … | |
hey everybody i just upgraded from 2.5 to 2.6 and im having problems with building pymedia since there is no binaries out there -.- this is what im doing and getting [CODE] C:\pymedia>python setup.py build Using WINDOWS configuration... Path for OGG: ..\pymedia\libogg-1.1.4 Path for VORBIS: ..\pymedia\libvorbis-1.2.3 Path for FAAD: ..\pymedia\libfaad2 … | |
I'm attempting to write a program that will take a word entered by the user and give a concatenation of the corresponding triple quote strings. I've looked at [URL="http://www.daniweb.com/forums/thread189881.html"]http://www.daniweb.com/forums/thread189881.html[/URL], but didn't quite find the piece I'm missing. The idea is fairly simple: User inputs a word (or numbers) Exchanges letters … | |
Hi, I have the following problem: I would like to read from a file between to keywords (KEY1 and a line consisting of ------), skipping 4 lines after the first keyword. What I have is the following: [CODE]import re import string infileName = raw_input("filename ") infile = open(infileName, 'r') data … | |
I have been thinking if this is only possible to very very very advanced wxPyees. I have tried and tried to understand this but with no success. I have seen Mike saying the same in wxpy listing and many more. I have started this to hear your experience with printing … | |
I'm a bit confused as to how variables (or fields) of classes are handled in python. I'll give a small example of what I mean. [CODE] class Cow: # the first class that popped into my head legs = 4 moo = cow() [/CODE] now, moo.legs will return 4 and … | |
Hi, I'm running a PCM-9375 system with Linux Debian 5.0.0. I am currently running a a python application on the system continuously, and our system seems to be resetting approximately every 24 hours (not at midnight, but 24 hours from whenever the system was started). I am not sure whether … | |
I have a weird glitch or something, whenever I try to start turtle graphics from the shell it goes unresponsive, but when I run the program in a console window it works. This is really annoying me! Any help would be appreciated. | |
Okay, I am confused on the global statement. To my knowledge it lets you easily access variables from a function to be used in the session. Now someone said that it's useless and you shouldn't use it in your code. Is this true? | |
hello, pls can somebody show me a way how to solve the following exercise: A number, a, is a power of b if it is divisible by b and a/b is a power of b. Write a function called is_power that takes parameters a and b and returns True if … | |
in Vista, cTurtle worked like a charm, but in Ubuntu, when i downloaded the cTurtle to my desktop and moved it to site-packages, it still won't work. When i clicked on the downloaded cTurtle.py file, what i get is a text file with chinese characters, and it closes within a … | |
Hi All Could you please help me with the following, #Convert C to F def Tc_to_Tf (): Tc = input ("What is the Celsius Temperature ? " ) Tf = 9.0/5.0 * Tc + 32 print 'The temperature is ', Tf, ' Degrees Fahrenheit' I get NameError: name 'Tf' is … | |
Hello, I'm posting this code so that maybe it will help someone else in the future. I spent about a week trying to figure this out, and Google searches were not helping. Hopefully anyone else wondering about this will see this post on a Google result. The program I finished … | |
Hi all, I have a php/mysql based site set up. I want to keep my database layer updated via a python script that will query some other systems, parse data and make the appropriate CRUD calls to my database. My question is might be a simple one but I'm wondering … | |
Hi, I've been trying to create a program that gets wikipedia pages, and lists all the links found in the page source. I've used the urllib.urlopen() method to do this, and unfortunately I've run into a little problem. Instead of getting the actual page like say the main page, or … | |
So below is my first attempt at using user input, but I can't figure out how to get the input (at the bottom) to plug into my function definitions. I have no proper python training and am attempting to learn on my own with some books. I would appreciate any … |
The End.