15,181 Topics

Member Avatar for
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
105
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
119
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
82
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
846
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
280
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
Member Avatar for o891

Hi guys, I am trying to create a python chat server. So far, it has been going well but a problem has come up with threading. The threading for incoming connections works fine (in the listen_and_accept function). Since I would like to be able to type in commands in the …

0
58
Member Avatar for Stefano Mtangoo

Hi All, is there a trick in wxPython to skin application to look like this one? What are pros and cons if any? Take a look [URL="http://www.fileguru.com/images/b/audio_recording_studio_multimedia_sound_tools-5778.gif"]Here[/URL] Cheers :)

0
137
Member Avatar for mhangman

Hi all, Im trying to add tags to my blog post. i did it its done but i wanted more so when users click the link of tag, they will see other post tagged same. anyway here my view_tag function [CODE]def view_tag(request, tag_id): tag = Tag.objects.get(pk=tag_id) news = tag.pnews_set.all() return …

Member Avatar for mhangman
0
103
Member Avatar for gangster88

The function below is supposed to ask the user to enter a choice of rock paper or sciessors and output an error mesage if the user enters an invalid choice and then ouput a message if they won, drew or lost against the computer. [code] def rockPaperScissors(): import random choice=raw_input("please …

Member Avatar for sentinel123
0
235
Member Avatar for elomanias

Hi Folks the game runs. jippie, but i have a small problem i cant get the board to get drawn from left to right, its drawn from upwards to downwards hope anyone can help me Sincerly elomanias

0
405
Member Avatar for lewashby

I'M reading the book "Python Programing second edition for the absolute beginner". While explaining the object paramater whithin a class, this how it reads. Base your class on [I]object[/I] , a fundamental, built-in type. Can someone please tell me what that means? Thanks.

Member Avatar for mn_kthompson
0
128
Member Avatar for lewashby

Does anyone know where I can find a goo pdf python reference for the following? pre built constructors, functions/methods for the follwoing tuples, lists, dicts...etc I hate reading a book with nothing but quick explanation, I want to see them for myself. And I already know how to find them …

Member Avatar for python user
0
183
Member Avatar for twoshots

I'm having trouble understanding why I can't seem to access a dict object of a class once the class instance is referenced through a dict of instances. If that makes sense at all ;) I have a simple class containing only a dict called index. [CODE]class Node: def __init__(self): self.index …

Member Avatar for twoshots
0
124
Member Avatar for Musafir

I am writing a function that has two parameters F & L and the function returns the sum of the squares of all the intergers between F & L e.g if i call def sum(3,5) should output 50 (9 + 16 + 25) def sum(first,last): sqaure = i for i …

Member Avatar for snippsat
0
116

The End.