15,190 Topics

Member Avatar for
Member Avatar for aprilcrash

Hi. I´m writing my first python program - a text adventure game. I want to have a list of possible things a dog could eat, what´s bad about them, how bad they are. So, I thought I´d do this: badfoods = [] keys = ['Food','Problem','Imminent death'] food1 = ['alcohol', 'alcohol …

Member Avatar for TrustyTony
0
291
Member Avatar for sofia85

Hi, I have a big text file (2 GB) with 4 columns looking like this: C START END A 1 10583 10583 0.14 1 10611 10611 0.02 1 13302 13302 0.11 I also have another file where I have extracted a string of information and if this string matches col1:col2:col3 …

Member Avatar for macanohost
0
186
Member Avatar for jdm3

Hello, I'm new with Python and running into an error trying to print data I have retrieved from a database. The code works but there are characters being printed with it that are not displayed in the database...here is my current code: con = mysql.connect(host="silo.soic.indiana.edu", port=3306, user="XXXXXXX", passwd="XXXXXX", db="XXXXXXXXX") cursor …

Member Avatar for TrustyTony
0
257
Member Avatar for neo_31591

(<type 'exceptions.NameError'>, NameError("global name 'MenuPage' is not defined",), <traceback object at 0x028BEC38>) The MenuPage contains buttons to All functions of the PDF shuffler software. This is one such function which retirieves Information about the PDF files. Problem is, It executes once, goes back to MenuPage , then again if i …

Member Avatar for TrustyTony
-1
308
Member Avatar for Yoink

Hi, I have a program that deals with stacks and queues in python. Part of the program compares items in 3 stacks that contain objects. The loop will run and compare all items in the top of the stacks and pop the item that has the highest value and appends …

Member Avatar for scudzilla
0
264
Member Avatar for how_too

Objectives: • Use an object with a list • Use a list of objects Write a class that encapsulates data for a sales person. Class SalesPerson has an ID number (int), a name (string), and a list of sales (float). It provides a constructor __init__ that initializes ID and name, …

Member Avatar for Lardmeister
0
237
Member Avatar for Kirielson

Hello, I am trying to implement a version of the cubic spline based on the artilce here: [Click Here](http://en.wikipedia.org/w/index.php?title=Spline_%28mathematics%29&oldid=288288033#Algorithm_for_computing_natural_cubic_splines) and while implementing it I find errors that my indices are out or range such as: ` h[i]=(n[i+1]-n[i]) IndexError: list index out of range ` Here's a part of the code: …

Member Avatar for Kirielson
0
328
Member Avatar for 4evrmrepylrning

A while ago I created a PHP application that looks at xml files. I have now been tasked with converting this to Python or Django or Turbo gears(anything as long as it's Python something). I am new at Python and while I have played with Django a bit I have …

0
164
Member Avatar for straylight

I am having some problems working with the tell method when working with a file. Basically what I am trying to do is use the tell method to find where I currently am within a paragraph and to only display the characters up to a certain tell count. For example: …

Member Avatar for TrustyTony
0
286
Member Avatar for jtaylor-bye

Hi all. I am a newcomer to python and I am teaching myself from books, videos and on-line tutorials. I currently have a basic script I am working on (can't post the code right now as I'm away from my laptop), and I cannot figure out how to do what …

Member Avatar for jtaylor-bye
0
100
Member Avatar for ckugblenu

We have learnt programming concepts with python and have now acquired the skill. What are the stuff we can go in and what areas are awesome to be in. Need help

Member Avatar for m1raEbrah1m
0
120
Member Avatar for jdm3

Hello, I'm currently working on a Python CGi program. This program takes a zipcode in a form and interacts with a website to obtain information on the Congress representative for that district. My question is, certain zipcodes have multiple representatives, and I want to make a page with radio buttons …

0
84
Member Avatar for memomk

hey i have this code when starting the Process to make database it freeze at all what should i do? # -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: _fromUtf8 = lambda s: s class Ui_Dialog(object): def setupUi(self, Dialog): Dialog.setObjectName(_fromUtf8("Dialog")) Dialog.resize(400, …

Member Avatar for memomk
0
2K
Member Avatar for imperialguy

Platforms: Windows 7/Mac OS X ActiveState Python 2.7.2 Installed docx on Windows 7 at D:\Program Files (x86)\Python27\Lib\site-packages. Installed docx on OS X at /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages Following is the sample script (named as docx_example.py), which runs absolutely fine on the python interpreter: #!/usr/bin/env python ''' This file makes an docx (Office 2007) …

Member Avatar for memomk
0
626
Member Avatar for strongguy12345

Hello to all, haven't been on here in a while but recently been having major problems with trying to finish this second problem set my teacher has given me and the other students for the gr. 12 ics college coarse, currently im gr. 11 but this coarse had to be …

Member Avatar for strongguy12345
0
327
Member Avatar for lfmconsummates
Member Avatar for minimee120

Hi all I need help with the final part of my practice problems for class, if anyone who can show me what to do it would be greatly appreciated!! Write a program that incorporates the following functionality: 1) Prompt the user for a series of names and scores. 2) Store …

Member Avatar for Lardmeister
0
258
Member Avatar for lisa92222

Hello, can you pls correct my answer to this question for the Python CGI part because Im really not sure if im doing it right. Thanks a lot! ![116](/attachments/large/3/116.JPG "116") ![28](/attachments/large/3/28.JPG "28") Python CGI part ---------------- #!/bin/python import cgi,string def generate_page(): print "<HTML>\n" print "\t<TITLE>Welcome</TITLE>\n" print "</HEAD>\n" print "<BODY BGCOLOR …

0
57
Member Avatar for learned1

I am making a game as a programmer that has only worked with python for about 2 months, and I need a way to save data. I know about pickle, but the Documentation does not help at all. Please note that I am using 3.1.1, so don't give me answers …

Member Avatar for hughesadam_87
0
175
Member Avatar for vmars

I'll try to start over again: Windows7, Python3.2.. When I click on a *.py file it starts up the python.exe interpreter in interactive mode. What I want it to do, is to RUN the *.py file. Please, how can I accomplish this. A *.py file is associated with python.exe . …

Member Avatar for vmars
0
2K
Member Avatar for vmars

Greetings, I installed python3 on win7, and I would like to run the turtleDemo.py . But can't seem to get it going. Can anyone help? Thanks...vm

Member Avatar for vmars
0
2K
Member Avatar for kalookakoo

[CODE]def scoreScreen(): #Keeps Calling score = 999999/canvas.data.timer canvas.create_rectangle(0,0,1000,460, fill = "black") canvas.create_text(500,200, text = "Your Score was", font = ("Comic Sans MS Bold", 20, "bold"), fill = "Red") canvas.create_text(670,200, text = str(score), font = ("Comic Sans MS Bold", 20, "bold"), fill = "Red") canvas.create_text(500,400, text = "You have beat the …

Member Avatar for jemnbuckeye
0
4K
Member Avatar for kur3k

Hi, sorry but my english is not excellent. I create app on QSystemTrayIcon, i want get all event ( mouse, key ). How? My code under, but how connect to this event? def keyPressEvent(self, event): result = QtGui.QSystemTrayIcon.keyPressEvent(self, event) return result def mousePressEvent(self, event): result = QtGui.QSystemTrayIcon.mousePressEvent(self, event) return result

0
67
Member Avatar for Twin802

I would like this code to be changed so that whenever I change the line the line will still be a wall... slin1_1 = 320 slin1_2 = 0 elin1_1 = 320 elin1_2 = 200 strtlin1 = (slin1_1, slin1_2) endlin1 = (elin1_1, elin1_2) lin1sz = 1 #creates first line above ^ …

Member Avatar for Twin802
0
227
Member Avatar for fishsticks1907

def bubble_sort(a): for i in range(0, len(a)): for j in range(0, len(a) - 1): if(a[i] < a[j]): a[i], a[j] = a[j], a[i] #can someone explain this part of the code for me #i tried doing (im more of a c++ programmer): temp = 0 temp = a[i] a[i] = a[j] …

Member Avatar for TrustyTony
0
247
Member Avatar for SpiritualMadMan

The documentation for the textEdited signal shows the use of a required parameter const QString& void textEdited (const QString&) I am unable to get the Signal to work. Perhaps because I do not understand how to use the "const QString&" Is this a literal copy into the parameter or is …

Member Avatar for Lardmeister
0
411
Member Avatar for margreet

HI there, I am a total newbee and looking for someone who has time to give me some extra python lessons. For my pre-master I need to wrap up this course. There is a small amount of compensation available. I live in Amsterdam (NL). Please let me know on short …

Member Avatar for woooee
0
149
Member Avatar for Twin802

**I would like the player after he/her makes it to the end of the map to go to the next level. Here is an example of a code that I would like you to change so the player will close and open another level... blah = unimportant coding and whatever …

Member Avatar for Twin802
0
103
Member Avatar for jdm3

zipc = "47408" url = "http://watchdog.net/us/?zip=" conn = u.urlopen(url+zipc) content = conn.readlines() for line in content: line = line.decode("utf-8") So I am working on a CGI/Python project that requires input of a zipcode to then find the name of a certain politician. Right now I am trying to find a …

Member Avatar for jdm3
0
214
Member Avatar for moroccanplaya

can anyone tell me how should i go about hiding messages in whitespaces in the end of a text for example | = whitespace hell my name is bob|| i work at home ||||

Member Avatar for ZZucker
0
201

The End.