504 Discussion / Question Topics

Remove Filter
Member Avatar for lewashby

I'M getting error below when I run the following program code. It's with the following function. [COLOR="Red"]fileD.write("%\n" % depot.get())[/COLOR] [COLOR="Red"]Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1413, in __call__ return self.func(*args) File "/home/developer/Projects/Head First/Chapter 7/Head-Ex.py", line 7, in save_data fileD.write("%\n" % depot.get()) ValueError: unsupported format …

Member Avatar for TrustyTony
0
176
Member Avatar for lewashby

I am reading the book "Python Programming 2nd Ed. for the absolute beginner" and I am having some trouble with a very simple program. I was instructed to download and install pygame and the livewires package as I have done. This program is meant to display a grahical window, that's …

Member Avatar for albo1125
0
293
Member Avatar for lewashby

I have a computer split between Windows Vista and Ubuntu 9.10. A friend of mine who has the same configuration update his Ubuntu several months back and found that his Windows partition was unable to boot up. In order to restore his sytem he had to run Windows recover through …

0
84
Member Avatar for lewashby

[CODE]from Tkinter import * import pygame.mixer sounds = pygame.mixer sounds.init() correct_s = sounds.Sound("Correct.wav") wrong_s = sounds.Sound("Wrong.wav") number_correct = 0 number_wrong = 0 def play_correct_sound(): global number_correct number_correct = number_correct + 1 correct_s.play() def play_wrong_sound(): global number_wrong number_wrong = number_wrong + 1 wrong_s.play() app = Tk() # creat a tkinter application …

Member Avatar for SgtMe
0
354
Member Avatar for lewashby

[CODE]app = Tk() # creat a tkinter application window called "app" app.title("TVN Game Show") app.geometry("300x100+200+100") b1 = Button(app, text = "Correct!", width = 10, command = play_correct_sound) b1.pack(side = "left", padx = 10, pady = 10)[/CODE] In the above code, I understand that "app" is my TK() object. But what …

Member Avatar for TrustyTony
0
73
Member Avatar for lewashby

I'M a single parent, 24, and I have a full time job in a factory. That's pretty much killed any change for me to go back to school. I love the computer field and I've been playing around with C# and Python for a little bit and I'M also a …

Member Avatar for libbylab
0
213
Member Avatar for lewashby

I've been trying to find pygame that will work with python 3 on my Ubuntu machine far a while with no luck. I can find a version that will work with Ubuntu but now for python 3, or I can find one that will work with python 3 but not …

Member Avatar for Kruptein
0
125
Member Avatar for lewashby

I am trying to get into the IT field and I'M unable to go to school. Everything I learn is from books I get vie Amazon.com or Books-A-Million. I don't really know anyone in the programming or IT field to whom I can get guidance and direction. Does anyone have …

Member Avatar for Ancient Dragon
0
136
Member Avatar for lewashby

[CODE]def save_transaction(price, credit_card, description): file = open("transactions.txt", "a") # the "a" means you are always going to append to this file file.write("%s%07d%s\n" % (credit_card, price, description)) file.close() items = ["DONUT", "LATTE", "FILTER", "MUFFIN"] prices = [1.50, 2.0, 1.80, 1.20] running = True while running: option = 1 for choice in …

Member Avatar for lewashby
0
109
Member Avatar for lewashby

[CODE]import sqlite3 def find_details(id2find): db = sqlite3.connect("surfersDB.sdb") # grap surfer data from database db.row_factory = sqlite3.Row cursor = db.cursor() cursor.execute("select * from surfers") rows = cursor.fetchall()[/CODE] In the code snippet above from "Head First Programming", the syntax for the database code is poorly explained. Is row_factory a call, method, or …

Member Avatar for lewashby
0
138
Member Avatar for lewashby

