15,181 Topics

Member Avatar for
Member Avatar for haro2x

Hello I have made a simple gui tic tac toe game using glade and python 2.6/ Now I want to change the text of the button when i click it. Does anyone know how to do this?? code: [CODE]#!/usr/bin/env python import gtk import gtk.glade import sys class iksoks: wTree = …

Member Avatar for haro2x
0
149
Member Avatar for echellwig

Hi, I'm trying to replace an item in a list I made with 0. [CODE]popdata[0][5].replace(0.02,0)[/CODE] when I run this it gives me the error TypeError: expected a character buffer object. I was wondering what this error meant and how I would go about fixing it. Thanks! Elise

Member Avatar for echellwig
0
574
Member Avatar for YasaminKh

Hi, I'm new to programming and especially to Python. I have this xml file that has parts like this: <VECTOR_AVERAGE name="Density Correlations" nvalues="15625"> <SCALAR_AVERAGE indexvalue="( 1,2,0 ) -- ( 3,4,5)"> <COUNT>204160</COUNT> <MEAN method="jackknife">6.368e-05</MEAN> <ERROR converged="yes" method="jackknife">2.89e-05</ERROR> <VARIANCE method="simple">6.37e-05</VARIANCE> <AUTOCORR method="jackknife">0.843</AUTOCORR> I need to save MEAN and ERROR. I wrote the …

Member Avatar for TrustyTony
0
329
Member Avatar for YasaminKh

Hi, I'm working with an xml file in python.here is the coed that i have: [CODE] import sys from xml.dom.minidom import parse # Load XML into tree structure tree = parse(sys.stdin) #Find all VECTOR_AVERAGE nodes va_list = tree.getElementsByTagName('SIMULATION')[0].getElementsByTagName('AVERAGES')[0].getElementsByTagName('VECTOR_AVERAGE') #Find the 'Density Correlations' node in the list of VECTOR_AVERAGEs for va …

Member Avatar for YasaminKh
0
182
Member Avatar for cableguy31

I'm using re.search to search for the pattern of anything that might look like a credit card number in a file. What I would like to do, is have the script then pull out the potential cc number and pass it to the Luhn algorithm for verification. If I'm not …

Member Avatar for cableguy31
0
81
Member Avatar for SoulMazer

Hi, I'm writing a program that goes through all of the music in a user-specified directory and I am having some trouble with Unicode characters. More specifically, [icode]'ascii' codec can't encode character u'\\xe7'[/icode]. The song names need to both be printed to a HTML page as well as be passed …

Member Avatar for SoulMazer
0
107
Member Avatar for gsingh2011

I need to log in to a website using python. The two fields are username and password. This is what I have tried: [CODE]import urllib import urllib2 import httplib username = "username" password = "password" url = "https://webconnect.bloomfield.org/Zangle/StudentConnect/logincheck.aspx" password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm() password_mgr.add_password(None, "https://webconnect.bloomfield.org/Zangle/StudentConnect/", username, password) handler = urllib2.HTTPBasicAuthHandler(password_mgr) opener = …

Member Avatar for Beat_Slayer
0
246
Member Avatar for aframe

I have a python script using Tkinter. In the script I have a numeric variable that the user is able to change the value of by entering the value in an entry box. I presently have the script reading and writing the value to an external .txt file so when …

Member Avatar for griswolf
0
2K
Member Avatar for patto78

Hi, I've just paid £10 for a book on the internet with the sole intention of solving one problem, unfortunately 2.5 hours later I am no further forward, despite the fact that the book suggests just a single line of code can achieve my aim. Maybe someone here can help. …

Member Avatar for patto78
0
208
Member Avatar for heyday21c

Hello, I want to count phrases in a text file by using Python. For instance, if a text is like "I love you very much", I want to make a dictionary like: "I love": 1, "love you": 1, "you very": 1, and "very much": 1. I also want to do …

Member Avatar for vegaseat
0
1K
Member Avatar for TrustyTony

The code from my answer to thread: [url]http://www.daniweb.com/forums/thread292949.html[/url] Any field names with any same separator separating the values. This is straight text file reading routine, see the original thread for csv module based code. sample.dat: [CODE]id; name; email; homeaddress 123; gishi; gishi@mymail.com; 456 happy st. 345; tony; tony.veijalainen@somewhere.com; Espoo Finland …

Member Avatar for TrustyTony
0
1K
Member Avatar for ChargrO

hi, im currently making a food ordering system in python. I recently decided to put a background in the window and now all of my buttons have disappeared?? does anyone know why this might be.

Member Avatar for TrustyTony
0
140
Member Avatar for daviddan2010

First i'd like to say that this is for testing only. If you try to use this program for any illegal practices what so ever... you will be responsable for your actions and i will be responsable for nothing. you would need some kind of security code generator to illegally …

Member Avatar for daviddan2010
0
2K
Member Avatar for mastermoo420

