15,181 Topics

Member Avatar for
Member Avatar for juzzy

hi I wonder if anyone can help? I am trying to write a simple server_side message reciever so i can send messages from one machine to another, I want the program wrapped in a gui and i have been doing this using tkinter. However I have a problem, I can …

0
45
Member Avatar for adam291086

I am trying to construct a class and call upon some functions within that class, but nothing is returned, somehting should definitely be returned [CODE] #!/usr/bin/python import cElementTree as ET import urllib2 import MySQLdb print "Content-type: text/html\n" class xml: @staticmethod def find_text(element): if element.text: yield element for subelement in element: …

Member Avatar for adam291086
0
169
Member Avatar for Clipper34

Hey everyone, well i've been recently for the last day pondering on the idea of creating a web spider, but i just don't know where to start. What i think mainly the spider is built off of using the urllib, socket, and urllib2 modules to do the spiders bidding, i …

Member Avatar for woooee
0
128
Member Avatar for TheNational22

There is a thread in here somewhere that spoke of the issue but it did not describe a fix. I am running Vista home premium 64-bit SP1. When I open a wxPython window, it runs. As soon as my mouse enters the frame, a message comes up stating "python.exe has …

Member Avatar for TheNational22
0
93
Member Avatar for ruba_cti

Hi, I'm getting this error when reading from a csv file: "Runtime Error! line contains NULL byte". Any idea about the root cause of this error? If it helps, here's the part of my code where I'm reading the csv file. [QUOTE]def processFile(): global DATA # - Input file global …

Member Avatar for ruba_cti
0
2K
Member Avatar for harrykokil

can u plz debug it for me?? thanks [icode] import Tkinter as tk import time import sys import datetime as dt from Tkinter import * root=tk.Tk() root.title("Traffic Simulation") canvas = tk.Canvas(root, width=1000, height=400, bg="#FFFFFF") canvas.pack() for x in range (1,10): print 'orange'+x canvas.update() root.mainloop() [/icode]

Member Avatar for harrykokil
0
93
Member Avatar for Aue

make python program count the number of two words on a webpage (for instance, 'keep' and 'delete') and return it.

Member Avatar for leegeorg07
0
81
Member Avatar for bharatvamsi

hi, i'm novice user in python and i want to capture data at a specific port using python script.Please suggest me the approach. Same data i'm able to write into a file using linux command: tethereal -i any "port 9060" -w sam.txt I want to accomplish the above task using …

Member Avatar for lllllIllIlllI
0
56
Member Avatar for Stefano Mtangoo

I use bass.dll to play music files from [url]http://www.un4seen.com/[/url] I try to use function called BASS_ChannelSetPosition. I use ctypes to access the Library. Below is the part of documentation (comes with bass as help file) I need somebody to tell me whether the mode (BASS_POS_BYTE, BASS_MUSIC_POSRESET...etc) is a function or …

Member Avatar for Stefano Mtangoo
0
209
Member Avatar for lllllIllIlllI

Hi In one of my programs i use a wx.ToolBar, and this toolbar is meant to show a range of picutes that help the user with doing things quickly and easily. But the thing with mine is that i am using 64x64 images for the toolbar, yet when i set …

Member Avatar for lllllIllIlllI
0
91
Member Avatar for adam291086

I have this script and it was working a couple of weeks ago. Now when i run it nothing is printed out other than white space. WHY??? [CODE]#!/usr/bin/env python from xml.etree import ElementTree as ET import os import urllib def find_text(element): if element.text is None: for subelement in element: for …

Member Avatar for adam291086
0
103
Member Avatar for revenge2

hello there. I'm using notepad++ at the moment and i want to switch to something a little more 'better' suited to python. Ive already gone through the huge list of text editors on [URL="http://wiki.python.org/moin/PythonEditors"]wiki[/URL]. but yeah cant decide.... what would you recommend?

Member Avatar for Ene Uran
0
87
Member Avatar for tzushky

Hello , I have had a little surprise and maybe because I haven't read the manual well enough or can't understand all the underlying details. Imagine a small class and another file's main using an instance of that class. If I try to modify (not define !) an INEXISTANT attribute …

Member Avatar for Gribouillis
0
222
Member Avatar for SoulMazer

For reference, I am using Python 3.0. So, I have a small script I am working on trying to improve. I am now trying to create it with only dictionaries and loops. My problem is that I keep getting a Key Error at one of my lines. The line with …

Member Avatar for SoulMazer
0
159
Member Avatar for wheatontrue

Hello - my Python 2.5 IDLE used to start up, but now it won't. I tried looking at the preferences - those don't have any glaring mistakes. When I try to start it command line I get the following error: Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. …

Member Avatar for wheatontrue
0
318
Member Avatar for Stefano Mtangoo

I have python 2.6 portable and would pop error when I import wx. After some search, I found The prementioned package missing in the XP system. I downloaded and Installed and went fine. My Question is : Is there any way to add vcredist_x86.exe's missing DLL direct to wxpython directory …

