15,175 Topics

Member Avatar for
Member Avatar for paraclete

I'm having difficulties splitting up a string (that I read from a textfile) into three parts in a list (that I will then use in a function). The issue I'm having is that the 3rd element of the string is not always one word (sometimes its multiple words, but I …

Member Avatar for Gribouillis
0
143
Member Avatar for jayjay85

i need to use crossfade function to to this. i need some help please, i am new at this. any help would be great. i have done a program than makes a double image but this need to happen slowly.

Member Avatar for marksman123
0
605
Member Avatar for SK6114

Hey, I have pylab and I want to plot a histogram of the following : Basically I generate a random integer between 0 and 1.0 about 10,000 times and then I want to arrange each integer into a separate bin of the histogram so I can see on the histogram …

Member Avatar for Gribouillis
0
114
Member Avatar for giancan

Hi guys, I'm having problems with wxPython. If I put in the header of my files from wxPython.wx import * it works fine, even if I see a DeprecationWarning about it. If I write import wx (as also wxformbuilder would do) I get errors like name wxPySimpleApp is not defined …

0
97
Member Avatar for ljvasil

Hi all, I wrote this somewhat simple script that is suppose to change and update polygon GRIDCODES based some rules. The shapefile is reclassified into likelihood of conversion. So the code is set up to get the GRIDCODE value of all adjacent polygons to the cursor polygon. I put these …

Member Avatar for Gribouillis
0
424
Member Avatar for arson09

I'm having trouble creating a function with one parameter that reads from a file and then creates and returns a dictionary based on what's in the file. And example of whats in the file: [ICODE]115 139-28-4313 1056.30 135 706-02-6945 -99.06 143 595-74-5767 4289.07 155 972-87-1379 3300.26[/ICODE] What i have: [CODE]open('balance.txt', …

Member Avatar for arson09
0
560
Member Avatar for csterling

I have a large number of files that begin with numbers (e.g., 10admin_boundary_x) and would like to rename the files so that they do not begin with a digit (e.g., admin_boundary_x). I am working with shapefiles (.shp, .shx, .dbf, etc) and thought a python script could save me some time. …

Member Avatar for TrustyTony
0
2K
Member Avatar for flynismo

Hi.. this is not a "which is better" thread, although if you happen to have a reason for thinking so, please share your thoughts. First I just want to say that I do not want to have any flame wars or arguments or anything like that. Please keep emotional arguments …

Member Avatar for rubberman
0
198
Member Avatar for JOSED10S

1)Write Python code that asks the user for two angles of a triangle. Then, first determine if the triangle can exist (make sure that the third angle can be found such that the sum of the three angles is 180°, with all angles both given and computed conforming to the …

Member Avatar for Cireyoretihw
0
1K
Member Avatar for Wilha

[CODE]import math print "Select unknown variable" print "a, b, or c" print equation=input("> ") if equation == a: b=input("Enter b: ") c=input("Enter c: ") a=math.sqrt(c ** 2 - b ** 2) print "a= ",a [/CODE] **i get the following traceback Traceback (most recent call last): File "C:\Python27\My Programs\pt.py", line 7, …

Member Avatar for TrustyTony
0
203
Member Avatar for felix001

I have a number of lists such as ['BLAH', 19, '11111', 'Fa0/19', '100000000'] I either need to make a list of lists or a dictionary containing lists. What would be the recommended one to do and will make the process of further sorting and text manipulation the easiest. Thanks,

Member Avatar for woooee
0
166
Member Avatar for ryufire
Member Avatar for adrain91

1 the computer displays some secret word(in underscore):--- 2 I guess letter"c"in the word 3 yes,the screen pops up like this :c-- 4 I guess the second letter is u 5 yes , it is :cu- 6 last ,I guess the final one is p 7 yes , it is …

Member Avatar for Cireyoretihw
0
249
Member Avatar for vlady

Hello, I am learning classes and object and I have a problem with this code. Simply does not work. Can you tell me the reason please? Error message tells me that Distance is not defined...(I don´t understand this message) Thank you for help! Vlady [CODE]class Distance(object): 'return distance between 2 …

Member Avatar for vlady
0
125
Member Avatar for Sprewell184

Hi, this is my first post. I apologize if I make any mistakes. I have a problem where I need to take a list and print it out as a table of average for each person. The list is : [('tom',4),('ben',5),('tom',8),('ben',12)] So far my code is: [CODE]def getAverage(list): list = …

Member Avatar for TrustyTony
0
127
Member Avatar for SK6114

Hi, I need to integrate e^-(x^2) between negative infinity and positive infinity, now the function vanishes to a minute value much before negative and positive infinity. I need to approximate the integral using the trapezium rule, which I have coding for but I just don't know how to apply it …

Member Avatar for TrustyTony
0
736
Member Avatar for pelin

i am writing a program that reads the file i create. The file has grades and weights of grades anddd 3 person but i need to create a program that will read the information from the file, calculate and print the total average of each student given by the formula …

Member Avatar for TrustyTony
0
233
Member Avatar for eikonal

Hi everyone! This is my first post even though Ive been reading you for a while. I'm a Python beginner and I'd need your help. I'm processing a very big file (more than 2 millions of lines) but I'll show you a much smaller example (24 lines rather than 74513). …

Member Avatar for JoshuaBurleson
0
130
Member Avatar for PlUmPaSsChIcKeN

Im a beginner to python and my professor has assigned the following assignment: You buy an international calling card to India. The calling card company has some special offers. a) If you charge your card with $5 or $10, you don’t get anything extra b) For a $25 charge, you …

