- Strength to Increase Rep
- +6
- Strength to Decrease Rep
- -1
- Upvotes Received
- 12
- Posts with Upvotes
- 12
- Upvoting Members
- 7
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
- Interests
- Love to bake, read, write, and play video games.
- PC Specs
- Ubuntu Linux
Is it possible to store a certain function as a variable? If not, is it okay to make a class, and define a function. Store the class as the variable and invoke that function? |
|
I am making a text adventure and would like the command line window to be a specific size when you run the .py file in the command line window. eg. 300 wide by 250 height. I found a thread on here that shows how to specify the text colour which … |
|
Hey guys, So me and my friend are starting up a simple Text-Based-Post-Apocalyptic-Role-Playing-Game. Both of us have had 2 or so months of experience, we are no experts. So, I will appreciate any tips. I have been lurking these forums for a little while now, and decieded this is the … |
|
Hey guys...Need some help with a program for class...here's the assignment If your program detects an error condition, you can make it raise an exception. Here is an example that gets input from the user and checks for the value 17. Assuming that 17 is not valid input for some … |
|
[B]Ah! Never mind! I forgot you could embed classes such as:[/B] [code]class Heroes(): class Lords(): class Phill(): hp = 25 >>> Heroes.Lords.Phill.hp 25[/code] ------------------------------------------------------ I am attempting to write an RPG in Python. I am not worrying about the battle system or mapping quite yet, and am more focused on … |
|
|
|
[code]def main(): splash() wordTotal = 0 longestWord = 0 fin = open("constitu.txt") for line in fin: #n = fin.readline() wordLine = line.split() #word = wordLine.split() wordTotal += len(wordLine) #if len(word) >= 15: #longestWord += 1 #print word print "This constitution has ",wordTotal, " words." def splash(): print "This program is … |
|
I have python 2.5.2 on my Debian system n want to upgrade it to python 2.6. Got to know that apt-get install package searches for package in /etc/apt/sources.list I have downloaded python 2.6.2. How to add an entry to the file /etc/apt/sources.list ? :( |
|
I have a set of text files in a folder. I want to read each file, convert the contents of the file to lowercase, remove punctuations and save them all in another directory with the same filenames. How can i do that??? |
|
This is used for finding the roots of a parabola. The parabola must have a number in front of x2 (x squared), a number in front of the single x, and a following number, or you can have a perfect square parabola. (in the form "number x2 - number") This … |
|
Please UNsubscribe me! Your site loops endlessly when I try to UNsubscribe. Please UNsubscribe me! Before I have to curse my way out of here. Please UNsubscribe me from all things Python! Thanks! |
|
My friend downloaded Unity3d to get started in 3D game development for our site; but found out it costs. We are tight on budget and need a free solution for the time being. Thankyou so much for your help. |
|
out = open ("output.jh") towrite= a+b out.write (towrite) When you want to put an output to a file. instead of the information going right next to eachother how could they go one over the other in the file. This would be for many different outputs. |
|
Hello, Im failing to crack the messege" XWUFTOSNWHCFGIBWYATYJIB" which is the solution to the question " What do you call an old hen that makes annoying noises?" Please help me solve it. Kindest regards Softbrianes |
|
Is it possible in python to open all files in a directory? this only opens a particular file: [CODE]import os path = "/Desktop/directory/file.odt" temp = os.system("open " + path)[/CODE] how about this? am i doing it right? [CODE]import os mypath = "/Desktop/directory" temp = os.listdir(mypath) temp = [os.path.join(mypath, i) for … |
|
|
Hi all this is my code :- [CODE]import pygame from pygame.locals import * from sys import exit from random import * pygame.init() screen = pygame.display.set_mode((640, 480), 0, 32) while True: for event in pygame.event.get(): if event.type == QUIT: exit() screen.lock() for count in range(10): random_color = (randint(0,255), randint(0,255), randint(0,255)) random_pos … |
I need to check for floating point numbers inside my class but it doesn't seem to be working. Any suggestions? [CODE] class Rectangle: def __init__(self, length = 1, width = 1): self.__length = length self.__width = width ##Setters to float def set_length(self, length): self.__length = float(length) try: #self.__length = float(length) … |
|
I've built my fair share of computers and figured it was time to learn to take advantage of that hardware by learning to program. So I'm taking some courses online. I'm having some issues writing some programs though, so any help would be appreciated. Right now, I'm stuck on this … |
|
[B][I][U]Introduction[/U][/I][/B] Hey guys today I am writing a tutorial on Lists and tuples in Python.... So lets get started... [B][I][U] Layout:- [/U][/I][/B] 1.What are data sturctures? 2.What are tuples? 3.What are lists? 4.inbuilt functions on lists and tupples [B][I][I][U] What are Data structure?[/U][/I][/I][/B] Anybody familiar with programming or Actually Computers. … |
|
I have recently redid an earlier version of my version of Pong. However, I am having a slight issue with it. Whenever the ball hits the opposing paddle and then hits the bottom, the ball travels along the bottom until the player paddle hits it. I have tried for days … |
|
Why do people say isinstance is bad? If I have my own class, named Test, and if I want to check an variable to see if it is an instance of Test or Test's child classes, is using instance() bad? |
|
A small story in the context of the rest of the world is the UK Government's call for the banning of forthcoming computer game, [URL="http://www.medalofhonor.com"]Medal of Honor[/URL]. British Defence Secretary [URL="http://http://www.liamfox.co.uk/text.aspx?id=1"]Liam Fox[/URL] has called for the ban because unlike its predecessors the game is set in Afghanistan, where of course … |
|
how do i print the 3 most common word that begins with capitals? also how do i count how many times they appear? |
|
According to the book I'M reading clock = pygame.time.Clock() creates a new clock object. But when I took a look at the time module, I didn't find a class by the name of Clock so I could I have an object? All I found was a function and it was … |
|
Hello. I am a n00b learning to code in Python. Right now, I am working on functions and parameters. To practice, I am making a simple Celsius-to-Farenheit converter. However,whenever I run the program it returns a NameError. I am confused in my n00bishness. Please reply. Here is my code: [CODE]>>> … |
|
hello every one for example ıf we say a=None if is it same thıng ? ===> if a orrrr if a is None and the reaction of the code is it same thansk ın advance |
|
""" Hi i intended to list the built-in function using this function. It seems however to give me the results corresponding with a dictionary. Why is that ? """" [CODE] def showbuiltins(): """ saves the list of built in functions to a file you chose """ blist = dir(__builtins__) print … |
|
Let's say I have my own installer for a product that uses a lot of other components. One piece of my product is a python script. However, most of my end-users don't have python installed already. Is there any way I can include the python installer as part of my … |
|
[CODE]import pygame from pygame.locals import * from sys import exit from random import * pygame.init() screen = pygame.display.set_mode((640, 480), 0, 32) while True: for event in pygame.event.get(): if event.type == QUIT: exit() screen.lock() for count in range(10): random_color = (randint(0, 255), randint(0, 255), randint(0, 255)) random_pos = (randint(0, 639), randint(0, … |
|
Hey, I've been not so active for the past months, but that's because I was working on a litle project called Deditor. It's a text-editor for linux. The thing that makes it special is that it is made for python and thus has some python-specific features like, syntax-highlighting, interactive interpreter, … |