15,190 Topics

Member Avatar for
Member Avatar for wolih

Hi. I have the terrible problem that I never finish my projects because i get bored or distracted with other stuff. So, I wanted to make something really easy: text-game. Its about greek warriors in the olympics, so I need to assign a large number of attributes to each warrior. …

Member Avatar for tomtetlaw
0
100
Member Avatar for breatheasier

Hi, I have 2 columns of data, separated by a space, which I am trying to import into 2 variables as a tuple. Each column as a variable. I know the program would involve something using line.split() or line.strip() but I can't figure out how I would do it. Also …

Member Avatar for breatheasier
0
177
Member Avatar for tomtetlaw

i have written a simple text game and i would like people to comment on my style and comment on things that i could improve on. [code=python] #=============================# # Copyright Tom Tetlaw (c) 2009 # #=============================# import random items = ["pot plant","painting","vase","lampshade","shoe"] keyLocation = random.randrange(1, 5) print "You went to …

Member Avatar for adam1122
0
101
Member Avatar for LateNiteTippin

I'm very new to python, so this is very basic. I'm using the same basis i used on an add row program, which is probably why it comes up adding a row. When i read it back to myself, it seems to make sense. Thanks in advance for any help. …

Member Avatar for LateNiteTippin
0
2K
Member Avatar for coder_gus

Hi, I am in deep need of some good ideas about how could I test an application server written with twisted, testing it with twisted trial. The way the application server works is by using a home-made XML protocol. A client logs in by sending an authorization request, it receives …

0
50
Member Avatar for srk619

hi, does anyone have or know were i can get some coding for a fractual curve any curve that is or may be a Dragon Curve. thanks

Member Avatar for srk619
0
95
Member Avatar for tschafer204

I wrote my rock paper scissors game for glass, but i used a recursion and not a while loop. I haven't been able to get my while loop to work at all, part of the reason i didn't put it there in the first place. Also, i have to test …

Member Avatar for jlm699
0
923
Member Avatar for drew7py

Hi pythonians I am trying to sort a Numpy array by field, but I am having trouble setting up the fields. I think I may have the dtype wrong. I keep getting a TypeError: "expected a readable buffer object". Here is a sample of the infile: 1480 CL 9 2004 …

Member Avatar for drew7py
0
2K
Member Avatar for n1ke

