Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
61% Quality Score
Upvotes Received
3
Posts with Upvotes
3
Upvoting Members
3
Downvotes Received
2
Posts with Downvotes
2
Downvoting Members
2

40 Posted Topics

Member Avatar for Zebibyte

python is a little funky when it comes to certain number calculations. try rounding your answer: [CODE=python]print round(500-499.99,2) [/CODE] this will tell python to get to original answer (0.00999999999999 ), and round it to the second decimal (the second argument in round() is the number of decimals to round to) …

Member Avatar for newbieee
0
748
Member Avatar for jayjay85

What library are you using? This can be easily accomplished in pygame. google something like 'pygame image fade'

Member Avatar for marksman123
0
610
Member Avatar for fallopiano

Hey everyone, as the title suggests I'm trying to find a function or some code that'll execute a string of code in Lua. If anyone is familiar with Python, It would be the eval function. ex: [CODE=python] eval("y=1") print(y) >>> 1[/CODE] Essentially, I'd like to do that same thing in …

Member Avatar for 0x69
0
755
Member Avatar for lewashby

I dont know about livewires, but did you type it all correctly? :p also, if you want todo games in python, i would just learn pygame directly. its powerful yet easy to understand

Member Avatar for albo1125
0
292
Member Avatar for fallopiano

Hey everyone. Just recently I have been messing around with some files on my pc, trying to find a specific driver updater-program that was giving me some trouble. I went into add or remove programs, selected "NVIDIA Drivers" (I'm using a basic Nvidia graphics card), and removed it, thinking that …

Member Avatar for caperjack
0
241
Member Avatar for archb

try running files using terminal/cmd commands: [CODE=python]import os os.system("file.py arg1 arg2 arg3")[/CODE] also, if you wanted to run a python file without command line arguments, (don't quote me on this but im pretty sure you can't use CMAs this way) try this: [CODE=python]#import the file import myfile # run a …

Member Avatar for Tech B
0
206
Member Avatar for Lolalola
Member Avatar for Lolalola
0
175
Member Avatar for fallopiano

Here I have a simple range function that can use floats as steps or increments. In a time test (using Psyco 1.6, python 2.5, and a basic PC), the normal frange function was able to go up to 1,000,000 from 0, by .3 , and finish that in about 0.5929 …

Member Avatar for Gribouillis
0
575
Member Avatar for hondros

I don't have numpy, but try replacing all of the other 'ifs' with 'elif' and see if that works.

Member Avatar for hondros
0
115
Member Avatar for sri1230

Hey there Sri. For ending processes, you can check out the command 'taskkill' ([url]http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/taskkill.mspx?mfr=true[/url]) Your version of windows may or may not have a copy of taskkill.exe in C:\WINDOWS\system32\ ,which is the actual command itself. If not, don't fear! There's tons of copeies of batch commands just like this one …

Member Avatar for Hawkeye Python
0
107
Member Avatar for fallopiano

Hi all. Just today I had been on the computer for some hours. I turned it off, and then on again, and got an error saying that the NTLDR is missing. I did my research and apparently I need to restore my XP Home Edition with my Windows XP CD. …

Member Avatar for fallopiano
0
220
Member Avatar for emir_gradacac

even faster would be: [CODE=python]key = pygame.key.get_pressed() event = pygame.event.poll() # exit if event.type == QUIT or key[K_ESCAPE]: pygame.quit(); sys.exit() # left arrow if key[K_LEFT]: # do something pass [/CODe]

Member Avatar for Lardmeister
0
425
Member Avatar for fallopiano

Hi everyone. I'm currently working on a project with c#, and had some questions about classes. I'm a python programmer, so bear with me ;) How would I make a class that has pre defined arguments? I.e. even if the user doesn't pass that arguement, the default value of it …

Member Avatar for sknake
1
146
Member Avatar for ShadyTyrant

Hey if you guys would like another developer, I could be of some help. I would consider myself to be intermediate at python (with a little knowledge of c++), and have a pretty strong background in pygame (if that helps at all :D) I'm the kind of programmer that loves …

