15,190 Topics

Member Avatar for
Member Avatar for strobon

can someone pointing me how to get a command in checkbutton1 be executed after user check it and hit ok button?.for example: in the attached picture, if user check the 'open terminal button' and hit execute,the program open terminal window.

Member Avatar for strobon
0
129
Member Avatar for ITBarbie

I am writing a script (a full-fledged program, actually) in PYTHON (version 2.5; the current version is 3.0 but there are some performance problems -- 3.0 is slower than 2.5; go figure). The program allows a user to open a file in WORD. I have tested this program on an …

Member Avatar for leegeorg07
0
99
Member Avatar for 4pennies

Hello, a bit new to python here and would appreciate some help. I am writing a simple encoder to a raw_input(turn to numerical ascii and then applying some numbers to it). I was able to get the encoding right but when i try to do a outfile only the first …

Member Avatar for 4pennies
0
94
Member Avatar for drew7py

I am looking for some pointers on how to format float numbers in a numpy array. This code selects lines from an array, and I want the output to look better so I can import into excel. infile looks like this: 1074 CL 006 2004 A8LGPUYE 10 TY 2 S0111P …

Member Avatar for drew7py
0
111
Member Avatar for iLikeSunshine

Traceback (most recent call last): File "...\Hello Python\src\main\__init__.py", line 7, in <module> redBench.accomodate(harold) [B]TypeError: unbound method accomodate() must be called with bench instance as first argument (got man instance instead)[/B] Here is the code: [I]__init__py[/I] [CODE]import man_cl import bench_cl harold = man_cl.man("harold") redBench = bench_cl.bench [B]redBench.accomodate(harold)[/B][/CODE] [I]man_cl.py[/I] [CODE]class man: def …

Member Avatar for iLikeSunshine
0
72
Member Avatar for Rejinacm

When i used a global variable in my supplement file and imported it in a top-level file i got AttributeError.Why? eg: file1.py global i i =10 file2.py import file1 print 'i in file1 %d' %file1.i Aso,i was not able to use file1.i when i used from ie; from file1 import …

Member Avatar for Lardmeister
0
70
Member Avatar for istib

Dear all, I've been struggling with an issue whilst scraping a site that has both roman and arabic (and asian characters too, it seems). I want to extract those entries that are English, hence that don't contain foreign letters. I've been reading into some Unicode guides but can't get my …

0
42
Member Avatar for icu222much

I am trying to find a way to control the amount my variable 'i' increments by so I decided to include the code 'i = i + 1' within the for loop. My idea was that as my loop would run, it would print the 'i' values '1, 3, 5, …

Member Avatar for icu222much
0
203
Member Avatar for breatheasier

Hi, I'm making a program in VPython to simulate the motion of particles. It's fairly simple in theory but I'm having some problems with my lists of particles. What I'm trying to do is make sure that the particles do not overlap, and regenerate a position if they do overlap. …

Member Avatar for BearofNH
0
154
Member Avatar for RMartins

How can we in python change the number of elements in a line to the next, this is, for example... We have the following txt file: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 And we want a program which the output …

Member Avatar for woooee
0
91
Member Avatar for karthik.c
Member Avatar for scru
0
20K
Member Avatar for curiouskitten

