15,181 Topics
| |
Hi Guys What i am trying to do here is have a tuple of numbers, lets say X. Then i have a list of a few other tuples. I want the program to find the tuple that is closest in value. [code=python] x = (214,521) lis = [(200,500),(250,550),(300,600)] [/code] I … | |
I have a Python program that uses Mechanize to open a page at a website with a log-on/password form, set the entries to preset values and then submit to begin the session. This works, I can get the log-in/password from a form I build in the program. What I an … | |
Hi all, I want to append our own images with nodes and their children in a tree control. I am using wxPython and it has wx.ART feature which contains many custom images, but if I want some other images to be appended in a tree, what should I do? Please … | |
Hi all, I am using a tree control for multiple selections by implementing "wx.TR_MULTIPLE" property. The tree is bound by the event "EVT_TREE_SEL_CHANGING". On click of each item, value for that item is being populated.Similarly, The value should disappear on clicking the selected item again.Now,when I click the last item … | |
Hello, Here I go again. I have the simplest of ideas...yet cannot seem to find a solution to implement it: [CODE=Python] from socket import * import time BUFSIZE = 256 IP = 'localhost' PORT = 25000 ADDR =(IP, PORT) tcpCliSock = socket(AF_INET, SOCK_STREAM) tcpCliSock.connect(ADDR) tcpCliSock.send('I want a response from you … | |
i have been trying to create my python command prompt directory but always recieve this imformation "the system cannot find the path specified" please i will be glad if someone can shade more highlight on how to set the python command prompt directory | |
How do you add directories whose absolute path cannot be guaranteed. For eg, in the directory structure below, I would like to add the "personal", "personal/util", "personal/net" and "personal/lib" directory to sys.path. The "Python" directory could be sitting anywhere in the file system. I added [B]sitecustome.py[/B] to "Lib/site-packages", however, I … | |
Is there any way to put multiple lines of text in each selection part for the tkinter listbox? Thanks for the help. | |
Dear all, I installed Two applications in same PC, these two applications using import sys options my problem is i cant import Python path for Second application because in Import sys is tracking only first path in python path so how to import Second Path also using import sys regards … | |
Hi everyone. I'm using ReportLab to generate pdf report from my price list application. The application runs on windows xp o.s. and is made with tkinter. What the app make now is that when I press the printPdf button a pdf file with a preset name is created in the … | |
Hopefully this question is easier than I think it is. :) I have a directory with thousands and thousands of flv and jpeg files in it. I want to loop through the directory, get the file names and their sizes (in bytes) I've tried searching the web for a function … | |
I've been trying to program a "press any key to continue" function, simply because raw_input feels noobish, but so far I haven't been having much luck. I did a search and the opinions are nearly unanimous that getch() is the way to go, but...things haven't gone that well. Here's an … | |
Hi! I've been working with radio buttons and I've been having some trouble. The basic problem is that even though I can create the radio buttons (and I can select which one I want) that they don't do anything- nothing is printed or tells me what the "user" selected. Here's … | |
I have a list that is retrieved with python from MS Access. This list needs to be sorted alphabetically before being printed on the web browser. Here is what I have and I need it sorted by the P_LastName. [CODE]dbc = odbc.odbc('Intra//') csr = dbc.cursor() q = "SELECT P_ID, P_FirstName, … | |
Hi everybody! I'm trying to write a program that is able to look inside a txt file and change, for example, the first word with a similar word. The txt file will have one word for line. EXAMPLE::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ORIGINAL TXT FILE: tom lives CHANGED TXT FILE: mum lives :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: I … | |
Hi Guys.. Can someone explain to me what's the difference between sending any data over a socket vs sending an http request? i mean sending an http request would also be happening over a TCP socket, am i right? so basically it's as simple as sending data from client socket … | |
Hi, When i search for a pattern in a file how do i get the line and line#? basically i want to replicate the 'grep' command functionality. Now i can easily say whether the pattern exists or not using re.search funtion but i'm not able to print that particular line … | |
I am parsing an XML file with encoded entities in it (& and so on). If I use minidom to parse the XML file, minidom will unescape the entities and display the correct value. If I use pulldom, it skips the entity and moves onto the next line. For example, … | |
I've create a C program that makes a call to routines which I create inside of python...however when I copied the final exe to another machine the program crashed saying it couldn't find the python25.dll...tried looking for it but could not find it. Is it enough that we have this … | |
I would like to convert url into md5 hash. My question is that md5 hash will create collision at 2^64. If you do long(value,16), where value is the md5 hash string, would value returned from long(value, 16) be unique as long as md5 hashed string is unique? when you move … | |
Hello everybody! As I thought I became more comfortable with data structure I've got the problem I can't solve. It looks so: I have that kind of text file: ABCD vvvv 1e-12 ABCD hhhh 1e-6 ABCD ggggg 1e-3 ASDE ffffff 1e-57 ASDE dddd 0.001 etc. I would like to read … | |
Hi. I'm making a program to plot carrier concentration as a function of semiconductor depth. The program is almost ready, the last part I'm missing is actually making the plot. I've been googling a lot and never found a simple example of how to use the plot. My data is … | |
i have seen in some examples that when they are explaining the sockets they write a sck.bind(('',PORT)) for server and a sck.connect(('',PORT)) for the client part but when i try to use this code it doesnt work but when i change the client part to sck.connect(('localhost',PORT)) it works fine. so … | |
Hi everybody! I need to split my path, let's say' "C:\path1\path2\path3\path4" into separate strings... Not sure how to do that, I've tried os.path.split / splitdrive etc. but it always give me just 2 arguments I need to get "C:\path1" from this path string for example, which would be the root … | |
Hi, Is it possible to access a https site using a certificate and keeping the session alive like it happens in the browsers? I'm doing a console app that needs to access a server by https to retrieve information but using the httplib, each time i make a request it … | |
I want to install it in vista, but i get this message in the process: could not create... py2exe-py2.5 I press 'OK', then.. could not set key value python 2.5 py2exe-0.6.8 I press 'OK' again, then... could not set key value c:\Python25\Removepy2exe.exe" -u "c:\python25\py2exe-wininst.log The installation goes on and do … | |
I'm having a problem comparing floats, given the values below, I'm getting the wrong results when running this piece of code let distAppart = 4.76837158203e-007 let factor = 0.01 [CODE] if distAppart < factor and distAppart > -factor: print 'this should not print with the given values.... But it does … | |
[code=python] class A: id = "" fld = [] def __init__(self, id): self.id = id def method(inp): a = A("a") b = A("b") c = A("c") a.fld.append("Histogram") a.fld.append("Dendogram") b.fld.append("Milligram") b.fld.append("Pictogram") c.fld.append("Pro--gram") c.fld.append("Dodge-ram") print a.fld print b.fld print c.fld inp.append(a) inp.append(c) inp.append(b) #__main__ inp = [] method(inp) for ins in inp: … | |
Hi! First, thanks for taking the time to look at my problem, I really appreciate it. Right now I'm trying to setup a columns of 'cells' made up of labels separated by horizontal panes within a scrolledframe. When i initially run my code everything fills in fine. However, when I … | |
Hi everybody! Don't know if it's possible to do with python... Anyway, I need to get some information from a QuickTime movie file (for now I need movie's duration in seconds, in fact). Topics in different forums point me to the QuickTime format specification PDF, I've already downloded it and … |
The End.