14,946 Topics

Member Avatar for
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
89
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
385
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
63
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
89
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
472
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
89
Member Avatar for juergenkemeter

Hi, I am thinking about using the Python Imaging Library to display the life cycle of a hair follicle gene. This life cycle is divided into four main stages: 1. Anagen 2. Catagen 3. Telogen 4. Exogen Gene name and corresponding life cycle stage will be stored in a csv …

Member Avatar for vegaseat
0
298
Member Avatar for katharnakh

how do i move to next record after i click a button called 'Next' and how do i move to previous record after i click 'Previous' in MySQLdb. does method exists to do this? please help me........... [I]import MySQLdb from Tkinter import * db=MySQLdb.connect(host='127.0.01',user='',passwd='',db='Trimtabs') print 'mysql got connected.....' cursor=db.cursor() root=Tkinter.Tk() …

0
71
Member Avatar for IamRasheed

If I want to convert one type in another, I can use casts: [code]s = str(12.5) i = int(s) f = float(s)[/code] However, there doesn't seem to be a function cast, or even a statement cast. So how can I turn this string into a statement? [code]s = """for i …

Member Avatar for IamRasheed
0
103
Member Avatar for katharnakh

how to open a new window only when i click menuitem. for example, check out this following code, in which Toplevel window comes up as soon as u run the code. i dont want that. i want the new window to open only when click 'one' in the menu bar. …

Member Avatar for vegaseat
0
11K
Member Avatar for Alexander1987
Member Avatar for katharnakh

how to get the file dialog window and save dialog window in python. for example if select the File menu we can see Open menu option, when we click on that we get file open dialog window similarly when we click save as.... /save option we can see file save …

Member Avatar for bumsfeld
0
1K
Member Avatar for bumsfeld

I am making progress learning Python. and English. I understands tuples, lists and dictionaries, but sets don't make muchly sense. Why use a set? What is a set good for?

Member Avatar for bumsfeld
0
243
Member Avatar for abell1234

can anyone help me convert this vba script to python [CODE]On Error Resume Next Dim pMxDoc As IMxDocument Dim pMap As IMap Dim pCurve As ICurve Dim pFromPoint As IPoint Dim dXFrom As Double Dim bSrefFromMap As Boolean '======================= 'Adjust the parameter below 'bSrefFromMap = True ==> the coordinates will …

Member Avatar for bumsfeld
0
239
Member Avatar for katharnakh

is there any tool like IDE which assists to develop the UI, like VB, drag and drop. i know that we get IDE with the Python package but we have to hard code for the UI. if there is any please suggest.

Member Avatar for bumsfeld
0
101
Member Avatar for katharnakh

how to bind keyboard keys to menu items? i know to bind with mouse buttons but with keybooard keys dont know. for eg: [I]Cntl+O[/I] to open a file in File menu. how to implement undo, redo, find, find again, copy, paste functions in python. i actually gone through the IDLE.py, …

Member Avatar for bumsfeld
0
286
Member Avatar for Cidadell

Hi, I would to know if there're some way to have a dump of all the threads started by a python process. I want to see the TID corresponding of each thread because I need them to get the CPU time of each thread by the command top. Thanks

0
71
Member Avatar for katharnakh

1. hello, i have a set of questions, actually im developing a reporting tool where want to retrieve values from database and display that in the canvas in a formal reporting manner. can we take print out of content in the Canvas widget? (somewhat like, Data Report in VB) 2. …

Member Avatar for vegaseat
0
99
Member Avatar for bobpierce01

Silly title, and I know a bit more Math then Computer Science (in fact I am a poor programmer). In my Python program - code below -I have an error message saying I have too many nested static blocks. It looks as if Python got stubborn on the 21st for. …

Member Avatar for alc6379
0
372
Member Avatar for hummer010

I'm trying to open an https file using python on windows: [url]https://www3.eub.gov.ab.ca/eub/dds/iar_query/ApplicationAttachments.aspx?AppNumber=1438224[/url] My current attempt was this: import urllib import urllib2 the_url = 'https://www3.eub.gov.ab.ca/eub/dds/iar_query/ApplicationAttachments.aspx' values = {'AppNumber':'1438224'} data = urllib.urlencode(values) req = urllib2.Request(the_url, data) handle = urllib2.urlopen(req) At this point i get an error: urlopen error unknown url type: https …

Member Avatar for alc6379
0
194
Member Avatar for katharnakh

how to add a seperating line between menubar and toolbar in Python using Tkinter. is that possible using Tkinter. also how to add vertical seperating line to seperate toolbar buttons in toolbar. please help me out from this problem.

Member Avatar for katharnakh
0
2K
Member Avatar for Steko

I've got a problem with replacing letters for a specific vector, stored in a file. The first file contains a list of "x = 0000101" like entries. The second file contains the target words in the 15th colom. I tried to use a dictionary containing the data of the first …

Member Avatar for Steko
0
407
Member Avatar for Ghent

[COLOR=Navy]Yo, im new to Python and have been working on a personal project but can figure out how to save data to a file then read it in another program. im might have the writing down but cant tell bacause i cant read it. Iv been trying to work it …

Member Avatar for katharnakh
0
168
Member Avatar for katharnakh

can any body help me to add icons to the toolbar, i know that we have to use PhotoImage class to add but i'm not able to see the image in the toolbar. here is the code which i wrote, the following code is not an error, but im not …

Member Avatar for vegaseat
0
187
Member Avatar for uv2005

Hey there. I'm new to Linux, and must install Scipy (Scientific Python) on my Suse 9.2 . I have the Numeric model installed already. I've used the RPM and I can import the scipy module, but when I try to run xplt then I get this horrible error lines, can …

Member Avatar for vegaseat
0
137
Member Avatar for senateboy

how can i get the index number of a iterator? for instance: i wante to return the number of times ive gone through the loop. [CODE]list = [(mark, jacky,jane),(stick,cheri,nice),(elly,younces,pluto)] for i in list: print i[/CODE] this returns lists. but i want an output like: [CODE]>>1 >>2 >>3[/CODE] how do i …

Member Avatar for vegaseat
0
151
Member Avatar for ajitmote

Hi, after searching a lot , i got IDE SPE........ link for SPE [url]http://stani.be/python/spe/page_download[/url]........ but giving some problem........ my system is fedora core 4 .....

Member Avatar for vegaseat
0
162
Member Avatar for senateboy

hey yo's, i pretty much understand this function, except for the return value. i know that [I]string , string[/I] concats the strings. but what does the comma in the middle do when you have 2 different objects on either side as in the return value below? [CODE]def load_image(name, colorkey=None): fullname …

Member Avatar for vegaseat
0
167
Member Avatar for davalend

The End.