15,175 Topics
| |
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 … | |
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 ) … | |
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 … | |
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 … | |
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 … | |
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 + … | |
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. … | |
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 … | |
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 … | |
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 … | |
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. | |
[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 … | |
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. … | |
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 … | |
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 … | |
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 … | |
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 :) | |
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 … | |
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 … | |
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 | |
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. | |
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 … | |
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 … | |
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 … | |
How do i stop the following thread? [CODE] from threading import Thread from scapy.all import sniff class SnifferThread(Thread): def __init__ (self,filter): Thread.__init__(self) self.filter = filter def run(self): sniff(filter=self.filter, prn=self.pkt_callback, store=0) def pkt_callback(self,pkt): print pkt.sprintf('%TCP.payload%') if __name__ == '__main__': sniffer = SnifferThread("tcp port 80") sniffer.start() #here i will make a GUI … | |
hi, Please could you help me with displaying the png image file I am saving. I want it to display just after it is saved so within the same function onPLOT [CODE]import wx import cx_Oracle import datetime import wx.grid import csv import numpy as np import matplotlib.pyplot as plt import … | |
[CODE]L = [ 0 , 2, 1 , -1 , -1 , -1, -1 ] for i in L: if i <= 0: L.pop ( i ) print L [/CODE] What I was expecting was that L = [ 0, 2, 1 ] but the result was [ 2 , … | |
Hello. This time it might be a bit more complicated. [CODE] def start_game(): global no_winner no_winner = True rows_cols() global board board = make_board() print_board() player_select() def rows_cols(): global rows global columns rows = int(raw_input('Height: ')) columns = int(raw_input('Width: ')) if rows < 4: rows = 4 if columns < … | |
hello, me again. When ever I try to add pictures it WONT LET ME ADD THEM. i download them, type all the code, and no image shows up at all. Can someone tell me how to correctly do it. do i have to define the code that imports pictures? | |
How do I center my text in python? I have a title and a description, and wan't to center it all in my output. |
The End.