15,175 Topics
| |
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 … | |
I'm trying to extract information (people's names and other info.) from a public database into a spreadsheet. Unfortunately, info about the people in the dataset (like their name and occupation) is not visible in the source code. Instead, there is this application by Caspio done, from what I can tell, … | |
Hi I have made a program with wxPython and i have this bit of code: [code=python] def getpic(self,event,urlp='http://mirror.bom.gov.au/radar/IDR043.gif?20080427173538'): fc = url.urlretrieve(urlp,filename='Weather.jpg') image_file = 'Weather.jpg' self.bmp = wx.Bitmap(image_file) self.img = wx.StaticBitmap(self.background, wx.ID_ANY, self.bmp, pos = (20, 60)) self.background.SetInitialSize() [/code] This is a bit of my code, not the full thing but … | |
I have a list of document pages with indicators where each document begins "ND": [CODE] Page1,ND Page2, Page3, Page4,ND Page5, [/CODE] I am trying to format it so that I have a two column csv with the first and last page: [CODE] Page1, Page3 Page4, Page5 etc [/CODE] I cannot … | |
Could anyone please tell me a good place to start in making a generic and customizable media player in python. perhaps a tutorial on how to. I can't find much except for already completed media players by other people. I think it would be ideal for my college project, however … | |
I have been trying to run a code .But i have been getting this error [CODE] Traceback (most recent call last): File "notebook.py", line 126, in <module> Testbook() File "notebook.py", line 90, in __init__ bufferf = "%s %d credits %s Difficulty" % (question.question_id, question.credits, question.difficulty) AttributeError: 'ShortAnswerQuestion' object has no … | |
Hi I am new to Python, I would like to inquire why the script below can't use fileHandle.readline() I am trying to store the data in an input file into a structure, but I am not sure why line = file.readline() fails ? The structure contains mode. Each mode contains … |
The End.