15,181 Topics
| |
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 … | |
Given a list of integers, generate the list of the corresponding floats. | |
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 … | |
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' ... … | |
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 … | |
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 … | |
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 … | |
I want to copy some files using python. Can someone tell me how to use the shutil.copy() command properly? thanks | |
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 … | |
hi guys wat if List is equivalent 2 Arrays in c or do we have Arrays seperately defined in python?? | |
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 … | |
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 … | |
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. | |
Why is inheritance an important aspect of object oriented programming? | |
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 … | |
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 … | |
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! | |
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 … | |
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() # … | |
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 … | |
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 … | |
Several things have led me to writing this post However, late last week I did some poking around in the Windows C API from ctypes (not using pywin32) for a project I was finishing up, and I [I]loved it[/I]! Since then I've been playing around with ctypes and Windows function … | |
I have to write a program which generates a pascal's triangle. The user inputs the height of the triangle and it supposed to generate one. This is what I have so far and I don't know how you would keep adding rows after the second one. I'm so lost :( … | |
hi...can somebody give me a little help here. i get error message : 'file' object is not callable its a program that call shell script (shell script run "fusion.deb"). here`s the code: test.py [CODE]#!/usr/bin/env python import sys import os try: import pygtk pygtk.require("2.0") except: pass try: import gtk import gtk.glade … | |
I have Dictionary that I update time after time and the dictionary result get inserted to the wxListCtrl in report mode. The problem comes when I insert new data. It seems that the unicode character (u') is also get inserted as part of data. Is there any way to strip … | |
i need to be able to have python spit out a date like this (mm/dd/yyyy) even if the user doesnt add the "/" to there input. here is what i got so far. import string date = raw_input(enter your date:") print date[0:2]+'/',date[2:4]+'/',date[4:8] the output is mm/ dd/ yyyy. how would … | |
How to redirect to another page (for Example: to my login page) using python. | |
hey everyone. i am writing a program in python w/ Tkinter and ran into a problem with padding. So, i have a Label object named DataPool_Text. when I run it (side=TOP), it goes to the top middle of the screen. I know how to use padx, but what would I … | |
I have been asked the following: create inputs for a half-adder using python and the outputs i expect. I was hoping someone could just have a look at this for me and see if i've got the right idea. This will work from a copy and paste straight off the … | |
I am trying to create an array of integers from a list of strings to do some calculations, but all I can get is an array of strings or an error. Does numpy have any functions to do this? any help at all would be much appreciated. infile: 23 CL … |
The End.