419 Archived Topics
Remove Filter 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 … | |
[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 … | |
[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 … | |
[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: " … | |
Could anyone point me to a good C++ compiler for Ubuntu, other than Mono. Note that I was using Visual C++ 6. thanks. | |
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: " … | |
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] | |
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 & … | |
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. | |
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 … | |
Since I first moved to Ubuntu, one of my biggest complaints is Totem not having any audio, does anyone have any suggestions? Thanks. | |
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 … | |
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 … | |
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 … | |
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 … | |
[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 … | |
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. … | |
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 … | |
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 … | |
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] … | |
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? | |
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 … | |
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 … | |
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. … | |
[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 … | |
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 … | |
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 … | |
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. | |
I'M just getting started with Linux and I'M using Ubuntu. Straight from the CD Ubuntu came loaded with Open Office - Word, Spreadsheet, & Presentation. But how do I get the whole Open Office package? And what happens with the ones already on my system? Do I need to remove … | |
I'M trying to learn to program through Mono. I'M using a book on C#. Although it isn't specifically for Mono, I haven't gotten far into the book and it's a really small example so I don't expect that it has any platform specific code. Please see what's wrong with this … | |
[URL="http://www.mono-project.com/Main_Page"]http://www.mono-project.com/Main_Page[/URL] On that site, what is the difference between to two blocks to the left? They read. Mono [INDENT]An open source, cross-platform, implementation of C# and the CLR that is binary compatible with Microsoft.NET[/INDENT] MonoDevelop [INDENT]An open Source C# and .NET development environment for Linux, Windows, and Mac OS X[/INDENT] … | |
I'M trying to learn to program through C#. The book I'M reading is trying to explain namespaces but I'M failing to understand it. As I understand it, a class is a blueprint for an object and, and a class is just a special block of code. So what exactly is … | |
I'M trying to switch from Windows to Ubuntu Linux. I'M trying to learn how to program and since I am also trying to move to Linux, thought that mono would be a good place for me to start. But I noticed when I installed mono ([url]http://www.mono-project.org[/url]), it said I needed … | |
I'M trying to make the switch from Windows to Linux, or at least make it a 9 to 1 ratio. I mean, I can't completely do away with windows for several reasons. I'M also interested in programming. Now, Linux is suppose to be a much better OS and that seems … | |
I posted a thread labeled pygame, global name "glob" but am unable to resolve the issue so I was just going to ask a few question about the code. Well first of all, I ran it on Windows Vista, python 2.6 and pygame, but I'M not sure what version of … | |
I'M reading "Beginning Game Develpment with Python and Pygame". In the following code, I'M gettin this error in sysfont.py [COLOR="Red"]NameError: global name 'glob' is not defined[/COLOR] [CODE]import pygame from pygame.locals import * from sys import exit pygame.init() SCREEN_SIZE = (800, 600) screen = pygame.display.set_mode(SCREEN_SIZE, 0, 32) font = pygame.font.SysFont("arial", 16) … | |
First of all I'M using Ubuntu and I'M new to it, trying to make the switch. I'M reading a book on Ubuntu but it's a little out of date to the one I'M running. Anyway, the book instructs me to go to > System > Administration > Synaptic Package Manager, … | |
In the following program, what is the "values" function? [CODE]for tank in tanks.values(): if tank.alive: print tank.name, "is the winnter!" break[/CODE] I looked it up using Wing IDE and this is what I found. [CODE]def values(self, arg): """ D.values() -> list of D's values """ return [][/CODE] Thanks for any … | |
In the following program, why do I need to use the name "player" rather than a regular counter like "i"? I ran the program this way and it prints out the last element in players for how ever many player elements are in players. I want to know what's going … | |
In the program below, I have two questions. First, the first object, card1 passes the strings A & c to it's master class. What I want to know is, what do these two strings have to do with the A & c in RANKS & SUITS? If the class had … | |
I noticed when I first got my new Toshiba Satellite that there was some strange behavior with it's keyboard. When typing in a text document, the cursor would just jump to a random position in the text document, and no it wasn't be accidentally touching the touch pad. Then one … | |
I'M 24 years old, a single parent in TN. I've been very interested in programming since I as probably 15, and I've been trying to learn since then. I started out with C++, didn't get far. I would start, give up, and start again. About a year ago I started … | |
In the following program, I have three different comments each after a line of code. Please read those comments to answer my questions. [CODE] # Property Critter # Demonstrates get and set methods and properties class Critter(object): """A virtual pet""" def __init__(self, name): print "A new critter has been born!" … | |
In the following program, the second line in main print [COLOR="Red"]"Printing a Card object:"[/COLOR], is not showing up when I run the program. Could someone please tell me what's going on? Thanks. [CODE]# Playing Cards # Demonstrates combining objects class Card(object): """ A playing card. """ RANKS = ["A", "2", … | |
I have a pretty new Toshiba Satellite laptop. When I first go the thing I noticed that in the middle of me typing something on a text based document that the cursor would jump to some random position in the text document. This of course caused what I was typing … | |
In the following program, why is [COLOR="red"]"Ac"[/COLOR] the first thing that the program outputs? In main, [COLOR="red"]print "Printing a Card Object"[/COLOR] is the first think I see that should print anything. Is it the [COLOR="red"]__str__[/COLOR] method using the rank & suit attributes from the [COLOR="red"]__init__[/COLOR] constructor? [CODE]# Playing Cards # … | |
Does anyone know where I can find some sort of UML (unified modeling language) tool for python? I think it might help me understand OOP a little better, but I don't really know, I just read about UML and that's all I know. Thanks. | |
I've been trying to learn how to program for several years now. I've struggled with everything from C++, C#, to Python, but never got passed simple DOS text based screen programs that were very short. I'M now 24 and I work in a factory. I would love to find a … | |
In the following program, how does the value of [COLOR="Red"]crit_name[/COLOR], end up in the [COLOR="Red"]self.name = name[/COLOR] value? Is it because it's passed to that class and name is the only value in the [COLOR="Red"]__init__[/COLOR] parameter that has no default value? Thanks. [CODE]# Critter Caretaker # A virtual pet to … ![]() |
The End.