15,175 Topics
| |
I have a nested dictionary which looks like: { A:{I:{key1:value1,key2:value2}, II:{key1:value2, key2:value5, key3:value6}}, B:{I:{key1:value1,key2:value2}, III:{key1:value2, key2:value5, key3:value6} IV:{key1:value9, key2:value7, key3:value8}}, C:{V:{key1:value11,key2:value22}, VI:{key1:value12, key2:value15, key3:value16} VII:{key1:value19, key2:value17, key3:value18}} } My objective is to retrieve the keys ( A,B,C and I,II,III,IV,V,VI,VII) for the occurences of a value. So for example, if I … | |
I'm trying to create a wx.ListCtrl with a searchable header. I've been looking through the listctrl mixins, but I really don't have the wx expertise needed. I'm thinking I need to paint a textctrl using a dc object, but other than that I'm lost. Any ideas? | |
How would I find all occurances of the letter 'e' for example in a list of the split word elephant? I've tried using letterlist.index('e') for example but index only returns the first occurance of e. This is to be used in a hangman game, and the game needs to display … | |
Hi everyone, Just wondering if anyone could help. At the minute I need to check a command line for the parameter "--date=something", I've been using the re module with python like this cmd = "python myapp.py --name=stephen --date=20120323 --test=testthis" found = re.split (r"--date.*", cmd) print found but this prints the … | |
I need to create a simple input form without the use of a DB. Can anyone please assist? Thnaks, | |
When clicking the "Edit" button on an existing post, you are presented with the post and just an "Edit Post" and "Cancel" button at the bottom, neither of which post the edited version. Is there a FAQ for the new methods? If not then there should be. Also posting a … | |
I have a file has the cities names and information such as names, coordinates of the city and population of the city Youngstown, OH[4110,8065]115436 Yankton, SD[4288,9739]12011 966 Yakima, WA[4660,12051]49826 1513 2410 Worcester, MA[4227,7180]161799 2964 1520 604 Wisconsin Dells, WI[4363,8977]2521 1149 1817 481 595 How can I create a function to … | |
I want to make a program that it can create a HTML page. It should be able to make a table (with data provided) using the HTML by the program itself. This code also uses wsgi so when the program runs you will need to type the localhost on a … | |
hi, guys I'm completely new with python and right now struggling when it comes to creating functions....i have to do the following for an assignment if anyone can help that'll be awesome. Create a function that take a full name as a parameter and returns just the middle name regardless … | |
Below is the question and my attempted answer 5.4 Use the list of module titles from the previous exercise to create a for loop. It should ask the user for every title whether they would like to keep the title or delete it. Delete the titles which the user no … | |
Hi, this does compile but I only want results that have the same amount of characters as the input! Can anyone shed some light on this as I can't figure it out myself! thanks. import re # opens a .txt file and searches for matching letters in words that are … | |
Where is sticky treads starting python,Gui programming....? These were very good treads and should be sticky. | |
So, I am a novice with python. I'm trying to teach myself python just to expand my skills. I gave myself a simple challenge and I need some guidance here on how to get it done. The goal is to read in a dhcpd leases file, read through the lease … | |
I am working on a personal project and am trying to figure out if Python 3 or PHP would work better. I prefer Python because I am trying to hone my skills at it and at the same time I really do like its syntax and ease to learn. I … | |
Help needed please. Desperate. I have a 3.somethingGB file that contains records that looks like this: [ICODE]<tag> <number>1</number> <info>blah blah</info> <more>Lorem Ipsum</more> <anothertag>The quick brown fox...</anothertag> <id>32444</id> <yetmore>blah blah</yetmore> </tag> <tag> <number>2</number> <info>qwerty</info> <more>yada yada qwerty</more> <anothertag>yada yada qwerty</anothertag> <id>32344</id> <yetmore>yada yada qwerty</yetmore> </tag> <tag> <number>3</number> <info>yada yada qwerty</info> <more>yada … | |
I have written the following code to return True if the list has any repeating elements and False ow [CODE]def has_repeats(L,newlist = None): if newlist == None: newlist = [] if len(L) == 0: return False if L[0] in newlist: return True else: newlist.append(L[0]) has_repeats(L[1:],newlist)[/CODE] It is not returning True … | |
I tried searching around, but I don't understand exactly what I'm looking for so it could very well exist already and I just don't know how to ask the search engines about it. I apologize in advance. Thus the question mark on the thread title. My current background of programming: … | |
Hello everyone, I have been working on a python script to help assign university students to workplace placements. The problem is that for a given group of students there are only a limited amount of places and each placement location can only caters for a few students. The ideal solution … | |
Hello everyone! I am taking a python course at my college and I have recieved a question for my homework that I am having trouble with. [I]14) Write a program that finds the average of a series of numbers entered by the user. As in the previous problem, the program … | |
Hi - I'm a rookie programmer. Could somebody explain how I can append a nested list of the form: List = [[Name1,[Detail-1,Counter-1],[Detail-2,Counter-2].....] [Name2,[Detail-1,Counter-2],[Detail-2,Counter-2].....] ................................................. ] My code is : def program(List, Name, Detail): for entry in List: if entry[0] == Name: entry[1].append([Detail,Counter]) return [B][I] List.append ([Name,[Detail]]) for entry in index: … | |
I don't know which langauge code it is written(but i think it is python) but i am just posting to know what can happen by the following code snippet. Here is the code:- # # ms12-020 "chinese shit" PoC # # tested on winsp3 spanish, from localhost # # import … | |
Hi all, my Professor has asked us to solve this problem, which is a Midterm Practice problem for our up and coming Midterm exam, which is on Monday. I am wondering if I'm doing this the correct way or not. [B][U]Here is this question the problem asks:[/U][/B] Problem 19 Random … | |
I have made a cipher substitution program which would take some input and print a coded output. however,the required output is not coming. My program first asks for input.then it converts it into a list as it is mutable.ALso,a string of all the alphabets is declared too. [CODE] #cipher code … | |
I have to write a program that will print the chain of a number using a hailstone function, as well as with a range of numbers. That part of my program works perfectly but I cant figure out how to write a function that will find and hold the number … | |
I can't figure out what the problem is or how to rewrite my code to fix it. Basically I'm trying to create an Adventure game heavily influenced by the game Zork. The game presents you with some options and then you input your choice. I'm trying to account for a … | |
Hi, I am trying my hands on lambda function and here is my code. [CODE]>>> a = [1,2,3,4] >>> b = [17,12,11,10] >>> map(lambda x,y:x+y, a,b)[/CODE] And the output is : [CODE] < map object at 0xb7540eec >[/CODE] So my question is why this map object output? Why not actual … | |
How do i convert the list ['T','h','i','s',' ', 'i','s'] to ['This','is'] | |
I wrote code to rotate the image 90 - 180-45 But how can I rotate the Image at different angles : 20 or 80 or 155 ..... Etc. in jython | |
Tried to add two images on each other But the problem is because I have two images are merged in a gradual Which means that: to show the first picture on top and clear and the second picture is not visible Then gradually start Image Alathanih Baldhor to disappear Image … | |
Hi guys, i have a tricky problem with this wxgtk gui and thread nesting. As you can see i'm trying to collect data through a buffer ( self.data= dict() ) through the main gui. I need to get the data from the ComboBox and the three textfields then i need … |
The End.