[url]http://paste.pocoo.org/show/231731/[/url] My problem is listed here... There shouldn't really be a reason (as far as I can see) with memory... If there's another way to get a dictionary from a .txt file that'd work/is more efficient, I'm looking for help. P:

Member Avatar for TrustyTony
0
62
Member Avatar for ChargrO

I was wondering if anyone knows how to create a transparent background image? just a small example or something.

Member Avatar for colorpie
0
138
Member Avatar for kshw

Hi, I'm trying to remove non-stop words from a text file using regular expresions but it is not working. I used something like ('^[a-z]?or') in order to avoid removing (or) from the mibble of words e.g. morning. [code] Temp = [] Original_File = open('out.txt', 'r') Original_File_Content = Original_File.read() Original_File.close() Temp.append("".join(Original_File_Content)) …

Member Avatar for woooee
1
209
Member Avatar for debragail

The following code iteratively calculates continued fractions. I'm having trouble separating the numerator and denominator from the returned value. [code=python]def cf3(terms, iterations): answer = 0 for n in range(iterations, 0, -1): answer = Fraction(1, terms[n] + answer) answer += Fraction(terms[0], 1) return answer [/code] The following is sample output showing …

Member Avatar for debragail
0
180
Member Avatar for foren

[CODE]output = open('d:\code\\output.txt','w') for y in range (0,len(evidence_array)): output.write(evidence_array[y] + ', ' + found[y] + '\n') #I am not sure if this output writing is correct! output.close()[/CODE] PLEAE CAN SOMEONE HELP! ---I AM NOT SURE IF THIS OUTPUT WRITING IS CORRECT THANKS

Member Avatar for foren
0
236
Member Avatar for muthukumarangms

Hi, I am trying to run a installer file that is compiled in python 2.5 on fedora 10 to the new upgraded python 2.6 on fedora 13 while trying to run the installer file this error occurs RuntimeError: Bad magic number in .pyc file The pyc files are compiled in …

Member Avatar for muthukumarangms
0
3K
Member Avatar for cbtetech

Hello and thanks for any assistance, I wrote this basic script to batch make test forms for a side project. In its current state it works fine and I can pass file names to it no problem. It will take the form embeded in the code and create 10 additional …

Member Avatar for TrustyTony
0
301
Member Avatar for jonb7

Hi , I am trying to run a Python script from linux but i am unsure how to do this. Reason being is i have created an Active Directory script to list users in groups and it works perfectly on windows but i need to move this to the linux …

Member Avatar for SoulMazer
0
114
Member Avatar for funfullson

Hi dears. I am searching around a reporter for python. some thing such as crystal_report or stimul_report witch used for C# and some languages other. thanks.

Member Avatar for jcao219
0
86
Member Avatar for cableguy31

I'm writing a script that will search file names looking from certain file extensions. The thing is, is that I am looking for multiple extensions, and the list may change. I could write an if statement using "and", but the line just gets a bit long and can become difficult …

Member Avatar for TrustyTony
0
145
Member Avatar for Priyesh_17

Hi All, I am a newbie in python. I have a SoapUI XML which looks something like this <soapui> <testSuite name=> <testCase> <testStep> <config resourcePath ="testpath"></config> </testStep> </testCase> </testSuite> </soapui> Now from python, I have to first validate that resourcePath is equal to "testpath". If yes change it's value to …

Member Avatar for TrustyTony
0
127
Member Avatar for cadtel

Hi all, this is my first post. A couple days ago, in preparation for a math final, I attempted to code a program which would allow me to solve triangles (law of cosines, sines, etc.). Now that the test is over, I am now interested in getting it working. [CODE]#This …

Member Avatar for TrustyTony
0
190
Member Avatar for Pykoda

Hello everybody ! wow my first time on danyweb ! ;p Well, here the deal. Im doing a script that basically copy and past into the local drive a specified directory with all this files. Im doing the copy with a copytree which is working well. But, (and I know …

Member Avatar for TrustyTony
0
121
Member Avatar for cableguy31

I'm writing a script that will search files that contain certain keywords, and then output the line to a text file. The problem I'm having is that the script is opening every type of file, including executables. The script seems to work fine, as in it doesn't crash when it …

Member Avatar for cableguy31
1
710
Member Avatar for phalaris_trip

how do I launch a python script within the IDLE python shell from the command line? basically I want to use Notepad++ as my editor, but when I press F5 I want my script to run in the IDLE python shell (NOT in a cmd window). If I do C:\Python26\Lib\idlelib\idle.pyw …

Member Avatar for phalaris_trip
0
200
Member Avatar for TrustyTony

This is must read if you learned Java before Python: Python Is Not Java: [url]http://dirtsimple.org/2004/12/python-is-not-java.html[/url]

Member Avatar for snippsat
1
651
Member Avatar for Jeramy

Be aware this is going to be ugly because I have never written anything in python and am attempting to quickly pick up just enough to solve my problem. I need a way to automate doing about 2 weeks of daily archives of a backup file. I think I have …

Member Avatar for Jeramy
0
108

The End.