i need help understanding how to fix my code (But please no explicit answers, I really need to understand.) I need to create a program (I'm using IDLE) that will count the number of characters in a given sentence WITHOUT counting spaces. So far I have: [CODE] S = raw_input("Enter …

Member Avatar for oldSoftDev
0
104
Member Avatar for beanryu

I start learning about python, so i read the tutorial: they show this: >>> x = int(raw_input("Please enter an integer: ")) Please enter an integer: 42 >>> if x < 0: ... x = 0 ... print 'Negative changed to zero' ... elif x == 0: ... print 'Zero' ... …

Member Avatar for breatheasier
0
2K
Member Avatar for sony_b

I am trying to write a python script that can take a word from one file and transfer it to a specific location in another file. for example, lets say i have a file called hb15b.txt and it includes the following: MODIFY-USER 2671, "hb15b01", " UGz9", 1, How can i …

Member Avatar for woooee
0
141
Member Avatar for Ene Uran

For the second year running Python has been selected as the Language of the Year by Linux users: [code] Linux Users' Programming Languages of the Year 2008 PHP 115 13.36% Perl 72 8.36% Python 226 26.25% Ruby 46 5.34% C 114 13.24% C++ 129 14.98% Java 106 12.31% Lisp 9 …

Member Avatar for breatheasier
0
143
Member Avatar for scoob_m

Hello, I have a code file from the boto framework pasted below, all of the print statements are mine, and the one commented out line is also mine, all else belongs to the attributed author. My question is what is the order in which instantiations and allocations occur in python …

Member Avatar for jrcagle
0
100
Member Avatar for mahela007

I want to copy some files using python. Can someone tell me how to use the shutil.copy() command properly? thanks

Member Avatar for Ene Uran
0
204
Member Avatar for MaxVK

Hi, I have written a nice little editor using the RichTextCtrl, and so far everything is working fine, however, for some reason the delete key does not work as expected. If I select something and hit delete then the selection is removed, but if I click anywhere in the text …

Member Avatar for MaxVK
0
130
Member Avatar for karthik.c

hi guys wat if List is equivalent 2 Arrays in c or do we have Arrays seperately defined in python??

Member Avatar for karthik.c
0
183
Member Avatar for ihatehippies

How do you bind something like a listbox to an event, but keep that events default actions... ie when you bind a listbox to EVT_RIGHT_DOWN it overrides the SetSelection method that is normally called. I'm trying to call a popup menu on the right down event but I also want …

Member Avatar for lllllIllIlllI
0
92
Member Avatar for juzzy

is it possible, well yes of course its possible, but does anyone know the best way to alter the colour of a word within a sentence in a wxpython window. I know how to change the colour of the entire text but not a specific word. So for instance if …

Member Avatar for juzzy
0
1K
Member Avatar for scru

Does Python have a concept of class properties (static properties if you may)? I know there are class attributes, but I can't just use one. It's very critical that I control what values can bet set as the class attribute, which I can use the property setter to do.

Member Avatar for Ene Uran
0
99
Member Avatar for mahela007
Member Avatar for lllllIllIlllI
0
646
Member Avatar for eyewirejets

I'm trying to restrict the users input to the selected characters only. "W" "w" or "L" "l" Anything else entered, an error message should display. Can anyone please look at this and tell me what I'm doing wrong? Thank you [CODE] # User Enters either W = Win and L …

Member Avatar for jrcagle
0
116
Member Avatar for mahela007

Hi.. this is my first post on these forums. I learn python as a hobby. Will learning sequential programming be sufficient for my needs? (I won't be pursuing a career in programming. I just do it so that I can keep my self busy and because I like programming with …

Member Avatar for jrcagle
0
78
Member Avatar for scru

I know Python introspection feature are powerful, what I can't seem to figure out is how to get the name of the current class. Example: class Foo: def bar(self): print(classname) Then my output should be `Foo`. Bonus points if I can get which module it resides in too. Thanks!

Member Avatar for Ene Uran
0
133
Member Avatar for mahela007

I have installed python 3 on my kubuntu PC. However as the default version of python on kubuntu is 2.5 Idle uses python 2.5 instead of the newly installed python 3 (i used the "python3.0" package for installing python and "idle" package for IDLE when i was installing using synaptic …

Member Avatar for Ene Uran
0
65
Member Avatar for curiouskitten

I am a beginner python programmer and need some help with this problem. To provide a code that will lowercase all consonants and upper case all vowels. Needs to be a relatively simple code (like 2-3 lines lol) For example i have started this: S=raw_input("Enter Sentence: ") print S.upper() # …

Member Avatar for Ene Uran
0
11K
Member Avatar for trihaitran

I just reinstalled OS X 10.5 Leopard on my laptop and restored my data/applications from a Time Machine backup. When I use urllib.urlopen() I get the following error: [code] >>> import urllib >>> u=urllib.urlopen(aUrl) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib.py", line 82, in …

Member Avatar for trihaitran
0
131
Member Avatar for thehivetyrant

I have currently built a database (based on IMDB) that i can add dictionaries too, list them and exit. [B]I will put the program so far at the bottom of the page, just paste it in and run ti to see what it's like.[/B] I am trying to add a …

Member Avatar for thehivetyrant
0
119

The End.