Hi everyone! First, sorry for my bad English! I have a problem with httplib... I must send XML contain throu HTTP protocol, and here is my code [CODE] import sys import httplib xml = """ <?xml version="1.0" encoding="utf-8"?><!DOCTYPE Doc SYSTEM "TenorOAM.dtd"> <Doc date="1196693972484" from="10.1.1.180" nid="CMS000001" sid="94" to="85.90.74.15"> <ReqMsg><MsgHead mid="1"/><Cmd><New><ObjPath><Instance otype="Null" …

Member Avatar for donnygat
0
118
Member Avatar for SDS20

Hi! im trying to create an object in python, but when i try to call the length of that object, it says "Mp3tag instance has no attribute '__len__'" i know i can define a method on the "object"(i dont know if im creating the object in the right way) called …

Member Avatar for SDS20
0
127
Member Avatar for pythonnewbie1

Here is my assignment with the directions. ###Programmer Brian Austin ###FOP ###3/30/09 ###Assignment 8 ###Using a loop, allow the user to input as many student names as they like and store the names in a list. in title format #then write the list of names to a file named NAMES. …

Member Avatar for jlm699
0
224
Member Avatar for kiddo39

Hi, how can I open an image and get the R,G,B values of just the first line? [code] from PIL import Image im=Image.open("image.bmp") img=im.getcolors() print img [/code] I've tried im.getdata() , im.histogram, etc.... but again, what I'm looking for is more of R,G,B pixel counts for just the 1st line …

Member Avatar for lllllIllIlllI
0
145
Member Avatar for tillaart36

Hi guys, I have a program where I need to load csv files. I have the problem where some loaded csv files have a comma as delimiter and other csv files have semicolon delimiters. For the functionality of the bigger program I want to use the load function and when …

Member Avatar for tillaart36
0
2K
Member Avatar for tomtetlaw

what are some methods for open()? i want to know when the end of file is incountered like so: [CODE] def saveFile(filename): fout = open(filename 'w') while not fout.EOF(): fout.write(havnt figured out what to do here but dw bout it) [/CODE] any ideas?

Member Avatar for tomtetlaw
0
112
Member Avatar for tomtetlaw

im doing a tut for Tkinter and in it they do this: [CODE]tkFileDialog.askopenfilename()[/CODE] but when i run it i get this error: Traceback (most recent call last): File "C:\Documents and Settings\tom\Desktop\Programing\Python\c++ + python\main.py", line 67, in <module> if __name__ == "__main__": main() File "C:\Documents and Settings\tom\Desktop\Programing\Python\c++ + python\main.py", line 64, …

Member Avatar for tomtetlaw
0
607
Member Avatar for dilipkk

Hi all, I want to classify movie reviews as positive or negative using machine learning techniques and I want to do this using python. Can any one suggest me how to these things in python. Thanks In Advance :) -Dilip Kumar Kola

Member Avatar for dilipkk
0
103
Member Avatar for snowfish

Is it possible to write a python code to enter password when connect to a bluetooth module? Project that I am doing now is control ON/OFF ports on development board, so to make it more secure I would like to add a password function before get to control ports.

Member Avatar for bluedevices
0
164
Member Avatar for tomtetlaw

how do i exicute python scripts in a c++ program? and what uses would it have?

Member Avatar for Duoas
0
107
Member Avatar for harrykokil
Member Avatar for woooee
0
74
Member Avatar for Coolprogram

Hello all, well, I am new to these forums, and fairly new to Python. I know some python though, so I am not a complete "newb" so to speak. But I was wondering how to have python while loops work for two variables or strings or w.e. here's a piece …

Member Avatar for woooee
0
140
Member Avatar for tomtetlaw
Member Avatar for Florest

I've got a CSV file which has a bunch of stock information I need to whittle down to a specific format for another program to read. The first line in the CSV file contains the header, the CSV file contains 29 keys and I need to get down to 11. …

Member Avatar for sneekula
0
3K
Member Avatar for harrykokil

hi guys.. hw can i set the position of a scale (slidebar) on screen in tkinter??

Member Avatar for sneekula
0
61
Member Avatar for down with socks

[CODE] def translate(response): """Translates an English word into Pig Latin.""" # Initial lists and strings vowels = ["a", "e", "i", "o", "u", "A", "E", "I", "O", "U", "y", "Y"] consonants = ["b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", …

Member Avatar for down with socks
0
184
Member Avatar for dilipkk

For an application, I need to parse a string which contains urls and their titles. For example: 'name="My Mobile Blog" url="http://caydab565.blogspot.com/" name="Creative Disaster" url="http://kevinlara.blogspot.com/" ...' name means title of url here. I want list of strings which contain both title and url. For example: ['name="My Mobile Blog" url="http://caydab565.blogspot.com/"','name="Creative Disaster" url="http://kevinlara.blogspot.com/"'] …

Member Avatar for Gribouillis
0
130
Member Avatar for besktrap

Hi everyone. I'm having a little trouble trying to understand what argument passing really is. I know that it 'passes' arguments, but what does that actually mean and how can you use it to my advantage? ex: [CODE] def New(spam,n=1): [/CODE] so what does that actually do?

Member Avatar for besktrap
0
117
Member Avatar for PurdueSi

Greetings all, I'm trying to post data to a form on a web page using urllib2. Thus far I've had success however once data is entered in the form and the form is submitted, a second confirmation page is loaded where I need to click an 'OK' button again. Here …

0
45
Member Avatar for harrykokil
Member Avatar for Gribouillis
0
52
Member Avatar for Z8934

I’ve got a piece of third party software containing classes that I want to modify by subclassing. My problem is that one of the third party classes is not accessed directly but returned by the third party class through a method call. So: [code]factory = ThirdParty.Factory() node = factory.getNode() #node …

Member Avatar for Gribouillis
0
156
Member Avatar for harrykokil
Member Avatar for Z8934
0
73

The End.