15,175 Topics

Member Avatar for
Member Avatar for Malestryx

Good afternoon, I am currently working on a payroll program for school. I have a question. Here is my code. [ICODE] #Mainline def employee(): global eName global pRate global hWork def Lowest(hoursList): PAYList.sort() lowestPay = hoursList[0] return lowestPay def Highest(hoursList): hoursList.sort() highestPay=hoursList[len(hoursList)-1] return highestPay def Average(hoursList): total=0 for hour in …

Member Avatar for Malestryx
0
164
Member Avatar for Malestryx

Good evening, I am having difficulties figuring how to get my calculations working. Basically, I want my hours to actually be what is typed in under each question, but they are all ones. I could use some help [ICODE] def Employee(): global eName global pRate global hWork def Low(hoursList): hoursList.sort() …

Member Avatar for leegeorg07
0
97
Member Avatar for gabec94

Hi I am trying to write a function [I]password_input(prompt, password)[/I] that will repeatedly ask for a password using the given prompt until the given password is entered. I have testing code, but I am completely lost upon how to do it and where to begin. This is the testing code: …

Member Avatar for Flameass
0
116
Member Avatar for miller4bears6

[B]hey yall[/B] I've been working on this python program for a while and I need some help please. This program consists of classes and functions to make a basic maze. I'm not using Tkinter or any gui's. Just a printout where python does all the calculating. I have three files, …

Member Avatar for jlm699
0
183
Member Avatar for murnshaw

Sorry for the noobish question, but I'm trying to write a function that accepts strings as inputs. Here's what I've got: def backwards(x): word = "x" index = 1 while index < len(word)+1: letter = word[-index] print letter index = index + 1 Whenever I call the function, such as …

Member Avatar for Arrorn
0
1K
Member Avatar for toadzky

I am writing a ping app for my networking class. I have the ping part of the code working perfectly, my issue is in shutting down my "ping" server. If I run it with while True, not even ctrl-C will shut it down till the next ping request. I can …

Member Avatar for vidaj
0
186
Member Avatar for currupipi

Hello everyone! :) I would like to read a xml file in order to return the content as a HTML response. I wonder if i need to parse the XML file or i can read the file as if it were an txt file. I am interested in this second …

Member Avatar for currupipi
0
115
Member Avatar for srk619

can some help me with my film databse code which is below, i need to know how can i allow a single film to be displayed by index and how can i allow a film to be removed by index anyone have any ideas [ICODE][/ICODE] #A list of entries 2 …

Member Avatar for srk619
0
99
Member Avatar for srk619

hey im finding this question quite hard to do can anyone help out. Implement an iterative Python function to generate numbers in the Fibonacci sequence: fib(0) = 1 fib(1) = 1 fib(n) = fib(n − 1) + fib(n − 2)

Member Avatar for srk619
0
143
Member Avatar for dhvl2712

I wrote a simple .py program for [code="python"] def main(): print ("Hello World") [/code] That's it. I saved it as hello.py But when i try to run it I get this error: [code="python"] >>> hello.py Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> hello.py NameError: name 'hello' …

Member Avatar for leegeorg07
0
516
Member Avatar for smcp

So I'm basically completely screwed at the moment. I'm enrolled in a higher level course at my school (an Artificial Intelligence class) despite the fact that I'm new to my major (computer science) and have very little programming experience (just C++, that's all). I was just wondering, has anyone around …

Member Avatar for adam1122
0
102
Member Avatar for tomtetlaw

this is my code: [code=python] #!/usr/bin/env python #==========================================# # Copyright Tom Tetlaw & Shadwick (c) 2009 # #==========================================# import pickle as pk from formatting import * from gclasses import * from gfuncs import * from items import * from objs import * class Actor(object): def __init__(self, name, age, race, profession): …

0
54
Member Avatar for BlueNN

I'm trying to get my little user-input program to recognize that words aren't numbers. Without any logic parameters the program just crashes when you put in anything but a number, I'm attempting to allow the user to try again and put in a number using a while loop, but I …

Member Avatar for adam1122
0
110
Member Avatar for MaQleod

I'm fairly new to python and object oriented programming in general, so I'm having a little trouble figuring out why this doesn't work this is the error I'm getting for the code below: Error: 'str' object has no attribute 'insert' [CODE]filetolist = FileReadToList("test.txt") print filetolist[0] def FileCountLines(s_filename): f = open(s_filename) …

Member Avatar for MaQleod
0
7K
Member Avatar for BlueNN

I've just started in Python and I'm still feeling my way around, I tried to create a quick program to display "Welcome to Python!" without the quotes. The entirety of the code is this: [code]print('Welcome to Python!')[/code] However, when I double-click on the .py file Python opens up for less …