Member Avatar for Stefano Mtangoo
0
171
Member Avatar for codedhands

Hello.Please i have a problem with my code.I am trying to edit a file.The problem occurs when i use the seek function.for example,i have a file outlined like this: [CODE] myfile.txt <Name>Ben</Name> <Age>32</Age> <Sex>Male</Sex> <Country>Mars City</Country> [/CODE] Now,when i try to edit the Age,i use the code: [CODE=python] f=open('myfile.txt','a') f.seek(17,0) …

Member Avatar for lllllIllIlllI
0
97
Member Avatar for starzstar

Hi, I am new to Python and have a requirement to develop a simple requirement to design a login screen, and then a screen which will have two parts in it one will show local files and other files on server I am planning to use tkinter for this is …

Member Avatar for jlm699
0
113
Member Avatar for Stonehambey

Hi guys :) Did a bit of searching but couldn't find much on this, so I thought I'd ask here. I want a Tkinter Label to display a polynomial, so naturally I need to put some superscript formatting onto it. But I can't seem to work out how to. Any …

Member Avatar for Ene Uran
0
2K
Member Avatar for leegeorg07

hi again i have been looking at the bacon cipher and i have made this [ICODE]import re dictionaryofcodes = {'A': '11111', 'B': '11110', 'C': '11101', 'D': '11100', 'E': '110111', 'F': '11010', 'G': '11001', 'H': '11000', 'I': '10111', 'J': '10110', 'K': '10101', 'L': '10100', 'M': '10011', 'N': '10010', 'O': '10001', 'P': …

Member Avatar for leegeorg07
0
122
Member Avatar for Gribouillis

What do you think would be the best way to write this structure [code=python] if testA: actionA() if testB: actionB() if textC: actionC() else: actionDefault() else: actionDefault() else: actionDefault() [/code] if I want to write only one call to actionDefault() ?

Member Avatar for Gribouillis
0
136
Member Avatar for Aue
Member Avatar for Apollo64

I am some-what new to programming in python, and i'm trying to make a game but I need to know some of theses thing. Sprites I have sprites created, but how do I import them and print them on the screen? Movement I am completely clueless on how to make …

Member Avatar for jlm699
0
110
Member Avatar for dineshjaju

[CODE]#Python code: import csv # first we need import necessary lib:csv file=open("dinesh.csv") #prepare a csv file for our example testWriter = csv.writer(open('dinesh.csv', 'w'), delimiter=' ', quotechar='|', quoting=csv.QUOTE_MINIMAL) spamWriter.writerow(['Test'] * 5 + ['Wow'])[/CODE] [B]Error:-[/B] <type 'exceptions.IOError'>: invalid mode: w args = ('invalid mode: w',) errno = None filename = None message …

Member Avatar for jice
0
99
Member Avatar for i_saw_some

Hi, I am using Django 1.0 and Python 2.5.2 on Ubuntu Hardy Heron. My Python application must load a large amount of data - an object that represents a huge non-hierarchal network. Once this lengthy loading process is completed, calculations can be performed very quickly from then on. In my …

0
19
Member Avatar for jvignacio

hey guys im trying to get my html and python cgi script working together to show the users selections of the checkboxes of bulbs and add them up aswell plus the method they wana pay once they pretty the submit form button.. here is my html code: [CODE]<html> <body> <form …

Member Avatar for jvignacio
0
187
Member Avatar for babanner

This is my code [code=python] import urllib.request, urllib.parse,http.cookiejar url="http://localhost/test.php" cs=http.cookiejar.FileCookieJar("cookies.txt") cs.load("cookies.txt",ignore_discard=False, ignore_expires=False) opener=urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cs)) y=opener.open(url) print(y.read()) [/code] It seems to be correctly according to the Python 3.0 documentation (which is very,very poor). However i get an error: FileCookieJar has not attribue '_self_load'. Please help.

Member Avatar for jlm699
0
83
Member Avatar for mn_kthompson

I was looking over some code for an open source project and I saw some strange whitespace stuff that I didn't even think would run. The thing is, it runs just fine. I was wondering if someone could explain what I'm missing. I don't want to copy the exact code, …

Member Avatar for sneekula
0
134
Member Avatar for tzushky

Hi, Something new from me: I have an application which can act as server and client (launch them on separate PCs). I need the server stdout because it displays some data for evaluating their communication. I start the server through a [B]subprocess.Popen[/B] giving its stdout to [B]PIPE[/B] [CODE=Python] from subprocess …

Member Avatar for Gribouillis
0
14K
Member Avatar for red999

I am creating a script that allows me to calculate the future value of an investment at the end of x years, but I am having a little trouble writing the summation syntax in my script. I am not familar with the sum syntax so I do not know how …

Member Avatar for paddy3118
0
184

The End.