Member Avatar for Gribouillis
0
365
Member Avatar for Symbolistic

what specific type of 2d math are your trying to make? please give more detail

Member Avatar for fallopiano
0
76
Member Avatar for checker

here are some tips. First off, after stating class person, you must have three spaces for each following line. 3 for each semicolon. As for init, it needs two under scores __ like so: [CODE=python]class person: def __init__(self): print('__init__ not _init_ :)')[/CODE] just like functions, classes can pass arguments. Use …

Member Avatar for fallopiano
0
125
Member Avatar for Tech B

i don't know much about Image library, but it's quite easy todo with pygame: [CODE=python] # import pygame import pygame from pygame.locals import * # import our picture image = pygame.image.load('picture.bmp') for x in image.get_width(): for y in image.get_height(): # for each pixel in the image, print out it's RGB …

Member Avatar for fallopiano
0
525
Member Avatar for SoulMazer

I don't think there is a lib that can cover all operating systems that use python, because they are all coded differently (I could be wrong, though :p) I know that you can grab key+mouse(and mouse wheel) input (outside of the main window) with pyhook [url]http://sourceforge.net/apps/mediawiki/pyhook/index.php?title=Main_Page[/url] It's pretty resourcful; I …

Member Avatar for Tech B
0
234
Member Avatar for jaison2

hehe, i kinda got carried away.. [CODE=python]# import all of our needed random functions import random won = False def guess_7_times(): global won print('Welcome to the number guessing game!') # our random number real_number = random.randint(1,100) # how may guesses we have until we loop out of the function and …

Member Avatar for snippsat
0
208
Member Avatar for fallopiano

Hi everyone. So I have your average Windows XP emachines PC. Just a few days ago, I booted and installed Ubuntu 9.10 32-bit on my pc, to make it dual booted. I just wanted to see what ubuntu was like. Pretty nifty, nice graphics, etc. So I go to uninstall …

Member Avatar for caperjack
0
332
Member Avatar for ffs82defxp

um, all of those you can do in cmd, but if you want to do direct cmd/system calls, use os.system() (note: these are windows system commands; these wont work an a non microsoft operating system) [CODE=python]import os,sys # change shell window os.system('title whatever u want here') # to view all …

Member Avatar for fallopiano
0
105
Member Avatar for fallopiano

hi everyone. Say I have my project directorys set up like so: /glider /libs classes.py /graphics /rooms room images go here I'm trying to access a image from graphics/rooms, but from classes.py. I'm using pygame, and I know to go back a folder in a dir; you use: [CODE=python]# go …

Member Avatar for fallopiano
0
213
Member Avatar for Judgment

you can use the list.remove function [CODE=python]list = ['sp','am',' and', ' eggs'] list.remove(' eggs') print(list)[/CODE]

Member Avatar for snippsat
-2
114
Member Avatar for CurtisEClark

say if n was circle, this is what python interprets: [CODE=python]pygame.draw."circle"(screen, (random.randrange(255), random.randrange(255), random.randrange(255)), (random.randrange(640), random.randrange(480)), 50 )[/CODE] now thats not code; its a string. you could add if statements like so: [CODE=python]if z == 'circle': pygame.draw.circle(arguements_go_here) elif z == 'line': # code for drawing line here[/CODE]

Member Avatar for CurtisEClark
0
491
Member Avatar for fallopiano

hi everyone. Just out of curiosity more than anything; does anyone know of a library that can grab microphone input (on windows)? I'm looking into how to write a kind of VoIP (voice ip) program. I know how to use sockets for sending/receiving data, but I just need the microphone …

Member Avatar for Stefano Mtangoo
0
277
Member Avatar for thehivetyrant

when you draw a circle on the screen w/ pygame, you are not making a class instance. you are calling a function. you would need to have a seperate x and y variable incrementing up every game loop to make it look like it is moving

Member Avatar for vegaseat
0
8K
Member Avatar for johnroach1985

