15,175 Topics
| |
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 … | |
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. | |
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 … | |
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 … | |
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 … | |
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', … | |
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. … | |
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 … | |
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 … | |
[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, … | |
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, | |
How do I make a transparent window in Tkinter? | |
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 … | |
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 … | |
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 = … | |
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 … | |
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 … | |
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). … | |
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 … | |
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 … | |
[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)] | |
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 … | |
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 … | |
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 … | |
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 … | |
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? | |
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 … | |
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: … | |
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 … | |
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 … |
The End.