15,175 Topics
| |
Hi, I have the following problem: I would like to read from a file between to keywords (KEY1 and a line consisting of ------), skipping 4 lines after the first keyword. What I have is the following: [CODE]import re import string infileName = raw_input("filename ") infile = open(infileName, 'r') data … | |
I have been thinking if this is only possible to very very very advanced wxPyees. I have tried and tried to understand this but with no success. I have seen Mike saying the same in wxpy listing and many more. I have started this to hear your experience with printing … | |
I'm a bit confused as to how variables (or fields) of classes are handled in python. I'll give a small example of what I mean. [CODE] class Cow: # the first class that popped into my head legs = 4 moo = cow() [/CODE] now, moo.legs will return 4 and … | |
Hi, I'm running a PCM-9375 system with Linux Debian 5.0.0. I am currently running a a python application on the system continuously, and our system seems to be resetting approximately every 24 hours (not at midnight, but 24 hours from whenever the system was started). I am not sure whether … | |
I have a weird glitch or something, whenever I try to start turtle graphics from the shell it goes unresponsive, but when I run the program in a console window it works. This is really annoying me! Any help would be appreciated. | |
Okay, I am confused on the global statement. To my knowledge it lets you easily access variables from a function to be used in the session. Now someone said that it's useless and you shouldn't use it in your code. Is this true? | |
hello, pls can somebody show me a way how to solve the following exercise: A number, a, is a power of b if it is divisible by b and a/b is a power of b. Write a function called is_power that takes parameters a and b and returns True if … | |
in Vista, cTurtle worked like a charm, but in Ubuntu, when i downloaded the cTurtle to my desktop and moved it to site-packages, it still won't work. When i clicked on the downloaded cTurtle.py file, what i get is a text file with chinese characters, and it closes within a … | |
Hi All Could you please help me with the following, #Convert C to F def Tc_to_Tf (): Tc = input ("What is the Celsius Temperature ? " ) Tf = 9.0/5.0 * Tc + 32 print 'The temperature is ', Tf, ' Degrees Fahrenheit' I get NameError: name 'Tf' is … | |
Hello, I'm posting this code so that maybe it will help someone else in the future. I spent about a week trying to figure this out, and Google searches were not helping. Hopefully anyone else wondering about this will see this post on a Google result. The program I finished … | |
Hi all, I have a php/mysql based site set up. I want to keep my database layer updated via a python script that will query some other systems, parse data and make the appropriate CRUD calls to my database. My question is might be a simple one but I'm wondering … | |
Hi, I've been trying to create a program that gets wikipedia pages, and lists all the links found in the page source. I've used the urllib.urlopen() method to do this, and unfortunately I've run into a little problem. Instead of getting the actual page like say the main page, or … | |
So below is my first attempt at using user input, but I can't figure out how to get the input (at the bottom) to plug into my function definitions. I have no proper python training and am attempting to learn on my own with some books. I would appreciate any … | |
If you own a stopwatch, here is your chance to benchmark the various versions of Python on recursion performance. The Ackermann function gives the old computer quite a workout. | |
| HI, I recently looked at sneekula's ticker code, and I was wondering about any good graph extras, to show it in a simpler form, also any tutorials if at all possible, thanks in advance |
Hello all We are using subversion as our source repository and trying to backup the repo using Subversion hotbackup.py script I am very much new to python scripting and trying to understand the below error message IOError: [Errno 13] Permission denied Exception IOError: (13, 'Permission denied') in <bound method ZipFile.__del__ … | |
HI, I've got a list of 10 websites in CSV. All of the sites have the same general format, including a large table. I only want the the data in the 7th columns. I am able to extract the html and filter the 7th column data (via RegEx) on an … | |
The title doesn't really make sense, as a number with some thing like .23238382 attached to the back of it isn't an integer, but that's not the point. I want to make a program that places commas in the correct position in a number you give. Well, in some of … | |
| I am trying to develop a program using pygame that will let you "paint." There is just one problem, when I change the RGB values, all of the pixles change!!! Please HELP!!! Code: [CODE] import pygame, os pygame.init() pygame.display.init() screen = pygame.display.set_mode((830, 620)) draw = 0 selected = 0 points … |
I am writing a function to extract decimals from a number. Ignore the exception and its syntax, I am working on 2.5.2 (default Leopard version). My function does not yet handle 0's. My issue is, the function produces random errors with certain numbers, and I don't understand the reason. I … | |
This code shows an example of using recursion to simply solve a problem. Note though, it can take a long time to do larger numbers such as the 50th fibonacci numbers this way. Hope this helps! :) | |
Hi all, I'm a completely new user of python (and by new I mean I started using it yesterday) but I've been programming for a couple of years now in other languages such as Java. I have a question to ask you all. So what I want to do is … | |
I was given an assignment to create a high/low program (well, the first part anyway) that fulfills the following pseudocode: • Print instructions to the user • Start with the variables high = 1000, low = 1, and tries = 1 • While high is greater than low ◦ Guess … | |
My app works fine when its a .py file, however as soon as I compile it with py2exe 0.6.9 I get LookupErrors when using the email MIME library. I tried including the "packages": ["encodings"] option in py2exe but to no avail. I'll post the relevant code and traceback. (note: not … | |
Hello everyone: This is my first post on the site -- so if you think this post is misplaced or not formatted correctly or whatever, please let me know. Please accept my apologies in advance. My issue? I'm trying to integrate a Python script to help automate tasks we use … | |
I am new one for python web service. I need to switch the below java webservice client source code to python.Two services. One is systemService, the other is queueService. It needs to maintain session for queueService to use the connection to inews server in systemService . Who can help me? … | |
so I have a script that is taking input from a text file and using it to populate an excel spreadsheet. it keeps giving me a UnicodeDecodeError, dying on the ± symbol, I'm assuming its not in the codec that is being used: im using the xlwt package for writign … | |
Hi Ive been working with PHP, AS3 and some javascript for a while now, and want to move into something that allows me to develop desktop apps... I considered Java, but have become used to PHP's loose typing or whatever the technical name is, and so after some investigation Python … | |
Hey all. I'm new to this forum and Python. I need a program that can search an inputted keyword through all the files that end with the ".txt" extension inside a given folder. The output should include the name of the files which contain the keyword, the sentences which contain … | |
I am trying to combine two multi-element dictionaries but am running into a problem. From the example below, what I expected was the dictionary x to contain all three unique combinations. What seems to have happened is that the y dictionary overwrote the x dictionary. Am I just using this … |
The End.