15,194 Topics

Member Avatar for
Member Avatar for Nevicar

Hi everyone! I joined these forums about a week ago so I could try and learn more about Python, and thankfully I can say that I have learned a bit. Enough to try and create a Mastermind game, although I'm having trouble with converting the code into Pygame and give …

Member Avatar for TrustyTony
0
286
Member Avatar for seek

I am getting this error PYTHON - TypeError: unsupported operand type(s) [CODE]weekPay = [] names = [] hours = [] wages = [] while True: name = raw_input("Please input yor first and last name or type \"Done\" to continue: ") if name.title() == "Done": break names.append(name.title()) hour = raw_input("Please input …

Member Avatar for vegaseat
0
223
Member Avatar for AdampskiB

In my code they're instructed to enter a width and height. However obviously these will be intergers, but I need to perform checks that they are intergers before they're used. Atm I've got this: [CODE] while True: if width.isdigit() == True and height.isdigit() == True: if width >= 2 and …

Member Avatar for TrustyTony
0
198
Member Avatar for AndresOend

Hi there, I'm writing my first Python script for a(n imperative) programming class at university, and I want to make it a little better. It's meant to be fairly short, 50 lines. I've written the basic 'mechanism' to look at the user input. Instead of simply printing every property of …

Member Avatar for AndresOend
0
40K
Member Avatar for subhra1234

hi everyone,i am just a beginner in python,i am going through "head first programming" and saw about the [B][COLOR="red"]pygem[/COLOR] [/B],but iam unable to install pygem....i already downloaded [B][COLOR="red"]pygame-1.9.1release.win32-py2.5[/COLOR][/B] from pygem site,but at the time of running the set up i am getting a error that it is not compatible with …

Member Avatar for subhra1234
0
292
Member Avatar for Petee.bill

Hi friends! I need to make a function which takes a string, e.g: '(239..247),(467..765)' (corresponding to the coding area of DNA sequence) and return a list with a tuple for each coding part, each with a start and end value. e.g. [(239,247),(267,765)]. Someone has a clue how to start up?

Member Avatar for TrustyTony
0
128
Member Avatar for Sprewell184

Hi guys, I been working on a project that involves in managing a phone inventory for a company. So for this project we are to use classes. For the most part I got everything except two areas of code that I am having trouble with. I have two classes, Class …

Member Avatar for TrustyTony
0
129
Member Avatar for Kitson

Hi, I have data in the form: rpm Torque 1000 36 2000 40 3000 45 4000 50 . . I need to find the torque at a specific rpm. I found numpy.interp() which will give me a linear interpolation, but my tutor said it wouldn't be accurate enough. I found …

Member Avatar for Kitson
0
484
Member Avatar for greenblack

How do you get the name of a win32com.client.gencache.EnsureDispath name? For example, I have an application named "xxxxx", and the Python object browser detects it when I use makepy.py. How do I get name like "Excel.Application"?

0
47
Member Avatar for cocobun31

[CODE]tomorse ={ 'A': '.-', 'a': '.-', 'B': '-...', 'b': '-...', 'C': '-.-.', 'c': '-.-.', 'D': '-..', 'd': '-..', 'E': '.', 'e': '.', 'F': '..-.', 'f': '..-.', 'G': '--.', 'g': '--.', 'H': '....', 'h': '....', 'I': '..', 'i': '..', 'J': '.---', 'j': '.---', 'K': '-.-', 'k': '-.-', 'L': '.-..', 'l': '.-..', …

Member Avatar for TrustyTony
0
456
Member Avatar for monica23

Good day everyone, I need to print data using if-elif statement. I when I run this code like this, everything went well [CODE] if row['username'] == 'mutago': print " okay" sys.exit(0) else: print "wrong" [/CODE] OKAY now i want to include elseif statement to print another data but it returns …

Member Avatar for woooee
0
234
Member Avatar for Lukester3

Hey, So I am completely new to python, I was wondering if someone could assist me with this program I am trying to make, The idea is simple, a program that counts for the user. Asking the user to enter a starting number, ending number, and the amount to count …

Member Avatar for Ezzaral
0
195
Member Avatar for adobe71

Is their any way to make an exe from my python files other that py2exe as am getting some problem.And for the same is their any method for linux also.

Member Avatar for snippsat
0
190
Member Avatar for Ismatus3

hello everybody , good day , i just need to insert an image : "BosqueTK.jpg" in a speciale place in my window Tkinter using .place(x= , y= ) , for this i created a frame f2 placed like : [CODE]f2.place(x=130 , y=213) [/CODE] , and want to insert in it …

Member Avatar for Ismatus3
0
221
Member Avatar for hencre

Hi Guys, I'm new to python - how to execute dos2unix from python - subprocess.popen with shell = False ? >>> cmd = subprocess.Popen(["dos2unix","./FEED1/bin/*"], stdout=subprocess.PIPE) dos2unix: converting file ./FEED1/bin/* to UNIX format ... >>> dos2unix: problems converting file ./FEED1/bin/* All help appreciated.

Member Avatar for hencre
0
1K
Member Avatar for chet6

Hi, We are a team of 3 people. We have not worked on Python before.We want to learn python & also develop a small project or software using python,c,shell scripts in LINUX environment. Could someone help us or give information on websites of the projects that we can develop?

Member Avatar for Ismatus3
0
159
Member Avatar for ThemattyC

Im working on my final project for school where i have to uses arrays to store the first year of energy costs, the second array will store the second year after going green, and the third array will store the difference. I have pretty much all the code written out …

Member Avatar for TrustyTony
0
166
Member Avatar for natehome

Hello, im currently taking a python programming class at my high school and we have an assignment to create a falling sand type game using pygame. im totally lost on how to start could someone please help me get started. if you dont know what the falling sand game is …

1
95
Member Avatar for Luis Ventura

Hello, i'm new to this forum and to Python and i want to creat a function that counts the number of words on .txt file, but also that creats a dictionary with it, with the words has a key and the number of referencies to it has a value. Thanks …

Member Avatar for Luis Ventura
0
542
Member Avatar for sofia85

Hi, I have a large file (11 GB), that I want to extract information from. I decided that the file was to big to work with, so I ended up with splitting it into 20 smaller files. Now I don't know what the smartest thing is to do with these …

Member Avatar for sofia85
0
146
Member Avatar for techguy2012

This is python code and I am new to programming and I can't get just the first word of the sentence to capitalize. [CODE] def main(): input= 'the money is in the bag. however you dont want it.' words = input.split('.') capitalized_words = [] for word in words: word=word.strip() title_case_word …

Member Avatar for TrustyTony
0
281
Member Avatar for carmstr4

Hey guys, Is it possible to change the color of characters in a list if they do/dont meet certain conditions? So here's my code: [CODE]def checkWord(real, guess, remReal, remGuess, wrongSpot): # Format the letters so user knows whats wrong/right fullWord= real # Create copy list of real word realWord= list(fullWord) …

Member Avatar for carmstr4
0
1K
Member Avatar for Catchamouse

I would like to know how to use [ICODE]system("pause")[/ICODE]from C++ in Python 2.7 to get similar effect. Could you help me?

Member Avatar for Catchamouse
0
5K
Member Avatar for jacob501

[code] from urllib import urlretrieve import urllib2 import re import gzip urlretrieve('http://www.locationary.com/place/en/US/Virginia/Richmond-page28/?ACTION_TOKEN=NumericAction', 'myfile') page = gzip.open('myfile', 'rb').read() findLoc = re.compile('http://www\.locationary\.com/place/en/US/Virginia/Richmond/.{1,100}\.jsp') findLocL = re.findall(findLoc,page) listIterator = [] listIterator[:] = range (0,25) for i in listIterator: urlretrieve(i, 'myfile2') page2 = gzip.open('myfile2', 'rb').read() findYP = re.compile('http://www\.yellowpages\.com.{1,100}\d{1,100}') findYPL = re.findall(findYP,page2) listIterator2 = [] listIterator2[:] …

Member Avatar for jacob501
0
4K
Member Avatar for jacob501

I am trying to use Beautiful Soup to scrape a website, Locationary.com, and get some information from it. I am a member and even when I'm logged in this doesn't work... OK. This first bit of code just returns the HTML of Locationary.com (the home page) in a "pretty" form. …

Member Avatar for Gribouillis
0
199
Member Avatar for Tcll

I'm currently working in another thread to find a better conversion method here's my script: [code] #!BPY """ Name: 'Brawl (.mdl0)...' Blender: 248 Group: 'Import' Tooltip: 'Import a Brawl model file (.mdl0)' """ __author__= ['Tcll'] __url__ = ("") __version__= '0.015' __bpydoc__= '''\ mdl0 Importer ''' # ***** BEGIN GPL LICENSE …

Member Avatar for Tcll
0
2K
Member Avatar for monica23

Good day everyone, i need to display image from the database but the code returns error page when i tried to print image from the database using [CODE] print fout [/CODE] below is the entire codes [CODE] #! /data/python import MySQLdb import sys print ("Content-type: image/jpeg"); print # End of …

0
47
Member Avatar for MazzGonzo

Hi, Basically I want to put my responses for each of the outputs of my loop (answers yes or no to different contrast numbers) into an empty list ... so I would have a list for each contrast corresponding to how many yes or no's there were? [CODE]from observerClass import …

Member Avatar for TrustyTony
0
118
Member Avatar for eceisl

I need to write a recursive Python function that takes a numeric list as its argument, finds and returns the minimum of its elements. I am not allowed to use min() function of Python. I'll be very grateful if someone can help me.

Member Avatar for TrustyTony
0
108
Member Avatar for gorbulas

Hello Having trouble reading in some 8-bit data (not text) from serial port using pyserial module. Am storing the data in a string buffer as it comes in, that's working fine. Problem is that I'm printing the buffer out to the terminal screen, after a wee bit of data (30~200 …

Member Avatar for Gribouillis
0
346

The End.