to get your computers ip, try [CODE=python]>>> import socket >>> socket.gethostbyname(socket.gethostname())[/CODE]

Member Avatar for johnroach1985
0
2K
Member Avatar for AnonSurf
Member Avatar for AnonSurf
0
163
Member Avatar for fallopiano

hi everyone. to put it plainly, I was writing some python code that used the itunes scripting interface to control itunes. so I got all of my functions down, and now I wanted to have these actions occur on a specific mouse press. thanks to Tech B, I used the …

Member Avatar for fallopiano
0
105
Member Avatar for fallopiano

hi everyone. just recently I've been messing around with controlling itunes with python (you should check it out on google; some pretty fun stuff to mess with :D). I've already got all of my functions down, but my questions is that how would I go about grabbing keyboard/mouse input (mouse …

Member Avatar for fallopiano
0
328
Member Avatar for fallopiano

hello everyone. Right now i'm currently working on a 3d engine in python and pygame. it supports images that can (will) be mapped and transformed to look 3d. in pygame, you can load your basic image, do rotations and scales, etc. But the only thing it lacks (perhaps b/c it's …

0
66
Member Avatar for fallopiano

Hi all. I recently wrote a python program that takes a screenshot of the current active window. After taking that screenshot, it saves it as a bmp (using PIL), and then goes thru each pixel, looking for a certain color. If it finds that color, it moves the mouse to …

Member Avatar for fallopiano
0
128
Member Avatar for fallopiano

hi all. This might be more of a math problem then anything, but i'll give it a shot. I have an idea for a game i am working on, in which the player must advanced thru a level my the means of propelling a cube in the air (across the …

Member Avatar for Gribouillis
0
143
Member Avatar for fallopiano

Hi all. I'm working on a python file that will be included in a project I am working on. Unfortunately, I ran into some problems when it came to passing arguments from a function, to another function. Let me explain; I have two functions: dist and return_mouse_angle. dist returns the …

Member Avatar for sneekula
0
215
Member Avatar for fallopiano

Hi all. I'm having a bit of trouble (maybe it's easier than I think..) finding the lowest and highest number in a tuple of lists. Here is my main tuple: [CODE=python]list_of = ([0,7],[100,25],[150,59],[300,189]) [/CODE] so pretty much, I need python to return the lowest and highest number for each 'item' …

Member Avatar for snippsat
0
270
Member Avatar for Lilith24

as for creating your own terrain, thats gets really deep into the mechanics of the game. You would have to have the tools that the artists/programmers have at blizzard. I'm sure they have to make a level, add a bunch of crazy collision algorithms (prolly written in c++), then compile …

Member Avatar for mrnutty
0
124
Member Avatar for SuperMetroid

I think what you are looking for is: [CODE=python]background = pygame.image.load(bif).convert() # notice that pygame surfaces use 'convert' not 'covert'. # it's just a simple syntax error. also, out of curiosity, why are you # converting your background to support alpha transparency? # Unless you are drawing image behind 'background', …

Member Avatar for fallopiano
0
1K
Member Avatar for pymatio

you know, pygame has it's own rect collision system: [CODE=python]g=Rect(0,0,50,50) h=Rect(30,30,60,60) if Rect.colliderect(g,h)==1: print "g and h have collided!" else: print "g and h have not collided yet" [/CODE] hope that helps!

Member Avatar for Clueless86
0
182
Member Avatar for fallopiano

Hi all. I'm not sure if this is the correct place to post this, but whatever. I have a simple .reg file that adds the command 'Open Dos Box' to the menu that pops up when you right click a file (on windows) I want it to open a DOS …

Member Avatar for fallopiano
0
395
Member Avatar for fallopiano

hi all. I know that when you create a class, you put all arguements for that class in a __init__ functions, but what about for actaully making classes? confused? this is what I mean: [CODE=python]class Aclass(Object): insert code here...[/CODE] what is the purpose of 'Object'?

Member Avatar for fallopiano
0
116

The End.