15,179 Topics
| |
I have a tkinter/python program which does something time consuming when I push a button. I'd like to give the user progress reports by updating a label field at each stage of the time consuming process. If have simple loop to the effect [code] for x in y: dosomething(x) self.label1.config(text … | |
hi, I am trying to get an image with my python application output. please give me that process. | |
Hey guys, This questions is more about organization of python modules than the actual construction therein. In my project, we have several scientists performing similar analysis on several different data sets. For each project, the science changes, but the analysis often requires almost identical data handling. For example, one project … | |
Hi there, this is my first python project. I'm new to python but I have experience in a few other languages. I'm trying to export (to mysql) a list of files and subdirectories from several directories on my hard drive. Basically just so I can have an online database of … | |
Hi, I am trying to log information from my application to memory. I have achieved this using the MemoryHandler Object. However, upon command I need to be able to write this to a log file on the hard drive. I would like the file to be 10 MB, so that … | |
hi all. I know that when you create a class, you put all arguements for that class in a __init__ functions, but what about for actaully making classes? confused? this is what I mean: [CODE=python]class Aclass(Object): insert code here...[/CODE] what is the purpose of 'Object'? | |
i have the following snip of data from i file i read in: li=[[4, 27, 6, 22, 0.81186094, 1.12214581, 2], [1, 9, 22, 28, 0.69887889, 0.989934, 2], [4, 27, 100, 30, 0.74796748, 1.04485376, 2], [6, 27, 22, 31, 0.91040724, 1.26681591, 2], [4, 1, 30, 45, 0.485223, 0.77061901, 2], [8, 27, … | |
can anyone help please? i have a snip of my file below can the the numbers be sorted as in excel? 27 4 220 16 0.76151102 1.06059456 27 4 220 17 0.61465055 0.90107796 27 4 221 22 0.81186094 1.12214581 27 4 223 28 0.69887889 0.98993400 27 4 225 30 0.74796748 … | |
1. I have an OGLCanvas with shapes on it 2. Double clicking a shape will open up a wx.MiniFrame where the user can do certain things 3. After OK is clicked or the frame is destroyed I would like the "focus" to shift back to the canvas so that without … | |
Hi im writing a program that returns whether an inputted number is prime or not, but Im kind of stuck... [CODE]import math def listfactors(n): # defining the function l = [] for i in range (1, int(math.sqrt(n))+1): if float(n)/float(i) == int(float(n)/float(i)): l.append(i) l.append(n/i) return l primeNum = int(raw_input("Enter number here:")) … | |
Hi, I am writing a script that aims to help a person keep a list of characters while reading a book. In doing this, I am writing to a file and checking it constantly, except I ran into a problem. Say I executed a code block such as the following: … | |
I have two classes, one inheriting wx.Frame and othe is wx.Dialog. I use the dialog to collect some info and I call its object in the wx.Frame class. The problem is, the dialog should return the value of its TextCtrl values and I have no Idea how to do it … | |
Hi, I'm trying to loop through vaules less than 1 eg say from 0.1-0.9. I tried the code below and I get the error "ValueError: xrange() arg 3 must not be zero". My question is, is it possible to loop through decimal values. [code] for x in xrange(0.1,0.9,0.1): print x … | |
How do I run a .py file from another python file.... I want a program depending upon the option you choose to run a different python program... Ho do i do this... I have tried: [CODE=python] import os if os.path.isfile('file.py'): exec(open('file.py').read) [/CODE] and it requires everything to be global.... only … | |
I can't get the menu or status bar to show up when executing the following program: [code=python] import wx ID_ABOUT=101 ID_EXIT=110 class MainWindow(wx.Frame): def __init__(self, parent,id,title): wx.Frame.__init__(self,parent,wx.ID_ANY,title,size=(200,100)) self.control = wx.TextCtrl(self, 1, style=wx.TE_MULTILINE) self.CreateStatusBar() #A Statusbar in the bottom of the window #Setting up the menu. filemenu = wx.Menu() filemenu.Append(ID_ABOUT,"&About"," Information … | |
| Hey guys, I wanted to make a program which keeps asking you questions, and continues on and on based on your answers... So basically, I wanted to know whether the user has typed 'why' in the first input, so I tried: [CODE]s=raw_input("Are you feeling bored?\n") s1=[s] a=0 for x in … |
I'm doing a program on Windows Vista, and what I'd like to do is a program that has got a main window, and has got another window that control the main one, like Microsoft Access. Can anyone help me out how to do it if possible. Thanks Dan08. | |
Hi, Again I'm a newbie, going through how to think like a computer scientist online tutorial. I have 2 questions in the next lesson that I can't seem to crack, in relation to sub strings. Here's the questions and my working below: This one I can remove letters but I … | |
Hi! I am writing a small Python script.It's function is to tell user external IP address log it into the file and when next time if the script is executed and IP is changed it must display message Here is the code. I have writed the script it tells users … | |
Hi I am wondering how to write a list to an html file from scratch. I am currently writing it to a file using: [icode] def wpubooks(self): for i in booklist: s=str(booklist) f=open('/booklist', 'a') f.write(i + '\n') [/icode] Is there a way I can change that code so that it … | |
I am looking for a xml creator/editor with treeview using Tkinter. I want to be able to load and save changes. Any help would be greatly appreciated or snippets. Thanks! | |
Hey all, I have been reading some older posts on line/list manipulation, but don't quite understand exactly how to implement all of the tools that you guys are using (line.strip() for example) to get what I need. Essentially, I have a working program that iterates through data and outputs it … | |
How to move all only one type of file to another directory? For example, i want to move only all .jpg only file to another folder in Python. I know batch is easier to do it, but i prefer in Python. Anyone can help? | |
Hi! I'm very new to both python and Tkinter and would be thankful for some help. i want to search a text document for a word and print each line that match the searchword in a text widget. [CODE]def ladda(): fts = 'thefile.txt' file = open(fts,"r") text = file.readlines() file.close() … | |
Hi, With this tutorial, I've hit a few questions that I'm not sure what they are asking for. It's in the lesson on lists? Could you please advise what it is they are looking for, because to me it sounds like I'm just filling out the argument as shown when … | |
[CODE=python]>>> mylist = ['bunnies', 'apples', 'animals', 'fruit', 'amsterdam'] >>> for x in mylist: print '--------------' print x if x[0] == 'a': print "Removing ",x mylist.remove(x) -------------- bunnies -------------- apples Removing apples -------------- fruit -------------- amsterdam Removing amsterdam >>> print mylist ['bunnies', 'animals', 'fruit'][/CODE] The output should be bunnies and fruit, … | |
Yeah so I was bored in class cuz I didnt know the test wasn't today, so I made part of a Python game. The battling works so far, and I might need some help later on so if anyone could could help me I'd appreaciate it. Norbert Quest: [code=python]import random … | |
Hi everyone, I'm doing some experiences with python in Windows Vista and I was wondering to know how to eject the tray of CDs. Thanks, Dan. | |
Hi, Im trying to parse a bands myspace page and get the total number of plays for their songs. The problem is that I cannot use urllib2 as the "Total plays" string does not appear in the page source. e.g. [url]http://www.myspace.com/mybloodyvalentine[/url] Any idea of ways around this? Thanks, O | |
Is possible use svg imge in wxpython in a toolbar for example? I've saw libRSVG but run on PyGTK. |
The End.