User Profile
Collapse
-
How to create a menu using pyqt?
Hi does anyone know of any tutorials on PyQt to do with the basics of a branched menu. I'm after an overall design so that the main menu would include buttons linking to new windows enabling the user to perform a few routine tasks. -
List indices must be integers, not str
Right I'm having a spot of trouble with integer and string values when reading from a '.txt' file.
The aim is for the programme to read in from a file containing code similar to this...
A;Ed;Young;e.yo ung@msn.com;223 376;1;0;1;0
When running I receive this error code...
...Code:TypeError Traceback (most recent call last) C:\Users\Anon\Programming Coursework
-
Thank you again for a hasty response.
I've just tested the first code and this works perfectly.
I was unsure about the second method though...
If you could just explain...Code:# # or for ctr, memb_class in enumerate(l): print("checking names", memb_class.forename, forename) if memb_class.forename == forename: del l[ctr] break -
Thanks for the reply.
Ideally in the "new_player function" I want to add a set of objects to the class and move away from the list of attributes. We've only just touched on classes and objects so I'm still pretty new to it.
The same goes for the delete function. Ideally I want the function to be able to input a specific object i.e. (First Name + Surname or a Unique I.D), and then delete all objects relating to...Leave a comment:
-
How to delete strings from a list
Right I've come across another problem in my coursework and cant seem to find anything similar in my lecture notes.
The aim of the definition is to delete a string (i.e. an entire player) from a list (i.e. my list of members) based upon search criteria, such as the players name.
So far i've only ever deleted single elements from a list not whole strings.
Here's what i've got so far... My code for deleting a player is... -
Thanks for the quick responses guys, Turned out there was an extra new line at the end of the data code.
Much appreciated.Leave a comment:
-
List index out of range
After starting my coursework I've come across the following error code... "List index out of range". I was expecting this to be something very simple that I've done wrong and still imagine it will be seeing as I've written code similar to this before.
The code is designed to turn a list of players/members into separate strings. The code is shown below...
...Code:class Member(object): '''a member'''
No activity results to display
Show More
Leave a comment: