15,190 Topics

Member Avatar for
Member Avatar for giancan

Hi guys, when I process some images (where apparently the dpi info is missing for python) I get a Keyerror: 'dpi'. Is there an easy way to capture this error or set the dpi to 72 if this info is not available? Thanks a lot

0
127
Member Avatar for beck4456

Hello, I'm working on a program that would print the prefixes of two user inputs if they matched. I'm thinking of this along the lines of if the value of the first character in a is = to the value of the first character in b, print the value. Next …

Member Avatar for TrustyTony
0
169
Member Avatar for just_starting

[CODE]def main(): distance, fuel = 0.0, 0.0 inStr = input ("Enter gallons and miles (with a space between):") while inStr != "": gallons,miles = inStr.split() gallons = eval(gallons) miles = eval(miles) print("MPG for this leg: {0:0.1f}".format(miles/gallons)) distance = distance + miles fuel = fuel + gallons inStr = input("Enter gallons …

Member Avatar for just_starting
0
164
Member Avatar for arson09

I'm really confused at the moment. I'm not looking for anyone to give me the answers, but if you could at least give hints on what i need to do in each method, i'll be happy!! FYI, one of the main things that's confusing me is that i'm not allowed …

Member Avatar for arson09
0
224
Member Avatar for graphicsgrl

I am new to python(version 3.2.11) and having some problems with this code...Please Help!! Here is the program I am supposed to write: Write a program which computes the fuel efficiency of a multi-leg journey. The program will prompt the user for the starting odometer reading and then for information …

Member Avatar for graphicsgrl
0
947
Member Avatar for ao_py

I have written a program that simulates volleyball using rally scoring. In rally scoring, the team that wins the rally wins the point, regardless of which team is serving (for this reason my program ignores the issue of who’s serving). Games are played to a score of 30 and must …

Member Avatar for Gribouillis
0
2K
Member Avatar for hemant_rajput

Hi, I need wrote a script which can go to particular site and download all the wallpaper or images available there. Can any one suggest me how to start with that. I never wrote python prog before but i know python. If anyone cn give me the direction it will …

Member Avatar for hemant_rajput
0
208
Member Avatar for sitmiller

I have a file with several lists of names with scores. Ex: Foo 3 4 5 4 3 80 90 40 I need to split the file and then make it so I can take the numbers and calculate averages, so the numbers need to not be seen by Python …

Member Avatar for woooee
0
200
Member Avatar for pelin

Jack loves to do jumping jacks. Create a simulation of Jack consisting of a stick figure and three buttons: start, stop, and quit. If the user clicks the start button, Jack begins jumping; if the user clicks the stop button, Jack stops jumping; if the user clicks the quit button, …

Member Avatar for pelin
0
464
Member Avatar for imperialguy

I want to create an ultimate list ctrl based table where the user can sort the columns by clicking on the column header. Here's the code I attempted: [CODE]import wx import wx.lib.mixins.listctrl as listmix from wx.lib.agw import ultimatelistctrl as ULC APPNAME='Sortable Ultimate List Ctrl' APPVERSION='1.0' MAIN_WIDTH=300 MAIN_HEIGHT=300 musicdata = { …

Member Avatar for woooee
0
486
Member Avatar for algrandjean1

I am having a little trouble ending my program when I click on my End Program button. The current code that I have keeps making the program freeze when I try to exiting via the button. Also, I am having some issues with my Auto Button not working. Any help …

Member Avatar for woooee
0
174
Member Avatar for peste19

I made a function which will look up ages in dictionary and give out there name my dictionary si for example {george:16,amber:19} i made this [CODE] search_age = raw_input("Provide age") for age in list.values(): if age == search_age: name = list[age] print name[/CODE] but i know how to compare and …

Member Avatar for woooee
0
97
Member Avatar for huntaz556

I know this thread has been done alot but i cant find anything that i think i would like to do i want to make a program in python i have a pretty basic understanding of python and i really like it but i want to make somthing thats going …

Member Avatar for huntaz556
0
344
Member Avatar for Creatinas

Hello, i need some help with code, i need to be able to print something that function returns then i press button on panel1 it should return text to panel2 textctrl in wxpython. Here is some bit of code.(i just cut code that i think is needed for this) [CODE] …

Member Avatar for Creatinas
0
155
Member Avatar for eikonal

Hi guys! Pretty easy question below From the code below 'data' is made by a column of numbers, let's say 12 numbers (see below) 56.71739 56.67950 56.65762 56.63320 56.61648 56.60323 56.63215 56.74365 56.98378 57.34681 57.78903 58.27959 [CODE]def block_generator(): with open ('test', 'r') as lines: data = lines.readlines ()[5::] for line …

Member Avatar for eikonal
0
180
Member Avatar for cdedmundson

I am working on a python version of the game Lingo. Here are the rules: [I]"Suppose the secret word is bones. Suppose you guess the word books. The computer will mark your guess as [b][o](o)k[s], where [b], [o], and [s] are letters that are in the correct position in the …

Member Avatar for joehms22
0
368
Member Avatar for sofia85

Hi, I'm trying to add new information, with several if loops, to a new file with append.() but I'm not sure that this works. The new file will also include some data from the f_file, that is why the if loops are there. [CODE]f=open('filename', 'r') new=open('filename', 'w') for data in …

Member Avatar for sofia85
0
103
Member Avatar for sathyapro

HI This is sathya seelan.. I want to develop a simple web application using python... it has to be like a mail interface msgs needed to be stored and login details should be stored in database pls help me with a code snippet

Member Avatar for Tech B
0
175
Member Avatar for wonjun, choi

I want to draw like this [url]http://ompldr.org/vYjN1ZQ[/url] by using the example : [url]http://code.activestate.com/recipes/410158-fractal-tree/[/url] or anything the algorithm is [code] def Calculator(Total): numpyArray = numpy.zeros((Total, 2)) for i in range(1, Total+1): #if i == Total+1 or i == 1: numpyArray[i-1, 0] = ((2 * i) - 1) numpyArray[i-1, 1] = (Total …

0
47
Member Avatar for martyshka

I need to create this game in Python but I'm really confused on how to write the code! The game Accordion is played with a deck of 52 cards. Beginning with one card, cards are laid out in a row to the right. As each card is played, its compared …

0
57
Member Avatar for Sprewell184

Hey, I am confused how to display an image in the same window. This is my code for removing a certain color(removing green) from a picture, saving it and then it displays into a different window. [B][U]I need it in same window and to be below the original image.[/U][/B] any …

Member Avatar for TrustyTony
0
111
Member Avatar for Lzaochi

I need to do a for loop that helps me rotate an image. Design a function that uses nested for loops to rotate an image 90 degrees clockwise. Could you guys help me Im lost..... :-/

Member Avatar for Gribouillis
0
26
Member Avatar for bigredaltoid

I need to read in a list from a text file, put that list in a list, read in the amount of credits the students earned as an int, and than add 16 credits to the list. Here is my code so far: [CODE]myList2 = [] myList = [] myFile …

Member Avatar for bigredaltoid
0
192
Member Avatar for python-noob

I know this forum isn't to give away the answers, but could someone maybe help me get started? My biggest problem is figuring out where to start. Even the pseudo code doesn't help me very much. I don't know how to use an excel file in a program either. I …

Member Avatar for python-noob
0
205
Member Avatar for Sprewell184

I have this code below where I have to make it a function. I'm confused. I tried [CODE] def drawLine(img): .... .... .... [/CODE] Do I set the location of the picture as my variable? and then calling it? How would I call my parameter when I want to check …

Member Avatar for TrustyTony
0
121
Member Avatar for Sprewell184

Hi, I have this problem where I have to make a function that takes one parameter and draws two vertical lines, one is a red line from (50,0) to (50,300) and one made up of randomly colored pixels(150,50)to (150,250). I didn't define my function yet but for some reason my …

Member Avatar for Sprewell184
0
1K
Member Avatar for my.name

Hello everyone, :) I have exercise for class that I can't complete, I don't understand why my loops aren't working The question--- Write code that will print a multiplication table for 10 positive integers across the columns and 10 positive integers down the rows. Prompt the user for the starting …

Member Avatar for my.name
0
843
Member Avatar for praveens96

import MontyLingua theTagger = MontyLingua.MontyLingua() String = "when was tom born?" #tokenized the String tokenizedString = theTagger.tokenize(String) chunkedString=theTagger.chunk(tokenizedString) #error coming here #Tag the tokenized String tagString = theTagger.tag_tokenized(tokenizedString) print tagString #A more simple way to tag the String tagString = theTagger.jist(String) can anyubody help me why error is occuring there …

Member Avatar for sumitb128
0
624
Member Avatar for madtowneast

Hi all, I have been trying to economize some code. I am trying to nested three notebooks into each other and that looks something like this: [CODE] #!/usr/bin/env python import os import sys import datetime import numpy as np from readmonifile import MonitorFile from sortmonifile import sort import wx class …

0
95
Member Avatar for thatjoeguy01

Hey, So I am a very experienced PHP programmer and completely new to python, I was wondering if someone could assist me with this program I am trying to make, The idea is simple The program has 10 different fortune quotes, the user needs to be able to tell the …

Member Avatar for thatjoeguy01
0
181

The End.