15,190 Topics

Member Avatar for
Member Avatar for guidely

Hi I dont really sure what I did wrong but it no working. I am making Snakes and Ladders game with out using list import random separator = '-' * 20 spaces = [None] * 90 c_l_spaces = {r'slid down a chute ': [[14, 3], [20, 15], [39, 33],[66, 53],[69, …

Member Avatar for TrustyTony
1
1K
Member Avatar for utkarshsahu

Suppose i have a list l=[1,2,3] i want to make this list as [2,3,4] i.e. add 1 to all the values in list l. I want to do it by the method of for loop.. Can someone help?

Member Avatar for TrustyTony
0
123
Member Avatar for NeoSyn

Been stumped over this for a while.. I was just wondering how I'd go about creating pattern movement and randomising it. The movemnt itself is just simple back and forward. But I wanted to make it random rather then fixed (which is what it is now) The main isn't posted …

0
79
Member Avatar for SlzzyDzzy

Im trying to teach myself a little bit of python and have become stuck/frustrated. Im on [Python.org](http://www.learnpython.org/page/Loops#) and so far have had no luck. First, the objective is not too clear "Loop through and print out all even numbers from the numbers list in the same order they are received, …

Member Avatar for M.S.
0
185
Member Avatar for dobermiller

I've been trying to finish up an otherwise straightforward assignment for my python comp sci class but for whatever reason everytime I try importing cTurtle it informs me that such a module does not exist. I'm a little confused because I've never had this problem before. The relevent bit of …

Member Avatar for TrustyTony
0
224
Member Avatar for greatman05

Hello. What are some ways that one can work with (x,y) coordinate pairs in Python? I'm doing a homework assignment that requires me to create a program that can check for certain binary relations (reflexive, transitive, symmetric), and I'm having an issue coming up with the best approach for it. …

Member Avatar for greatman05
0
275
Member Avatar for bsh6wc

I have a file that looks like this: 110603/1200 stuff stuff stuff min and max 0.00 1.00 110604/1200 stuff stuff stuff min and max 0.00 1.50 etc... I want to pull out the date and pair it with the associated min and max value associated with it. I know how …

Member Avatar for TrustyTony
0
132
Member Avatar for Niner710

Hi, I am interested in trying to make a cumulative distribution function in Python. I have a set of data in a numpy array and just want to plot that data. numpyArray = [0.4, 0.3, 0.6,1.2,1.8, 0.5] I would also like to have a vertical line on the x-axis at …

Member Avatar for Niner710
0
242
Member Avatar for kernel>panic

I wrote an XML parser that works great to fit my needs, but I can't retrieve the root attribute nodes no matter what I try! So far I have the following code that works great to retrieve the child tag values: import xml.dom.minidom def parse(filename): xmlDoc = xml.dom.minidom.parse(filename) tag = …

0
123
Member Avatar for adrigreat14

I am starting to learn python as my first programming language, but i ran into a problem while trying to make a function that calculated the missing variable in the simple equation v= u+at. The problem is that i am incapable to change a variable's value from False to True …

Member Avatar for adrigreat14
0
280
Member Avatar for Despairy

Hi, Im trying to parse a file which contains some random text. How can i match a case which seperates "garbage" (anything but digit/letter) char?? for e,g: 25.5.5 will produce . (the 2nd dot, because 25.5 is a number (rational)) another e.g: ----3.82 will produce --- (because -3.82 is a …

Member Avatar for nbaztec
0
154
Member Avatar for 4evrmrepylrning

So I have been told by various people on numerous occasions that you cannot parse XML by using regular expressions or any means other than a parser. So, here at work, I have LXML and that is what I have to use. At the moment I am trying to remove …

Member Avatar for 4evrmrepylrning
0
276
Member Avatar for Despairy

lets say i have these two patterns patternWord=r'[a-zA-Z]+' #word patterns patternNum=r'[+-]?\d+\.?\d*' #numbers patterns can i make a third pattern that is made out of them? patternTrhee= NOT patternWord AND NOT patternNUM? so than it will find all others? didnt find how to combine patterns and my teacher doesn't know either …

Member Avatar for TrustyTony
0
145
Member Avatar for pansquare

is there a way in python to only take from a file a string in between certain characters? for example, if i have this in a file: city state[long, lat]population how can i take from the line just what is in between the brackets (that is, come up with [long, …

Member Avatar for nbaztec
0
241
Member Avatar for felix001

When trying to install django tagging Im getting the following error : [root@Fileserver django-tagging]# pwd /opt/django/djangoblog/django-tagging [root@Fileserver django-tagging]# python setup.py install Traceback (most recent call last): File "setup.py", line 49, in ? version_tuple = __import__('tagging').VERSION File "/opt/django/djangoblog/django-tagging/tagging/__init__.py", line 3, in ? from tagging.managers import ModelTaggedItemManager, TagDescriptor File "/opt/django/djangoblog/django-tagging/tagging/managers.py", line 5, …

Member Avatar for TrustyTony
0
185
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
182
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
256
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
339
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
274
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
100
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
948
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
165
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
275

The End.