15,193 Topics

Member Avatar for
Member Avatar for saikeraku

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 …

Member Avatar for snippsat
0
79
Member Avatar for StarZ

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 …

Member Avatar for StarZ
0
262
Member Avatar for Joe Hart

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 …

Member Avatar for Joe Hart
0
121
Member Avatar for masterofpuppets

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 …

Member Avatar for ov3rcl0ck
0
137
Member Avatar for c_crash

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 …

Member Avatar for jlm699
0
128
Member Avatar for Kruptein

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 …

Member Avatar for Kruptein
-1
154
Member Avatar for mohankumar554

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..

Member Avatar for jlm699
-1
134
Member Avatar for Dixtosa

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. …

Member Avatar for ov3rcl0ck
-2
262
Member Avatar for mbaliko

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,

Member Avatar for vegaseat
0
17
Member Avatar for goboman

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 …

Member Avatar for jice
0
86
Member Avatar for pelupelu

I am having a hard time identifying numbers in a text. Is there a way to recognize numbers?

Member Avatar for jice
0
85
Member Avatar for adunham1

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. …

Member Avatar for pysup
-1
113
Member Avatar for scrace89

[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 …

Member Avatar for Gribouillis
0
580
Member Avatar for thoutmosis

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 …

Member Avatar for thoutmosis
0
71
Member Avatar for amadain

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 …

Member Avatar for jice
0
272
Member Avatar for vegaseat

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 ...

Member Avatar for The-IT
0
1K
Member Avatar for lewashby

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 …

Member Avatar for jice
0
119
Member Avatar for pelupelu

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?

Member Avatar for vegaseat
0
275
Member Avatar for darkbow

Hi i'm having trouble adding a if statement to my code i have these two files in the same folder mud.world effect and simmind, in effect i have this class EffectIllusion, and i use the portion illusionRace, i ive been trying to add a condition that when illusionRace is active …

Member Avatar for woooee
-2
122
Member Avatar for persianprez

I'm to have the user input what classes they have taken and tell them what they have left to do. I have my for loop done but I feel like I need an array or something because they should have entered requirement for 6 different class types. Here is my …

Member Avatar for d5e5
-1
133
Member Avatar for lukerobi

lets say i have 2 lists: lista = [1,2,3,5,6,7] listb = [4,5,6,7,8,9,10] The lists can be different lengths, and may not allways be unequal lengths. The higher average will allways be in listb, so that is the 1 constant we can rely on. This works for even teams: [code] average …

Member Avatar for vegaseat
0
98
Member Avatar for Frenzic

Hi, I'm stumped at this problem set and was wondering if anyone could guide me in the right direction or give me some hints on where to begin. I'm not looking for a full answer. Q: Write a program that computes and prints the 1000th prime number. Any help is …

Member Avatar for pysup
-1
97
Member Avatar for vipints

Hi all, I am using scipy.io for switching from python to matlab. here is my list of list in python code = [[[1, 2], [3,4], [5, 6]], [[7, 8], [9, 10]]]. I want to convert this to matlab format. For that I used a code scipy.io.savemat('/tmp/out.mat', mdict={'Num': (code[0], code[1])}) but …

Member Avatar for vipints
0
353
Member Avatar for lehe

Hi, I was wondering how to debug python script without adding pdb module to the script file. Say, I have a script test.py without adding "import pdb" and "pdb.set_trace()". Can I debug it in Python running in terminal by importing pdb there? How to set up breakpoints and start the …

Member Avatar for Outdoor83
0
144
Member Avatar for jaymeaux77

Hi, I am fairly new at the whole programming racket and I am having trouble with an assignment for my computer science class. I know homework help is discouraged, I read that sticky, but I'm curious if I am missing a fairly simple mistake. The assignment is to make a …

Member Avatar for jaymeaux77
0
220
Member Avatar for awn

Hi - I'm fairly new to python. I 've been trying to write some python code to read data from a serial port and convert it to be able to display as incrementing or decrementing numbers with a voltmeter image in the background. Any ideas on how i can flush …

Member Avatar for ov3rcl0ck
0
73
Member Avatar for CurtisEClark

[CODE]#Program to count number of specific vowels msg = input("Enter a message:") msg_lower = msg.lower() VOWELS = list(aeiou) msg_list = list(msg_lower) x = () for letter in VOWELS: x[letter] = msg_list.count(letter) for letter in x: print(a, x(letter)) print(e, x(letter)) print(i, x(letter)) print(o, x(letter)) print(u, x(letter)) [/CODE] I get an error …

Member Avatar for masterofpuppets
0
83
Member Avatar for gmilby

i setup a cronjob to execute a script (following instructions here [url]http://moinmo.in/WikiBackup[/url]) basically their script just opens a browser to a page with a backup button. after digging, i found i could add &do=backup and it would click the backup button for me, but now it just stops at the …

0
55
Member Avatar for elliottb

Hi, I'm trying to use swig to generate python wrappers to a custom binary package that my research group uses. I'm new to swig, but I must say I'm very impressed. The only hang-up I have left is that I have trouble directly accessing the global array data. I've currently …

Member Avatar for Gribouillis
-1
131
Member Avatar for DEATHMASTER

I'm just wondering how I would fix this [code]app = first[0:8] and second[0:8][/code] That doesn't work but if I remove "and..." it does but I need both.

Member Avatar for vegaseat
-1
217

The End.