Member Avatar for BlueNN
0
142
Member Avatar for henryxxll

Hey guys: I'm trying to write a python script to execute a Linux program, with several arguments set by the user, like so: [CODE=python] import os variable_input=int(input("Input Number Argument: ")) os.system("/path/to/program"," -argument1 ",variable_input) [/CODE] However, the os.system() command doesn't allow more than one input, so I tried this: [CODE=python] import …

Member Avatar for henryxxll
0
3K
Member Avatar for tlinux

I have several programs written for Python 2.6. When I downloaded Python 3.0 the programs wouldn't run. I'd like to have both versions on my computer and be able to run my 2.6 programs by default. Then, for new programs, I'd like to switch to 3.0. How can I do …

Member Avatar for scru
1
384
Member Avatar for MattDan

Hi, I'm trying to write a program that monitor Internet Explorer events - creating/deletion of the process, loading pages, creating tabs etc. I managed to monitor creation/deletion by using WMI, but I couldn't find a way to monitor the rest of the events. Is there a way to do this? …

0
37
Member Avatar for tomtetlaw

my inheritence isnt working, it says saveAttributes isnt defined: [code=python]#!/usr/bin/env python #==========================================# # Copyright Tom Tetlaw & Shadwick (c) 2009 # #==========================================# import pickle as pk from formatting import * from locations import * from gclasses import * from gfuncs import * from items import * from objs import * …

Member Avatar for tomtetlaw
0
79
Member Avatar for tomtetlaw

i made a file reader but it always returns corrupted: [code=python] def load(charactor): fout = open(charactor + '.actor', 'r') fout.seek(0) actor_type = None attrs = [] for index, line in enumerate(fout.readlines()): if index == 0: actor_type = line.replace('{', "").strip() if index == 1: if line == 'attributes': if not line …

Member Avatar for tomtetlaw
0
84
Member Avatar for tomtetlaw

can someone give me a tut on how to read files like this: [code]charactor { name = "name" race = "human" ## ect.. }[/code] any and all help will be appreciated :)

Member Avatar for lllllIllIlllI
0
68
Member Avatar for akhileus87

Hy all, Firstly sorry for my English. I do one school project where I need to open one app with web page, what is generated with python. This process or app will make calclulation and create models. I created .bat to open this app: C:\\OpenModelica1.4.3\\bin\\omc +d=interactivCorba This works fine, but …

Member Avatar for akhileus87
0
120
Member Avatar for Malestryx

Good afternoon, I have posted a similar question before. I am a Python Newbie. But, I really need some code help here. I am writing a payroll program. Here is my code: [ICODE] employee=[] eName="Employee" pRate="Payrate" hWork="Weekly Hours" while (eName, pRate, hWork)>0: eName=raw_input("\nEnter the employees' first and last name. ") …

Member Avatar for Malestryx
0
101
Member Avatar for Nine Tails

I am trying to create a widget that will display information for a large number of items. This widget needs to have the following properties: 1.) Highlights a line on a left mouse click 2.) Has an accessor function that can be used to retrieve the line number that is …

0
92
Member Avatar for snowfish

hi, i think i should add a password protection for my app.When the application starts, ask the user to enter the password. If the password is valid, the app continues to work normally. If the password is wrong, ask them to enter it again or close the app. if there …

Member Avatar for lllllIllIlllI
0
10K
Member Avatar for vidaj

Hello I'm building my own html parser in python, and have ran into some problems. First off, I'm using python 3, so I can't use the old bundled sgmlparser, or beautiful soup and could not find windows binaries for lxml, so I'm rolling my own. It is for my master …

Member Avatar for vidaj
0
1K
Member Avatar for pythonator
Member Avatar for Malestryx

Good evening, I was wondering how I could set up a loop for the following code that will exit the loop when the person types done. Would the while command work to do that? [ICODE] def hours(): hours = input("How many hours did they work?: ") return hours def payrate(): …

Member Avatar for woooee
0
88
Member Avatar for originalremix

Hi all, New to these forums, i've just started learning python, and for my class i have one question that i have to do that i understand but aint to sure about what exactly is required. "Design, code and test a comp program that reads a character entered from the …

Member Avatar for woooee
0
170
Member Avatar for chaney44145

I am having some problems with python. If I use IE to POST data to a page using a simple form, I get the following [code] POST /automa/auth.php HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */* Referer: http://maroon5/automa/login.php Accept-Language: en-us Content-Type: application/x-www-form-urlencoded UA-CPU: x86 Accept-Encoding: gzip, …

Member Avatar for chaney44145
0
182

The End.