[CODE]def find_details(id2find): surfers_f = open("surfing_data.csv") for eash_line in surfers_f: s = {} (s["id"], s["country"], s["average"], s["board"], s["age"]) = eash_line.split(";") if id2find == int(s["id"]): surfers_f.close() return(s) return({}) lookup_id = int(input("Enter the id of the surfer: ")) surfer = find_details(lookup_id) if surfer: print("ID: " + surfer["id"]) print("Name: " + surfer["name"]) print("Country: " …

Member Avatar for TrustyTony
1
250
Member Avatar for lewashby

I know there was a problem with one of the recent Ubuntu Linux updates involving Karmic to Lucid that would no longer allow a Windows partition to load. I have not update my Ubuntu since that update release. Does anyone of if it's safe to update yet? Thanks.

0
65
Member Avatar for lewashby

Could anyone point me to a good C++ compiler for Ubuntu, other than Mono. Note that I was using Visual C++ 6. thanks.

Member Avatar for hyperbyte
0
133
Member Avatar for lewashby

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(), …

Member Avatar for vegaseat
0
98
Member Avatar for lewashby

[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: " …

Member Avatar for snippsat
0
159
Member Avatar for lewashby

[CODE]StreamWriter outFile = File.CreateText ¬ ("output1.txt");[/CODE] In the above line of what, what is File. I see that StreamWriter is a class, outFile is our instance of that class, and CreateText would be a method. But what is the "File." before the CreateText method? Normally when I have created any …

Member Avatar for nick.crane
0
86
Member Avatar for lewashby

I prefer gnome to KDE but I don't know what this is but I thought I might give it a try. If anyone knows what this is and where to get it, please let me know, thanks. [url]http://www.tomshardware.com/gallery/ubuntu-linux,0201--6247----jpg-.html[/url]

Member Avatar for neilnicky017
0
205
Member Avatar for lewashby

I'M using Ubuntu and I'M running python 3. I'M trying to find a pygame download for Ubuntu and python 3. I went to pygame.org and followed the Ubuntu link. I eventually found one link for pygame 1.9, which I'M told works for pythan 3. There were two files, amd64 & …

Member Avatar for griswolf
0
350
Member Avatar for lewashby

I use Ubuntu Linux and I'M running python 3. How do I know what version of pygame to get for python 3? And could someone point me to it? Thanks.

Member Avatar for griswolf
0
122
Member Avatar for lewashby

Recently a friend of mine updated his Ubuntu Linux and then his Windows partition failed to boot there after. I read up on it and apparently a lot of people are having the problem and it has something to do with karmic to lucid, or something like that I can't …

0
66
Member Avatar for lewashby

I know a lot of you out there are probably way to stuck up to consider iTunes, I use to be the same way. I felt that I may lose control over my music files or some other ridicules scare. But when I finally did try it, I absolutely loved …

Member Avatar for JasonHippy
0
88
Member Avatar for lewashby

I just updated Ubuntu and now my Windows partition will not start from within the grub loader. When I select Windows, the screen is black with a white blinking cursor at the top left of the screen. Any help would be greatly appreciated. Thanks.

Member Avatar for JasonHippy
0
62
Member Avatar for lewashby

I'M rather new to Linux and I've just started with Ubuntu. I'M trying to understand the file system. I see that rather than a traditional drive letter like C: , Linux uses a single /. But I guess my real question is, where are programs stored? In Windows they're stored …

Member Avatar for Akira Takano
0
3K
Member Avatar for lewashby

Since I first moved to Ubuntu, one of my biggest complaints is Totem not having any audio, does anyone have any suggestions? Thanks.

Member Avatar for mooreted
0
118
Member Avatar for lewashby

The book I'M reading "Head First C#" is trying to teach my about the use of properties, private vs public. But when viewing the following code, I still don't understand why the program is behaving the way it is. The code shows 5 bags of feed no matter how many …

Member Avatar for jonsca
0
71
Member Avatar for lewashby

I recently uninstalled python 2.6 from my Ubuntu, unbeknown to me at the time, the gnome desktop is reliant on python 2.6. Ubuntu then crashed and now will only load up in Kubuntu KDE. Kubuntu will not let me switch back to Ubuntu gnome, it's not an option. So from …

Member Avatar for JasonHippy
0
132
Member Avatar for lewashby

I recently decided to update my version of python from 2.6 to 3.1. At the time I didn't realize that the gnome desktop relied upon python 2.6. In the middle of py 2.6 un-installation, Ubuntu crashed, when it reloaded I could only use Kubuntu KDE. I would just try to …

Member Avatar for JasonHippy
0
135
Member Avatar for lewashby

I'M reading the book "Beginning C# Game Programming by Ron Penton". The book is instucting me to create a small framework for a game, the problem is, the book was written for VS 2002 and I'M using VCs 2008 express. I'M instructed to add references to the project, two of …

Member Avatar for Gospp
0
318
Member Avatar for lewashby

I've had KDE for a while but I didn't like it as much to I stuck with gnome. Today I updated my gnome and a while later I decided to un-install python 2.6 and replace it with 3.0. I noticed that un-install was going really slow. Then my computer suddenly …

Member Avatar for JasonHippy
0
145
Member Avatar for lewashby

In the code below I can't understand the line [COLOR="Red"]List<Surface> sfcStars = new List<Surface>();[/COLOR] What's going on here, and what are "<>" those doing in the code, I've never seen the before. I got this code from [url]http://www.tuxradar.com/beginnerscode[/url] [CODE]using System; using SdlDotNet.Graphics; using System.Collections.Generic; using System.Drawing; namespace TroutWars { class …

Member Avatar for apegram
0
122
Member Avatar for lewashby

[COLOR="red"]Dog[] dogs = new Dog[7]; dogs[5] = new Dog(); dogs[0] = new Dog();[/COLOR] According to the book I'M reading the second two lines here create instances but the first only creates an array. I'M still learning how to program but it looks to me like the fist line is also …

Member Avatar for apegram
0
141
Member Avatar for lewashby

First off, I did google this before hand but most of the answers I got were about assigning attributes, but that's the the trouble I'M having. I'M trying to understand the "this" keyword beging used as a parameter/argument. Here some sample code There is a class by the name Elephant. …

Member Avatar for Szpilona
0
116
Member Avatar for lewashby

In the code below, I'M having trouble with one line of code [COLOR="Red"]MenuMaker menu = new MenuMaker() { Randomizer = new Random() };[/COLOR] The program is a simple windows Form with two main files, Form1.cs & MenuMaker.cs, the second one is a class. What I'M trying to understand is why …

Member Avatar for apegram
0
185
Member Avatar for lewashby

I'M reading this tutorial at [url]http://www.tuxradar.com/beginnerscode[/url] at all I have done thus far is enough for an empty game window built with two small .cs files. Here are the error messages. [COLOR="Red"]Line=15, Column=72, Type=Error, Priority=Normal, Description=An object reference is required to access non-static member TroutWars.MainClass.Quit(object, SdlDotNet.Core.QuitEventArgs)'(CS0120)][/COLOR] & [COLOR="Red"]Description=`System.EventArgs' does not …

Member Avatar for lewashby
0
113
Member Avatar for lewashby

Running Mono on Ubuntu 9.10 Main.cs [CODE]using System; using SdlDotNet; using SdlDotNet.Core; using SdlDotNet.Graphics; using System.Drawing; namespace TroutWars { class MainClass { public static void Main(string[] args) { Video.SetVideoMode(1024, 768); Events.Quit += new EventHandler < QuitEventArgs > (Quit); EventArgs.Run(); } void Quit(object sender, QuitEventArgs e) { Events.QuitApplication(); } } }[/CODE] …

Member Avatar for lewashby
0
1K
Member Avatar for lewashby

I'M trying to build a simple Console.WriteLine program in mono. It build with no errors but there is not output for what I have coded it to say. All I'M getting is ---------------Done---------------- Build Successful. Thanks.

Member Avatar for ddanbe
0
86
Member Avatar for lewashby

I'M reading "Head First C#" In this book I was told that when you want to create a float that you need to add an "F" to the end. float myFloat = 14.6F; But the very first thing you type is "float", isn't that enough?

Member Avatar for ddanbe
1
108
Member Avatar for lewashby

I installed wine on my Ubuntu 9.10 and tried to run the 1998 game Thief. Everything started but the sound started to deteriorate winthin seconds until it was completely gone. Does anyone have any ideas? Also, I noticed in the Wine menu that you can choose the version of Windows …

0
68
Member Avatar for lewashby

I recently learned about a good media player for Ubuntu called Songbird. I downloaded the .tar.gz file from [url]http://www.getsongbird.com/[/url], and unloaded it to my desktop. I read from one of the post on the site that I needed to move it to my home folder and just click on the …

Member Avatar for JasonHippy
0
134
Member Avatar for lewashby

I have a desktop with no monitor and a lap top. I've purchased a cable to connect from the back of my desktop to my laptop so I could have access to my desktop, but I don't know how to make my laptop display the contents there in. Thanks for …

Member Avatar for caperjack
0
63
Member Avatar for lewashby

I have a desktop with no monitor and a lap top. I've purchased a cable to connect from the back of my desktop to my laptop so I could have access to my desktop, but I don't know how to make my laptop display the contents there in. Thanks for …

Member Avatar for techsheaven
0
65
Member Avatar for lewashby

I have a little programming experience and I'M just getting into Linux. I was wondering, how big of a deal would it be to convert some of your old classics like Half-Life and Tomb Raider from Windows to Linux? Sorry to ask such a stupid question on such a technical …

Member Avatar for khakilang
0
93
Member Avatar for lewashby

I'M wanting to get a new computer, not a typical computer from Wal-Mart or BestBuy. I want to run Linux, Windows 7, and Windows 98. Since this will be a desktop I can add new hard drives as I see fit, but here's my question. What's the best way to …

Member Avatar for caperjack
0
167
Member Avatar for lewashby

I'M trying to edit my back.bashrc file with the following aliases, but it want let me save it, only Save As. Also, I don't really know where in the file I could place these lines. [B]alias rm-'rm -i' alias cp='cp -i' alias mv=mv -i'[/B] Thanks

Member Avatar for khess
0
82
Member Avatar for lewashby

I'M currently running Vista but am trying to move at least 90% of my computer usage to Linux so I've download Ubuntu. So I burned the ISO to a CD and now I need to know how to install it but give it a separate bigger partition than my Windows. …

Member Avatar for petraarkanian
0
110
Member Avatar for lewashby

[url]http://ironpython.codeplex.com/releases/view/12482[/url] I'M running Ubuntu 9.10. On the website above, what which download should I use? I don't see a debian so I'M assuming I need to get the bin. If that's the case, I have no idea how to install a bin. Thanks for any and all replies. Wait, it's …

Member Avatar for JasonHippy
0
109
Member Avatar for lewashby

I'M new to Linux & Ubuntu. I know I could just install Open Office through the Ubuntu Software Center or the Package Manager but I wanted to do it manually. So I download the debian package from [url]www.openoffice.org[/url] and unzipped it. Now I have a folder on my desktop lapeled …

Member Avatar for necrolin
0
305
Member Avatar for lewashby

I'M reading a book on C#, here is some of the code. [CODE] public BitterCritter(): base("", 2, 2, 0){}[/CODE] I see that you can specify what attributes the child class inherits based on it's parent class through parameters. But what if you specify the base class but insert no parameters? …

Member Avatar for apegram
0
96
Member Avatar for lewashby

I'M reading the book that's in the title. Let me show you what's going on. I'M given the following code, an example of Inheritance. [CODE]using System; namespace CritClone { class CritViewer { static void Main(string[] args) { CritViewer cv = new CritViewer(); }// end main public CritViewer() { Clone myClone …

Member Avatar for apegram
0
146
Member Avatar for lewashby

I want to run my programs in a traditional Dos based screen as opposed to the new text page that it's running in now. Does anyone know how I can do that? Thanks.

Member Avatar for jonsca
0
543

The End.