15,185 Topics

Member Avatar for
Member Avatar for python_dev

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: …

Member Avatar for python_dev
0
165
Member Avatar for butterflyTee

# 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 …

Member Avatar for Ene Uran
0
136
Member Avatar for jaafit

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, …

Member Avatar for jaafit
0
1K
Member Avatar for jread

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 …

Member Avatar for jread
0
254
Member Avatar for Ene Uran

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?

Member Avatar for vegaseat
0
170
Member Avatar for Ene Uran

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 …

Member Avatar for Ene Uran
0
101
Member Avatar for Micko

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 …

Member Avatar for Ene Uran
0
540
Member Avatar for JoshBebbington

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 …

Member Avatar for a1eio
0
125
Member Avatar for shafter111

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 …

Member Avatar for shafter111
0
144
Member Avatar for shafter111

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 …

Member Avatar for shafter111
0
106
Member Avatar for harini_b

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 …

Member Avatar for pythonguy
0
106
Member Avatar for magnumbi

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 …

Member Avatar for magnumbi
0
266
Member Avatar for csaha

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 …

Member Avatar for G-Do
0
1K
Member Avatar for pythonguy

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 …

Member Avatar for pythonguy
0
180
Member Avatar for csaha

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 …

Member Avatar for freesoft_2000
0
105
Member Avatar for a1eio

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 …

Member Avatar for vegaseat
0
3K
Member Avatar for bumsfeld

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 …

Member Avatar for vegaseat
0
915
Member Avatar for coolman2006

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 …

Member Avatar for vegaseat
0
209
Member Avatar for Blujacker

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 …

Member Avatar for Blujacker
0
92
Member Avatar for Ene Uran

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.

Member Avatar for vegaseat
0
109
Member Avatar for sharma_vivek82

hi, i am very new in python. can anyone tell me that how to create dynamic dropdown box in python scripting.(triple dropdown box)

Member Avatar for vegaseat
0
789
Member Avatar for butterflyTee

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' …

Member Avatar for alc6379
0
4K
Member Avatar for JabaPyth

For the Tkinter Text widget, is there a way to assign the selected text to a new tag?(other than 'sel',which changes)

Member Avatar for Ene Uran
0
115
Member Avatar for butterflyTee

:?: [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) …

Member Avatar for butterflyTee
0
90
Member Avatar for dhanu_shiv

I need to design a GUI based on PyAUI. Do anybody have sample codes or tutorials that show the working of PyAUI.

Member Avatar for vegaseat
0
388
Member Avatar for butterflyTee

[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 …

0
69
Member Avatar for butterflyTee

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' …

0
64
Member Avatar for butterflyTee

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 …

0
90
Member Avatar for butterflyTee

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

Member Avatar for butterflyTee
0
476
Member Avatar for dhanu_shiv

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...

Member Avatar for vegaseat
0
91

The End.