15,190 Topics
![]() | |
I can't determine how to randomly list horses as they cross various parts of the track. Will someone please point me in the write direction? [CODE]if bet > 1: #starts the race, if bet when bet is placed print (""" Here come the horses now, folks. They're being loaded into … | |
Hi, I've tried searching around for other problems similar to mine, and I was unable to find any. I seem to not be able to "color" text in a TextCtrl widget on Windows, but I can on Linux. I have a little screenshot and some code to show this: [URL="http://i189.photobucket.com/albums/z266/Capn_Soul/WinLinuxDifference.jpg"]Screenshot[/URL] … | |
Hi, I'm trying to color some text with wxPython but I am having some trouble. I am using the SetStyle method of the TextCtrl widget. My problem is that the coloring works perfectly on Linux but does not under Windows. My script basically gives a vocabulary test, and if you … | |
In the following program I have a few questions. [B]results.txt[/B] Johnny 8.65 Juan 9.12 Joseph 8.45 Stacey 7.81 Aideen 8.05 Zack 7.21 Aaron 8.31 [CODE]scores = {} result_f = open("results.txt") for line in result_f: (name, score) = line.split() scores[score] = name result_f.close() print("The toop scores were:") for each_score in sorted(scores.keys(), … | |
[CODE]line = "101;johnny 'wave-boy' Jones;USA;8.32;Fish;21" s = {} (s['id'], s['name'], s['country'], s['average'], s['board'], s['age']) = line.split(";") # above, why is "s" and the end of the key list surrounded by parenthesis? print("ID: " + s['id']) print("Name: " + s['name']) print("Country " + s['country']) print("Average " + s['average']) print("Board type: " … | |
hello, I'm rather new to python, and I'm trying to make a simple macro program, i have the mouse setup but duplicating the keyboard actions is a giving me a bit of trouble. the website I'm using isn't for python but i found it for a reference: [url]http://www.codeproject.com/KB/system/keyboard.aspx[/url] I found … | |
Let's say I want to create two classes Owner and Pet [CODE]class Owner(object): def __init__(first_name, last_name, address, phone): self.first_name = first_name self.last_name = last_name self.address = address self.phone = phone class Pet(object): def __init__(name, owner) self.name = name self.owner = Owner.__init__(first_name, last_name, address, phone)[/CODE] Did I pass the class Owner … | |
Here is my issue: I have a program, that downloads roms off the internet. Everything works fine, but I would like to show an indefinite progress bar while it is downloading. I have that with the following code: [code] # -*- coding: utf-8 -*- # Form implementation generated from reading … | |
Hi, I have the following files and can match but, am having trouble with getting the output to write correctly to a data matrix format that I need and would appreciate any help with getting the code right. File 1 has a list of numbers and Files 2, 3 and … | |
Hi every one, I am using some tools for reverse engineering for Python code. I want to Reversing Sequence diagram for my Python code but I can't get Sequence diagrams, only get class diagram. Can you help me? I am using Visual paradigm 8 and Enterprise Architect. If you used … | |
This is a section of a program I made that keeps track of some money I'm saving. :cool: When I enter how much I want to add it saves what I enter to a file and updates the current amount I have saved, also in the file. When I enter … | |
Hello everyone, I am making my thesis in the university using Python as programming language and Django as framework, I have doubts about choose data from de models class, for example I have the class Tribunal, and I am able to generate an Excel with all the objects of that … | |
I have been thinking about order operations and generalized * in Python recently. I want to share some of my thinking here, even the topic is quite theoretical, considering the beauty and orthogonality of the language. [B]Point one[/B] You can do comparison with tuples of numbers in Python [CODE]>>> (0,0)<(1,1)<(2,2) … | |
I am trying to sort a file by a quick sort comparison. The problem lies in parsing the string and comparing fields. I use the following to break up a line: records = [line.split(spl) for line in file(filename)] and the following to sort: records.sort( lambda a,b: cmp(a[fieldNo],b[fieldNo]) ) This works … | |
I'm testing to get my python script to still run if the smtp server it uses went down. I have a local mail server im testing this with. The issue is when testing it, i get a large spew of text. It checks all its libraries and such, untill its … | |
I am beginning to write a tkinter program that will generate a DnD 3.5 Character Sheet. I haven't gotten very far. I'm using Python 3, and for some reason the sticky option of the .grid() method isn't working. When I run the code below, I get an error that says: … | |
Hello, pls can somebody have a look at my script and tell me why I can't get a value from d1? (print d1). Thank you for help. here is a script: [CODE]def subtract(): d1=file1(filename) dd2=file2(filename) res = dict() print d1 ## for key in d1: ## if key not in … | |
I suggest it's just a simlpe tiny thing that has to be done to solve this but I simply can't figure it out! I hope anyone can help me. Here's what I koppied from a learnbook for python. >>> secret = 1337 >>> guess = 0 >>> l = 0 … | |
Say I have a file structure that looks like this [CODE]root folder/ main.py -folder a -script.py -folder b -img.png[/CODE] How could I load the img.png file from script.py? Should I just have a function in main.py that gets the path of the root folder, and then tac the 'folder a' … | |
Hi all , I'm new here and new in Python for symbian ; I hope I'm asking in the right forum and the right section. What python provides to switch off mobile functions that consumes battery , How turn off BlueTooth , Wifi , GPRS , Vibration and Ringing ?? … | |
Do you know that there is clean way of doing what C-language ternary operator ? does in Python's recent versions. It is if with special twist. The syntax is: [CODE]'The value if true' if <condition> else 'Value when false'[/CODE] Values can be any type. You can put this structure to … | |
Hallo ... I am very new to Python programming & I have this Question ... I am asked to write a program to calculate the No. of words & the length of each (letters) in this sentence : (An Oligonucleotide is a short segment of RNA or DNA, typically with … | |
I have just started learning python, I am a Java programmer. I think python is more simple than java. What I wanted to ask is, where is python used? And if python does not follow the complete OOP concepts, then can it be used to design large / major applications? … | |
hi everyone, I have a tiny problem with a simple implementation: - i have a main window with a table in my central widget - i want to add stuff in the table gradually, and I allow only the 1st cell (index 0) of each row to be selectable. - … | |
I want to improve my programming skill and decided to build python wrappers over other library's. I've done this with the face recognition and think it would be real world code for me to work on. I want to code as a career and I want to code stuff programmers … | |
Hi, i'm new to Python and i'm currently following the "How to Think like a Computer Scientist" tutorials. I'm at Chapter 4: Conditionals and doing the last exercise where i need to create six colored houses on a black background. I've successfully created the house at the bottom left, but … | |
Alright i need help computing random dates and i have to use lists. this is what the program should do program must print out the following output: 1. The complete list of birthdays that you generated. 2. The birthday that was generated twice (printed separately from the list). 3. The … | |
Hi. I have a wxRichtextCtrl (although plain text is fine if I can find a way to do this), and I would like to return the last word typed while the user carries on. You know that way MS Word and OpenOffice etc, highlight a wrongly spelled word as soon … | |
Hi, The below code extracts the branch number and the test environment to deploy that particular branches build on from a txt file (branch_dest.txt). Then it parses HTML pages to reach a webpage which contains some checkboxes. I want to check the "Select/Deselect All" checkbox and then click the "Deploy" … | |
So, I'm not sure if this is possible, but I'm in a situation where I need to do such or something similar. I'm designing a multi-level game, where the game goes on to level 2 once the player comes into contact with the door at the end of level 1. … |
The End.