15,175 Topics

Member Avatar for
Member Avatar for shadwickman

Hello! I've run into a slight problem with my script. As I iterate through a list of strings, I need to print each string, but they all need to print on the same line, so I used this: [code=python] for item in myList: print item, [/code] The comma puts each …

Member Avatar for shadwickman
0
137
Member Avatar for knish
Member Avatar for jlm699
0
144
Member Avatar for tillaart36

Hello all :) I have a grid program that lets me define a grid and do some basic stuff with it. The next step I need to implement is that I need to add a floodFill like method ([url]http://en.wikipedia.org/wiki/Flood_fill[/url]). What I wanna achieve with this is the functionality that I …

Member Avatar for tillaart36
0
889
Member Avatar for Dart82

Hello, Im having a little list problem with big lists. Say for example, I have this [CODE]Numbers = [["aaa", "bbb", "ccc"] , ["ddd", "eee", "fff"]][/CODE] How do I search and return from this list? eg searching for "fff" and returning "ddd"? I can only return specific position in the list, …

Member Avatar for Gribouillis
0
134
Member Avatar for Dart82

I was wondering how you define a funtion which a phrase and two words are inputted and the output is the part of the prhase between the two words. Do you convert the string to a list?? I would apprecitate any help.

Member Avatar for Dart82
0
108
Member Avatar for god0fgod

In a file there is a list: [QUOTE][['', '', '', '', '', '', '', '', '', 'Name'], ['', '', '', '', '', '', '', '', '', 1]][/QUOTE] How can I use it in a python script? Thanks

Member Avatar for Gribouillis
0
345
Member Avatar for vmars

I am reading thru DiveIntoPython docs and it gives some examples Example 3.23. Formatting Numbers >>> print "Today's stock price: %f" % 50.4625 50.462500 The 1st % designates Formatting, what does the 2nd % do? Thanks!

Member Avatar for bvdet
0
110
Member Avatar for peter1121

I need to know how to do the this assignment. moveTo(shape, newCenter) shape is a graphics object that supports the getCenter method and the newCenter is a Point. Moves shape so that newCenter is its center. Use your function to write a program that draws a circle and then allows …

Member Avatar for Ene Uran
0
203
Member Avatar for SitiSlicker

Hello DaniWeb, I am new and I have a problem thats driving me nuts, i'm sure its very simple to an experienced CS but I'm attempting to execute a couple conditional statements. basically, i am trying to write a program that determines the amount of shipping costs to inform the …

Member Avatar for sneekula
0
2K
Member Avatar for Andymoore88

I was wondering if anyone out there had a good suggestion on an Installer program. I have a few friends that are interested in how I'm doing in my programming self-education, so I'd like to send them examples of what I've done. Now I've managed to use py2exe to create …

Member Avatar for Andymoore88
0
99
Member Avatar for Devlan

A real simple one, just a question of understanding the python syntax I suppose. I won't waste your time by throwing the whole program at you, I think my question can be boiled down to this: [ICODE] a = ["cat"] b = ["bark"] wordinsa = input("Word: ") a.append(wordinsa) wordinsb = …

Member Avatar for Devlan
0
164
Member Avatar for laspal

Hi, I am having the problem in nested list. Here is the code : [code=python]data1= [['Contacts',company.contacts.count() ], ['Notes', company.notes.count()], ['Met by', ], ['Industry', industry], ['Financial Investors', '31']] for item in metlist: data1[2].insert(1,item) [/code] Basically I am trying to insert the value for Met by in [ 'Met by', metlist->value] I …

Member Avatar for vegaseat
0
256
Member Avatar for Andymoore88

Okay, continuing on with my little System access project I've been working on. Now I've gotten three different Python files in this Project. I'm using a main menu .py to offer option for the user to select from. Each option then opens one of the other two .py files and …

Member Avatar for Andymoore88
0
199
Member Avatar for lkcl

Folks, hi, I thought you might like to know that there's a way to develop complex web 2.0 applications without having to program a single line of javascript. Pyjamas, a port of Google's Web Toolkit (GWT) will translate a python application into AJAX for you. For convenience, there is also …

0
59
Member Avatar for vmars

OK, I have decided to download wxPython and Python2.6 . But I am confused which kind from here: [url]http://sourceforge.net/project/showfiles.php?group_id=10718&package_id=10559&release_id=629662[/url] I am running winXp Pro, and MAC OS X 10.5 . I don't know which win to choose, [U]32 or 64[/U], and [U]ansi or unicode[/U]? Also, osx [U]ansi or unicode[/U]? And …

Member Avatar for Stefano Mtangoo
0
163
Member Avatar for dr_hamburger

hey guys... sorry for bugging you all but i have 1 last question and i promise that will be it. its probably simple but i just want to know how to go about raising a custom exception the result it expects is: [code] Traceback (most recent call last): ... Exception: …

Member Avatar for Stefano Mtangoo
0
114
Member Avatar for dr_hamburger

hello everyone, im having a little bit of trouble with my python and i was wondering if someone could please give me a hand with it :) basically, what i am trying to achieve is exactly what is going on in this thread [url]http://ubuntuforums.org/archive/index.php/t-803060.html[/url] except in my example, the dict …

Member Avatar for lllllIllIlllI
0
138
Member Avatar for Andymoore88

Howdy folks, me again. :) I'm attempting to append to a previously pickled file using cPickle.dump(). But I keep getting the error: Traceback (most recent call last): File "C:\Python25\Python\UserAccess.py", line 24, in <module> p.dump(tempadd, temp) TypeError: argument must have 'write' attribute I've opened the file using the 'a+' attribute, which …

Member Avatar for Andymoore88
0
785
Member Avatar for Andymoore88

Okay, I'm doing some experimenting on file I/O using a user/password access program I'm writing. My problem right now is while the program will append the new user and password, it does so whether or not that user name exists already. I'm not worried about duplicate passwords, but I don't …

Member Avatar for Andymoore88
0
154
Member Avatar for ldk

Hello, I have a weird problem... When I use the clipboard, code runs without error. Attempt to paste directly after run in any application does not work. Pasting in the python shell works fine. After pasting in the python shell, pasting in any other application works fine !!! Need help …

Member Avatar for Ene Uran
0
93
Member Avatar for unkwntech

I have the following code: [code=python] import re string = 'c:\test.doc' if re.match(r":\\[0-9a-z]", string): ##r":\\[0-9a-z]" should match ':\t' print 'true' else: print 'false' [/code] the problem I am having is that this is always evaluating to false.

Member Avatar for bvdet
0
130
Member Avatar for spinner357

I have an ipod touch, but no pc. I'm in a situation where I can't use a pc. Could some kind patron please add me on msn or google or yahoo, so I can chat with them 1 on 1 on meebo. I can code the hello world program, but …

Member Avatar for EAnder
0
101
Member Avatar for FireNWater

I got Python installed on my AT&T Tilt and have been able to send *.py programs from my PC over to the phone. However, when I try to write a Python program using Word Mobile or the Note program I can't figure out how to save the program with a …

Member Avatar for EAnder
0
85
Member Avatar for defience

I keep getting an error message when I run this code and I don't know how to correct it. Here's the code and below it is the error message: [code] import sys import Image import ImageFilter im = Image.open("7.bmp").convert("L") source = im.split() R, G, B = 0, 1, 2 # …

Member Avatar for woooee
0
1K
Member Avatar for grass_hopper

Hey guys, I was wondering if someone might be able to help a newbie out. I'm trying to write a program that randomly flashes either a .gif file on screen or nothing. Now, I've gotten that working but the trick is I want there to be a short gap between …

Member Avatar for jlm699
0
96
Member Avatar for harrykokil

hi guys.. is it appropriate to use tkinter for traffic simulation where there is a lot of movement (rotation) of cars taking into consideration its speed? thanks..

Member Avatar for sneekula
0
40
Member Avatar for harrykokil

hi everyone i wanna create a class in tkinter but im finding it very difficult to begin it as im new to python. i want a class traffic light that will operate continuously (that is red to green to red.... ). thanks..

Member Avatar for harrykokil
0
108
Member Avatar for Kezoor

Hello everyone ! I am a still a beginner in Python (and have no knowledge in other languages), and today I got a reaction from my script that I find unexpected. Here's the code: I want to use the buildOneCard function to create a card (a couple of values), by …

Member Avatar for Kezoor
0
177
Member Avatar for massivefermion

Hey boys I'm using python 2.5.2 when i try to import Tkinter it tells that it doesn't know it and suggests me to install the -tk pakage if your answers include installing pakages please tell how to find and install them thanks a lot Bye

Member Avatar for jlm699
0
73
Member Avatar for ajamin

Subprocess issues with platform independence Postby ajamin on Wed Oct 08, 2008 10:46 am I am writing a python script that will act as a wrapper for another program. The python script will provide the inputs for this program and will verify that the output is correct. The application runs …

Member Avatar for jlm699
0
118

The End.