15,185 Topics
| |
Hi, i have a program where i use a while loop to create buttons dynamically. Each button is created with, for a label, the name of one the drives on the machine(using the result of the fsutils command). Up to this point everything works fine, if i have drive C: … | |
# tpm.py Computes the cost per square inch of pizza given cost of the pizza, # and diameter. from math import * def main(): cost_per_square_inch(area_of_pizza()) def area_of_pizza(): diameter = input("Enter the diameter of the pizza: ") radius = 1.0/2.0 * diameter a = pi * radius * radius return a … | |
Does anyone know how to remove a window's border and title bar in wxPython? I want the client area to fill the entire screen. I have a wxPanel defined as follows: class FlashPanel(wxPanel): *def __init__(self, parent, flashFile): **wxPanel.__init__(self, parent, -1) **sizer = wxBoxSizer(wxVERTICAL) **ActiveXWrapper = MakeActiveXClass(flashControl.ShockwaveFlash) **self.Flash = ActiveXWrapper( self, … | |
I am trying to create what should be a very simple script, though I'm having a very difficult time getting it to work. All I want to do is create a new copy of a master file once per week and do my work on the copy. I plan to … | |
Python uses the directories listed in PYTHONPATH to find a module. How can I assure that the module I am importing is on this list of paths? | |
I keep hearing that the eval() function is unsafe. It is a nice function, because you can use it like print eval("2.5*49.7/(23+3.14)") and it will solve the math. Is there any way to protect against some nasty minded person to enter a "os.system(command)" where the command will erase a file … | |
Hello people of Python community, I'm back with (so far) strong will to learn Python, just like you. I remember once, Narue told me that good way to learn different prog. languages is to concetrate on algorithms and data structures and their implementation in language of choice. That way, she … | |
I have been looking over Vegaseat's Word Count program. I have two thoughts about what I want to configure it to do, but I'm not sure how to go about it. Idea 1; This is most important. I want users to be able to put a text file in the … | |
Hi! Thanks for your help in advance..... Heres my case I have a dictionary "d" with keys as string and a dictionary as integer "1" as keys to a list [1,2,3] [code] d{"test.tif": {1: [1,2,3]}} [/code] Now when I try looping through it........it gives me an error [code] for i … | |
simple problem....but I have no clue why its not working..... [code] if (w[0] > m[1]): temp = ((w[0]-m[1])/w[0])*100 print temp [/code] For some reason temp is always 0.........I want a double percentage difference between the two values.... Please guys..help me out here......after 500 lines of code ...I am stuck here......my … | |
Hi, I've encountered a problem iwhile writing a find and replace prg in python. this is my code: [CODE]import re f = file('testfile') while True: line = f.readline() if len(line) == 0: break print line p = re.compile(line) m = p.match('METASERV_HOME') print m f.close()[/CODE] as per the logic : if … | |
Hi everyone, I am new to python and programming in general and I could use some help on converting an integer to a decimal (e.g. 80% to .8). Here is what I have so far but as I'm sure you can tell, it doesn't work: [CODE]elif menu_choice == 2: print … | |
Hi Python Experts [B]I need to convert a code written on JAVA/JSP (Java Tags are also there inside JSP) to PYTHON. [/B] I have OK kind of knowledge in PYTHON, but dont have a muck knowledge in JAVA/JSP. Any idea how to approach? I am having tough time to achieve … | |
I am using automation desk to run python scripts. This in tern executes scripts using v2.2 interpreter every time i m trying to use raw_input("Enter name ") it fires EOF Error. If i run it in interpreter separately it works fine.Its really basic functionality. FYI: Automation desk dont support script … | |
Hi Java Veterans [B]I need to convert a code written on JAVA/JSP (Java Tags are also there inside JSP) to PYTHON. [/B] I have OK kind of knowledge in PYTHON, but dont have a muck knowledge in JAVA/JSP. Any idea how to approach? I am having tough time to achieve … | |
i don't understand the use of the os.popen function, i've used it to read things, for example: [CODE] >>> a = os.popen("netstat") >>> for line in a.readlines(): print line Active Connections >>> [/CODE] i understand that, but there is also a buffersize and a write ability, but i've played about … | |
This small program is neat: [CODE]import calendar calendar.prmonth(2006, 3) """ March 2006 Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 … | |
Does anyone know about LISP Programming I am trying to make this program where I have 3 types of cars, which are ford bmw merc ford has focus and fiesta BMW has 1series and 2series and the merc has SK100 and SK200 well basically i am trying to put them … | |
Hi!I have a problem and i think you can help me!(Sorry my english.I learn just one year) Thats part of my program... [code] okno=Tk() text=Text() text.pack() def find(): print "I need help here" menubar = Menu(okno) editmenu = Menu(menubar, tearoff=0,bd=4) editmenu.add_command(label="Find", command=find) menubar.add_cascade(label="Edit", menu=editmenu) okno.config(menu=menubar) [/code] i need add to … | |
I have the following code, for example: [CODE]price = 50.00 tax = price * 0.08 print "Tax = $",tax # Tax = $ 4.0[/CODE] As you can see there is a space between $ and 4.0. Is there a way to avoid this? I haven't done much Python coding. | |
hi, i am very new in python. can anyone tell me that how to create dynamic dropdown box in python scripting.(triple dropdown box) | |
I need help please to write this program. Numerologists claim to be able to determine a person's character traits based on the "numeric value" of a name. The value of a name is determined by summing up the vaules of the letters of the name where 'a' is 1, 'b' … | |
For the Tkinter Text widget, is there a way to assign the selected text to a new tag?(other than 'sel',which changes) | |
:?: [CODE]#The number of lines, and the number of words. import string def main(): data = raw_input("Enter the path and name of your ") infile = file(data, 'r') data_file = infile.read() number_of_characters = len(data_file) print "The number of characters in your text is", number_of_characters list_of_words = string.split(data_file) number_of_words = len(list_of_words) … | |
I need to design a GUI based on PyAUI. Do anybody have sample codes or tutorials that show the working of PyAUI. | |
[CODE]import sys def main(): usage = 'Usage: %s [options] <file name>\n' % sys.argv[0] options = 'Options:\n' options = options + ' -c, --chars print the character counts\n' options = options + ' -l, --lines print the newline counts\n' options = options + ' -w, --words print the word counts\n' usage … | |
import sys :o def main(): usage = 'Usage: %s [options] <file name>\n' % sys.argv[0] options = 'Options:\n' options = options + ' -c, --chars print the character counts\n' options = options + ' -l, --lines print the newline counts\n' options = options + ' -w, --words print the word counts\n' … | |
Word Count. A Common Utility On Unix/linux Systems Is A Small Program Called "wc." This Program Analyzes A File To Determine The Number Of Lines, Words, And Characters Contained Therein. Write A Version Of Wc. The Program Should Accept A File Name As Input And Than Print Three Numbers Showing … | |
AM I DOING THIS RIGHT, PLEASE HELP ME, SO ME MORE EXAMPLES ON HOW TO RIGHT IT :o C:\home\COP1000\a\3>python wc.py futval.py test.txt wc.py 22 103 699 futval.py 2 4 22 test.txt 52 223 1683 wc.py 76 330 2404 total | |
Hello Everyone... i am right now facing a simple at the same time a difficult problem....is there any way by which we can change the default green colour in gauge to another colour in wxPython.... I tried doing it in many methods but all failed....can anyone suggest any solution... |
The End.