15,175 Topics

Member Avatar for
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
186
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
Member Avatar for jvignacio

Im trying to figure out a python script where, If there is no user input, it generates a form which asks for the user's name and email address by using the action form. any ideas ? any help much appreciated..thanks guys

Member Avatar for Freaky_Chris
0
66
Member Avatar for Stefano Mtangoo

Hi all, I have been trying to write and retrieve data from SQLite Database. So far I can make connection, cursor; but cannot get table populated(fails to execute SQL statement). Since I read somewhere that it is recommended to use ? instead of % then I tries it but I …

Member Avatar for Stefano Mtangoo
0
2K
Member Avatar for rajeesh_rsn

Hi i am a php programmer. Kindly let me know a good book for begin python from its basic ??? Thanks

Member Avatar for Stefano Mtangoo
0
79
Member Avatar for Ghostenshell

Can anyone simplify this for me? I don't know if it is going to work I tried to adjust the code to fit on the page. Might have to delete the extra [ICODE]+\[/ICODE] [CODE=python]def main(): try: infile = open('text.txt','r') files = infile.readlines() lower,count,blank,dig = 0,0,0,0 #Counting uppercase for line in …

Member Avatar for Stefano Mtangoo
0
965
Member Avatar for Radly

I'm sure this is either easy or impossible. :) I have a Windows command console window open with a Python 2.5 interpreter running. I also have a text editor open on a module I'm debugging. What I'd like to do is make some changes in the editor, save the file, …

Member Avatar for Radly
0
86
Member Avatar for wotthe2000

Hi, i'm having some trouble using the built-in apply function. I want to take a string in an external definition then apply definitions on it which are in a class. The code I have is: [ICODE] global msgstr def create_message(message, msgstr): if msgstr[0:3].upper() == 'CMD': return apply(message, (msgstr)) elif msgstr[0:3].upper() …

Member Avatar for wotthe2000
0
93

The End.