15,181 Topics
| |
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 … | |
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: … | |
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 … | |
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 … | |
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 … | |
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] | |
make python program count the number of two words on a webpage (for instance, 'keep' and 'delete') and return it. | |
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 … | |
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 … | |
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 … | |
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 … | |
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? | |
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 … | |
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 … | |
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. … | |
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 … | |
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) … | |
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 … | |
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 … | |
| 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': … |
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() ? | |
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 … | |
[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 … | |
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 … | |
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 … | |
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. | |
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, … | |
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 … | |
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 … |
The End.