15,175 Topics

Member Avatar for
Member Avatar for Sunciti

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 …

Member Avatar for TrustyTony
0
1K
Member Avatar for ihatehippies

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?

0
192
Member Avatar for White Eagle

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 …

Member Avatar for woooee
0
184
Member Avatar for SCass2010

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 …

Member Avatar for TrustyTony
0
181
Member Avatar for felix001

I need to create a simple input form without the use of a DB. Can anyone please assist? Thnaks,

Member Avatar for felix001
0
92
Member Avatar for woooee

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 …

Member Avatar for TrustyTony
0
255
Member Avatar for braybray

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 …

Member Avatar for woooee
0
167
Member Avatar for boiishuvo

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 …

Member Avatar for woooee
0
337
Member Avatar for pakiali007

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 …

Member Avatar for TrustyTony
0
234
Member Avatar for markusd5454

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 …

Member Avatar for Gazzmonkey
0
270
Member Avatar for Gazzmonkey

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 …

Member Avatar for TrustyTony
0
152
Member Avatar for snippsat

Where is sticky treads starting python,Gui programming....? These were very good treads and should be sticky.

Member Avatar for TrustyTony
0
98
Member Avatar for CimmerianX

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 …

Member Avatar for TrustyTony
0
944
Member Avatar for fistfullofbeer

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 …

Member Avatar for TrustyTony
0
163
Member Avatar for 4evrmrepylrning

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 …

Member Avatar for Gribouillis
0
274
Member Avatar for maxwellp

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 …

Member Avatar for TrustyTony
0
160
Member Avatar for zephiechan

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

Member Avatar for Gribouillis
0
138
Member Avatar for starkles

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 …

Member Avatar for TrustyTony
0
209
Member Avatar for A_Dubbs

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 …

Member Avatar for B dawg
0
939
Member Avatar for Sunciti

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

Member Avatar for misokolsky
0
8K
Member Avatar for utkarshsahu

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 …

Member Avatar for snippsat
0
407
Member Avatar for minimee120

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 …

Member Avatar for M.S.
0
155
Member Avatar for QuietShot59

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 …

Member Avatar for woooee
0
185
Member Avatar for Yoink

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 …

Member Avatar for TrustyTony
0
596
Member Avatar for aj9393

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 …

Member Avatar for woooee
0
208
Member Avatar for arunpawar

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 …

Member Avatar for Gribouillis
0
94
Member Avatar for Sunciti
Member Avatar for Gribouillis
0
89
Member Avatar for Suzan Al-amassy

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

0
44
Member Avatar for Suzan Al-amassy

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 …

0
58
Member Avatar for arty.net

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 …

Member Avatar for arty.net
0
160

The End.