15,190 Topics

Member Avatar for
Member Avatar for Aiban

Hi Everyone. After many months my program works .. man, so much happiness, and it wasn't a small project, my first program is 400 lines of code LOL OK .. so i wanted to fix up some of the "prettines" and was looking for some ideas. One idea is this …

0
57
Member Avatar for ffs82defxp

First Program - CalcPro.py How do I make labels like in Batch so that I can 'go to' or initiate certain blocks of code when needed? And what is the command for goto? Whats the command for cls (or in other words clearing the screen)? [CODE]while 1: import math print …

Member Avatar for snippsat
0
118
Member Avatar for dmcadidas15

I'm trying to write a program that will open a file named "data.dat". This file contains an unknown number of values that I need to have read and averaged together and is written such that each line has one value. I need to have the data in this file be …

Member Avatar for pythopian
0
106
Member Avatar for dmcadidas15

Im trying to access a variable in a list that is 3 places earlier in the list. For example list_1[dogs, cats, pigs, hamsters, kids]. If Im trying to access the word cats based on the position of kids how would I do that? I know list_1[4] returns kids and I …

Member Avatar for dmcadidas15
0
88
Member Avatar for emir_gradacac

i followed official pygame tutorials, and stuck on the first one, the "introduction":$. there's a line 10 that goes : [CODE]ball = pygame.image.load("ball.bmp")[/CODE] and, since i don't have a "ball.bmp" in my computer, i decided to draw it in paint. now, when i write that line in the python interpreter, …

Member Avatar for python user
-1
208
Member Avatar for njam

i have the book for beginners python and pygame and i read through it and learn a lot but is there a place where they have more tutorials i just want to learn more and more about this cause i love making games. i have been to the website and …

0
50
Member Avatar for njam

hey guys I'm kine a new to pygame and i want to make a space game but i dont know how to make the screen folow my ship. if you have any info on this plz let me know. Thanks :)

Member Avatar for njam
0
70
Member Avatar for jorgejch

Hello, I've started with python (3) recently. Initialy only for scripting. Now I'm trying the object oriented bit. I'm getting the following error message [CODE] <Atom.Atom object at 0x7f0b09597fd0> Traceback (most recent call last): File "./Main.py", line 7, in <module> print (t.getAtomName()) File "/home/jorge/Documentos/projetos/mestrado/códigos/cartesian_zmatrix/Atom.py", line 22, in getAtomName return atomName …

Member Avatar for woooee
0
577
Member Avatar for mahela007
Member Avatar for ov3rcl0ck

I'm trying to strip HTML tags and replace certain tags with newlines and tabs. I just can't figure out a function to do this, any ideas? I'd prefer to use regex instead of a library.

Member Avatar for jlm699
0
106
Member Avatar for kleigh

Hey, guys! Newbie here. =) I'm trying to return an image that contains n^2 full size copies of my original image tiled, that makes an n-by-n square. I've been working on this for the past couple days and I am stuck. It's giving me an "image index out of range" …

Member Avatar for kleigh
0
3K
Member Avatar for scrace89

[CODE]area = ((length ** 2) * numSides) / (4 * (math.tan(FULL_ROTATION / (2 * numSides)\ )))[/CODE] this is my thought but I can't figure it out, I always get the wrong value. I need to get my answer in degrees. but even when i use [CODE]return math.degrees(area)[/CODE] at the end …

Member Avatar for vegaseat
0
121
Member Avatar for sentinel123

