- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
8 Posted Topics
Re: you can also make your own custom dict. custom type are done with classes class custom_dict(dict): # mydict[key] def __getitem__(self,key): return self.__dict__[key] # mydict[key] = value def __setitem__(self,key,value): if len(value) != 3: raise TypeError("Wrong numbers of arguments") elif isinstance(value[0],int) is False: raise TypeError("First argument not an integer") elif isinstance(value[1],int) is … | |
Re: This code you must keep hitting the down arrow key to change images [CODE]import pygame pygame.init() GREEN = (0,255,0) def main(): Screen = pygame.display.set_mode((400,400)) # pygame framerate control clock = pygame.time.Clock() # converting images is changing pixel layout. # it also lets transparent work # it speed up the drawing … | |
been googling for 5 days. The library has the book check out for the next 16 days. I'm using debian lenny linux , have nasm installed . I'm looking 1:1 assembly programing. No high level. to me no point in learning assembly if you going to use high level commands. … | |
Re: [CODE]if major = cmsc:[/CODE] should be [CODE]if major == cmsc:[/CODE] [QUOTE]I'm very confused, there must be an easier way to do this than using a million if statements. [/QUOTE] one solution [CODE]if coursenum in [201,202, 203, 304, 313, 331, 341, 345, 421] print '202, 203, 304, 313, 331, 341, 345, … | |
What am i doing wrong. Tadd.h [CODE]#ifndef ADD_H_GUARD #define ADD_H_GUARD int add(int a, int b); #endif[/CODE] Tadd.cpp [CODE]int add(int a, int b) { return a+ b; } [/CODE] Taddmain.cpp [CODE]#include <iostream> #include "Tadd.h" using namespace std; int triple(int x) { return add(x, add(x,x)); } int main() { int xi; xi … | |
Just want to create a flexible desktop that is independent from system. For my linux system. Like to have Clean Window and Transparent. 1. Looking for the basic on Xlib. Most of what i found is unclear where i start. I like to start simple and expand. a. Want to … | |
![]() | Re: this might help . [code=python]def reduces(s): x=int(s) p= 10 while p>9: p = 0 for i in str(s): p+= int(i) s = p return (p,x) s=raw_input("Enter a number: ") p , x = reduces(s) print(p)[/code] |
1. Opinions how to make it look better ? 2. How to make path for Linux ? using user ? 3. For Linux . What the difference between ( #! = user/bin/python , #! = user/bin/env python) ? 4. Anything i forgot or should consider ? [code=python] # ----- ----- … |
The End.