15,175 Topics
| |
| So I have a couple strings [code]first = input("Enter a starting integer: ") last = input("Enter an ending integer: ") last = last + 1 [/code] How do I make another assignment to a string "n" that I want to take the value of each individual integer in the range? … |
I am working with classes for the first time in Tkinter. I have no experience working with classes before this, although I have had experience with basic coding syntax before. I am trying to make a function plotter. If I have a class PlotApp. This is my the class that … | |
I am trying to build a histogram. So far I have coded the following: from Tkinter import * def plot(data): numberOfBins = len(data) root = Tk() width, height = 200, 630 #taille de la fenetre die = Canvas(root, width = width, height = height) die.pack() numberOfStripes = 2 * numberOfBins … | |
Maybe someone can help me with this. I've been working with python for less than a week, and it's my first programming language. I'm looking to figure out some basic things in python for an algorithm I wrote in a pseudo-code. I'd like to know how I can take an … | |
Hi, I have a internet connection at home. I have installed Python2.6.1 on my laptop in C:\Python26 directory. I have written a script named "TestUtil_SendMail.py" and my intension is to send a mail to the given mail id. But when am running the script I am getting an error: "[Errno … | |
Hello, I'm very new to python but made this as a sort of exercise. It is a loan calculator that takes into account user input. [code=Python] r = input('What is your interest rate? ') t = input('How many payments will you make? ') la = input('What was the amount of … | |
Hi everybody i want write a checksum function using python but i cant .. #example #find the checksum of string_data string_data="0123456789abcdef" cksum=checksum(string_data) the checksum will be sum of 01+23+45+...+ef (adding each byte) then next result = ~result and finally result = result+1 def checksum(data): .......... return result my main problem … | |
| I've done a bit of searching but didn't come up with anything. Is there a way to use multiple placeholders and then use a list with as it assignment. i.e. [CODE] l = [1,2,3] l2 =['blah',50] print('%i isnt %i isnt %i which isnt %i' %(l[:],l2[1]))[/CODE] So if the first list … |
| Hey guys, I was just making a tiny program, where I need the user to enter numbers. My question is, how do get numbers? I tried: [code='python'] self.panel=wx.Panel(None,-1) self.n=wx.TextCtrl(self.panel,-1,"Number") self.get=int(self.n.GetValue()) [/code] -but that didn't work... so how do I do it? |
Sorry if this isn't the right place for this type of question (I'm pretty new to Python). If there is a better venue for this kind of thing, please let me know: I tried to run a few PyQwt demo, but it complained that there was no module named PyQt4. … | |
Hello all, I have been doing some work on my HTML editor lately, and I have come to a (what seams like a) dead end. The file its self is about 3.7kb smaller than my text editor, ProssesIT, and yet it fails to run any where near as smoothly. When … | |
Im really new to Python and I just learnt about Quadratic equations in maths, and so i made it made it my project to make a quadratic solver. But i have a problem i have a line [iCODE]if tocontinue == n:[/iCODE] I try to run it in IDLE and i … | |
Here's my code: [CODE]metres = float(raw_input("Enter the height (in metres): ")) total_inches = 39.37 * metres feet = int(total_inches/12) inches = int(round(total_inches - feet*12)) if inches < 0.5: print "Sorry, you have entered a height that is less than 1/2 inches," \ " please re-enter a new height." elif feet … | |
I've got the codes all done; so its looks like this: [code]public class RightTriangle { public static void main(String[] args) { Triangle shape = new Triangle(); shape.setBase(4.0); shape.setHeight(5.0); System.out.println("The base of the right triangle is " + shape.getBase()); System.out.println("The height of the right triangle is " + shape.getHeight()); System.out.println("The area … | |
I had asked this question and thought that I had it solved but I could not get the text defined as variables. Below is the text file. I would like to specify a line and the length and set that to a variable. In the Example below the items in … | |
| Hi all, for some time now I have been trying to practice developing python games and I've had a really annoying problem. I want to use image files but most of the time the picture itself is not a regular rectangle but an oval etc. and the thing that I … |
hi I'm trying to write a game where I play against the computer...and as u see below..I really suck at it.. can someone pleeease help me..I want it to be as simple as possible.. thanks input random game = raw_input("Your turn. Input the coordinate for your move on the form … | |
Can someone help me with this, if I run ftp, the page is downloaded and showed well, but the progress bar only shows 100% and doesn't progress at all.. [code] def progress_timeout(pbobj): # Calculate the value of the progress bar using the # value range set in the adjustment object … | |
hi, i want to develop the web frame work using django in python on Mac OS.so how to install django on mac . how to use it and test it.. can u tell me the process from installation to run the application.. | |
Hi all. i want to make separate process with python. for example i have python code. for example: [code] import time time.sleep(5) print "Time Over" [/code] named: t.py and i want to do all ^^that^^ just on other process :) i hope you understand. AND DONT GIVE ME LINKS PLS. … | |
hiya, pls I need help using this matrix function linalg.solve_banded with python(xy) or python 2.5.4 Used it in school with python version 2.5.2 but it just does not work with version 2.5.4 and I cannot figure out the real problem. Help please, | |
ok so im making a program that finds postage rate according to its weight and category. The category is standard for weights under 50g and other for over 50g. If the user enters a weight out of its category it will say error and close. and it only works for … | |
I am having a hard time identifying numbers in a text. Is there a way to recognize numbers? | |
Hi everyone! I'm a student taking an introduction to Python programming class and I'm in URGENT need of some help! Basically the program I need is to compute the "numeric value" of a name. Ex. a = 1, b = 2, c = 3, etc. So name abc = 6. … | |
[CODE]# This file contains python code that will determine whether a potivie range # of integers entered by the user will contain odd or even numbers, prime or # composite numbers, perfect/abundant/deficient numbers, square numbers, and # triangular numbers. def main(): import math firstNum = 0 secondNum = 0 n … | |
Hi guys, I got a file having this kind of records: 000000000111GOOGLE 5428[B]MG[/B]45525[B]RC[/B] 000000000122MICROSOFT 8565[B]MG[/B]85454[B]RE[/B] 000000000044APPLE 5814[B]KL[/B]484545[B]RC[/B] I want to keep only the records that have 'MG' in position 34 and NOT ('RE' or 'RD') in position 41 What should I add to this code? #!/usr/bin/python infile = 'DATA' input … | |
Hi I was hoping I could get a bit of help here. I am trying to break a number of strings up into arrays on particular words. For example in the following strings I want them broken on the words GET and/or POST: [CODE] "POST at the start without the … | |
Tired of the Tk icon in the corner of the form. It's easy to replace with any fancy icon you have. Here is the code ... | |
In the code below, the only part I'M having trouble with is word[position]. I know this is something really simple but I've always had trouble understanding these kinds of statements. I know that it print a random letter (position) from (word). What I don't know is why or how it … | |
I am trying to compute some lexical statistics from a given text. For instance, how many lines, sentences, words, how many times a given character is repeated. Can anyone help me with this? |
The End.