Hi Peepz, My Connect 4 board is made up of different lists. My task is to write a function that checks whether the game ends in a draw (that means when every spot is taken by a 'X' or an 'O' without fulfilling the winning requirements If everyspot is filled …

Member Avatar for masterofpuppets
0
133
Member Avatar for sanchitgarg

I want to check the input of the user. Only positive nos are allowed. I want to pass the input of the user to a function which checks that if it is i positive no. then it allows the user to continue further otherwise it gives an error and asks …

Member Avatar for sanchitgarg
0
83
Member Avatar for python user

[CODE=Python] def Myfunc(): print "Stuff" #Title: "CrashLanding" #By: Python User #November 16, 2009 #Features improved coding style, or at least I think so #note:code based on J.G.S'S code-I really learned alot from his code Some credit goes to him #note:I dont think that is his actual username so keep that …

Member Avatar for python user
0
214
Member Avatar for Vector_Joe

Hi, I've dabbled in some programming in the past, but nothing serious. I'm trying to create an array of objects in python 2.6 (VPython). What I want to do is create a 2d grid of sphere()'s. But I want to be able to manipulate each one individually after they are …

Member Avatar for bumsfeld
0
851
Member Avatar for mahela007

The tkinter tutorial at tkdocs ([url]http://www.tkdocs.com/tutorial/firstexample.html[/url]) shows these two lines at the beginning of every example. [CODE]from tkinter import * from tkinter import ttk[/CODE] Doesn't the first line import everything in the tkinter module? if so, why bother writing the second line? EDIT: Just found an answer (kind of ) …

Member Avatar for bumsfeld
0
142
Member Avatar for Tech B

I tried installing pcapy 0.10.4 and i get an error. C:>setup.py install running install running build running build_ext building 'pcapy' extension C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nolog /0x /MD /W3 /GS- /DNDEBUG -DWIN32=1 -Ic:\devel\oss\wpdpack\Include - IC:\Python26\include -IC:\Python26\PC /Tppcapdumper.cc /Fobuild\temp.win32-2.6\Release\pcapdumper.obj pcapdumper.cc pcapdumper.cc(12) : fatal error C1083: Cannot open include …

Member Avatar for bumsfeld
0
539
Member Avatar for 1ndivisible

Hi, Hello, I've written a simple Python(2.6) server that I am connecting to through a Binary Socket from an AIR application. I can successfully send text and numbers through, but when I try and send a 3 byte ByteArray through, I receive the ByteArray as a string. More specifically the …

0
61
Member Avatar for kapcom01

Sorry to bother again:) but im new to Python and to OOP. I made a simple sniffer application (thanks to your help) which prints the sniffed data on the console. I want to extend it giving it a GUI using PyQt4. I also made an argument "--nogui" that the user …

Member Avatar for kapcom01
0
2K
Member Avatar for Kruptein

Hi I'm trying to find a way to find the first avogadro cipher whose digital sum exceeds 100, I've come to: [code=python]#!/usr/bin/python def dig_sum(n): lst = list(str(n)) ln = len(lst) sm = 0 while(i < ln): sm += int(lst[i]) return sm def avo(i,j,k,c): k = j j = i + …

Member Avatar for Kruptein
0
299
Member Avatar for Shadow14l

I thought I knew how packets worked, but I'm just not understanding how to capture and read them... I am playing this online game which is connected to a server (some server off of battle.net). I want to know how to search my way through the packets and filter them. …

Member Avatar for Tech B
0
122
Member Avatar for msaenz

I have this program I wrote up and wanted to add signal handler to it. The thing is the example only show how to play with it but no to use in between methods. I tried coding it but it doesnt work [code=python] import sys import signal import operator import …

0
62
Member Avatar for Musafir

Trying to write a function but don't known how to start. trying to make a function that ask the user for the current population and displays the population after 1/2 years unitil it reaches 1 million at a rate of 8% per year. for example Year 1, population 864000 Year …

Member Avatar for woooee
0
112
Member Avatar for Joe Hart

I have a text file I am trying to manipulate, but the code is very long. I know there is an easy way to do this by looping a few functiions. My code is below but it is not complete. I also have attached one of the text files. There …

Member Avatar for woooee
0
82
Member Avatar for Gribouillis

This snippet defines a context to execute a block of statements in a different working directory (with the help of the with statement). After the block is exited, the initial working directory is restored, even if an exception has occurred in the with block.

0
589
Member Avatar for col415

[B]Bsplayer is a videoplayer. I want to start bsplayer with the parameter -stime-x, where x is the amount of seconds. This result in playing a movie from say 23 minutes 10 seconds with the parameter -stime=1390. The whole thing I can manage to do in [COLOR="Green"][U]DOS[/U][/COLOR] and looks like: @echo …

Member Avatar for col415
0
139
Member Avatar for gibson8720

hey this is my first time asking for help. But i am having trouble making this code. (i think i am over looking it) but here is what i need to do. ::: Design and implement a program to maintain a simple income and expense budget for a non-profit organization. …

Member Avatar for snippsat
0
83
Member Avatar for tlj333

I'm having the hardest time figuring out how my latest homework assignment is supposed to work. Basically we have to write a program that creates a list containing names. The list will then be sorted, written to an output file, and searched. We get the names from a text file …

Member Avatar for vegaseat
0
128
Member Avatar for Aiban

Hi Everyone. I want to use this thread for some help as i'm sure this will not be the only question as i have just over 300 lines of code from my old python 3.1 script. I'm now using 2.6.4 and it is obvious some code isn't backwards compatible. Soooo …

Member Avatar for Aiban
0
138

The End.