Member Avatar for PlUmPaSsChIcKeN
0
237
Member Avatar for momus

How to suppress end user ability to edit/add/delete text in a Text widget? (Python v3.2.. and tkinter) The point is to [B]suppress only the ability to change/add/delete text[/B] but not to castrate other features. Perhaps a NoEdit Text widged would be a better name. I've tried [B].text['state'] = 'disabled'[/B] and …

Member Avatar for momus
-1
1K
Member Avatar for peste19

[CODE] for elem in sentence: .setdefault(elem, 0) repeat[elem] += 1 print sorted([ (freq,elem) for elem, freq in repeat.items()],reverse=True)[:3] print repeat [/CODE] i have this loop which analyses the elements in the loop and then prints by frequency, i wanted to print by frequency and alphabetically. example [(5,apple),(5,orange)]

Member Avatar for woooee
0
1K
Member Avatar for JoshuaBurleson

I'm trying to use cx_Freeze and everything everything seems like it should work fine, however I'm getting an import error for import tkinter [CODE]Traceback #... from tkinter import __fix #... import_tkinter ImportError: DLL load failed: The specified module could not be found.[/CODE] This only happens when I take the the …

Member Avatar for JoshuaBurleson
0
350
Member Avatar for Wilha

im trying to write a code that i can input a,b,c and the code will run it in the quadratic formula and give me the answer but i keep getting a error problem import math from math import sqrt print print ("Welcome to the Quadratic Program") print ("--------------------------------") print a=input("Enter …

Member Avatar for Wilha
0
369
Member Avatar for born316

hii I am trying to develop a simple image browser.this is wat i have done so far [CODE]from Tkinter import * top=Tk() def search(): global pic global photo pic=PhotoImage(file='images\\pic.gif') photo=w.create_image(250,200,image=pic) w=Canvas(top,height=500,width=500,bg="white") entry=Entry(top,bg="white") nxt=Button(top,text="next",activebackground="blue",command=next) prev=Button(top,text="prev",activebackground="blue") b=Button(top,text="search",activebackground="blue",command=search) b.pack() entry.pack() nxt.pack(side=RIGHT) prev.pack(side=LEFT) w.pack() top.mainloop() [/CODE] as u can see it will display a …

Member Avatar for Netcode
0
772
Member Avatar for Y DIY

I have a question about fnmatch function. Can fnmatch take a list return from a function for the pattern? Consider the following code. [CODE] import os import sys import time import fnmatch import shutil from logalert import log def copyLiveToPrompt(): #This function will copy all of the appropriate Voice Prompt …

Member Avatar for Y DIY
0
68
Member Avatar for terry35

When I open python I am unable write my code in it. This just started to happen no idea what is happening? Its unclickable inside but I can click the bar on top. Anybody know?

Member Avatar for JoshuaBurleson
0
115
Member Avatar for soccermiles

I would like to embed the python interpreter, but not in the way most other people do. I don't need to multi-thread unless it's necessary to do as follows... What I need is control over when execution happens. More specifically, I would like to use a python script to call …

Member Avatar for soccermiles
0
264
Member Avatar for radiumc

Hello, I am very new to python. I have two files containing multiple lines of files name, and I need to filter out if file name present on file1 than remove it from file2 and save the file2 difference into a third file. i.e. file1: /users/ux454500/radpres.tar /paci/ucb/ux453039/source/amr.12.20.2002.tar~ /paci/ucb/ux453039/source/amr.1.25.2003.htar.idx /paci/ucb/ux453039/source/amr.1.18.2003.htar.idx file2: …

Member Avatar for radiumc
0
144
Member Avatar for peste19

i am beginning to learn python so please be easy on me, i am trying to create a function that will accept user input and store it in a list, separating words and ignoring punctuation example: input = i.am/lost stores in list as "[i],[am][lost]" this is what i got so …

Member Avatar for TrustyTony
0
177
Member Avatar for pythondaniweb

Say I have a string of arbitrary letters and spaces. "fdgdfg asd fasdf asdf awpoemp poanew awe pon pqonw aknlkn ar glknlk and so on" is there any way to wrap this WITHOUT using the worp wrap feature so that there are only x characters in each line? "fdgdfg asd …

Member Avatar for woooee
0
112

The End.