15,175 Topics

Member Avatar for
Member Avatar for awa

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 …

Member Avatar for awa
0
267
Member Avatar for Stefano Mtangoo

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 …

0
71
Member Avatar for mahela007

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 …

Member Avatar for djidjadji
0
171
Member Avatar for blunsky

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 …

0
40
Member Avatar for AutoPython

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.

Member Avatar for vegaseat
0
66
Member Avatar for AutoPython

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?

Member Avatar for AutoPython
0
300
Member Avatar for vlady

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 …

Member Avatar for vlady
0
3K
Member Avatar for i are smart

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 …

Member Avatar for sneekula
0
249
Member Avatar for chico2009

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 …

Member Avatar for chico2009
0
181
Member Avatar for Benderbrau

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 …

Member Avatar for Gribouillis
0
159
Member Avatar for Barefootsanders

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 …

Member Avatar for Stefano Mtangoo
0
152
Member Avatar for Tommy_101

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 …

Member Avatar for Tommy_101
0
204
Member Avatar for optikali

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 …

Member Avatar for sneekula
0
187
Member Avatar for sneekula

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.

0
230
Member Avatar for leegeorg07

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

Member Avatar for leegeorg07
0
86
Member Avatar for ravi_72

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

Member Avatar for Stefano Mtangoo
0
104
Member Avatar for PYGUY

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 …

Member Avatar for PYGUY
0
1K
Member Avatar for AutoPython

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 …

Member Avatar for AutoPython
0
190
Member Avatar for computerfreak97

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 …

0
47
Member Avatar for dbmikus

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 …

Member Avatar for dbmikus
0
229
Member Avatar for lllllIllIlllI

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! :)

Member Avatar for sneekula
0
207
Member Avatar for klabak85

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 …

Member Avatar for jice
0
146
Member Avatar for Caleb2419

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 …

Member Avatar for Caleb2419
0
238
Member Avatar for ihatehippies

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 …

Member Avatar for ihatehippies
0
133
Member Avatar for stratodavius

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 …

0
54
Member Avatar for hwd888

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

0
85
Member Avatar for somekid413

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 …

Member Avatar for god0fgod
0
344
Member Avatar for lifeworks

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 …

Member Avatar for sravan953
0
164
Member Avatar for edward_pedro

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 …

Member Avatar for vegaseat
0
148
Member Avatar for chase32

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 …

Member Avatar for vegaseat
0
201

The End.