565 Posted Topics
Re: This is a quick and easy way to check if a word is palindrome. [CODE]''' Created on Feb 20, 2012 @author: sin ''' def lff(file): line = open(file).read().splitlines() for i in range(0, len(line)): if str(line[i]).lower() == str(line[i]).lower()[::-1]: print "'" + str(line[i]) + "'", "is palindrome." else: print "'" + str(line[i]) … | |
Re: and your question is?... It is for the best possibly to post some of your code as well, so that we know something relating to this error... | |
Re: use this instead [code] path=raw_input("Path: ")+'.txt' x=1000 with open(path, 'rb') as fileobj: ... [/code] | |
So, even thou I have searched throughout the forums, I couldn't get a clear answer, maybe perhaps I'm a noob @ Python. As a beginner, I don't know much about Python, and it's frustrating to search the net and not find the actual answer. So, I'm working on this project, … | |
Re: have you tried this version of PIL? [url]http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil[/url] it's for windows 64. I had some similar problems with my PIL, having my OS on 64 and that library on 32 bits... Duno... | |
Re: perhaps it is better if you use [code]int(raw_input:)[/code] than [code]int(input:)[/code] input already returns the integer value, there's no need for an int in front of the input, but if you want to use raw_input, and still use the value as an integer, you must use int(raw_input). From the latest versions … | |
Re: Maybe this will help you: [code] filename='name.txt' fh = open(filename, 'r') line = open(filename).read().splitlines() for ln in line: print ln """ My output: Neuman, Alfred E. Stevenson, Robert Lewis Lewis, C.S. Doe, Jane Bush, George Herbert Walker """ [/code] It should handle middle names with no problem, I guess...:D | |
Re: [COLOR="Red"]Please use an adequate posting using the [B][ code][ /code][/B] tags.[/COLOR] [B]Stannum post:[/B] [code]#include<iostream.h> #include<conio.h> #include<stdio.h> #include<stdlib.h> #include<string.h> void hangman(int ); int display(char [], int&); int input(char [], char&, int , int); int l; void main() { clrscr(); int n,pos=0, s=0 ; char num[50],ch, M [][50]={ "oman holiday","breakfast at tiffany's", … | |
Re: I've look into your assignment and I've come up with a possible module. I'll post the code below, and an attachament with the .txt containing the positions. Please, report me if there were any bugs inside the program, 'cose I'm a noob @ Python, and I don't want to miss … | |
Re: I don't think that you have there a nested list. [code]regels = ['Auto','Brandstof auto',' tinq ',' shell ',' tank s ',' dap ',' slump oil ','q8 ','brand oil',' bp lemmer '], ['Huishouden','Boodschappen',' poiesz ',' spar ','super de boer','c 1000',' aldi ',' albert heyn ','breimer ',' keurslager',' bakkerij '] [/code] Here … | |
I have this code, it's basically a program which I wrote, a 'Guess my number' game. The only problem is that I did something, and now I can't choose from my options anything else, that the first option. I put all my conditions in the while True loops, and now … | |
Re: A way to do this is with dictionaries, so that you can store your values from the sequential file. You will have then the key and the values. For more information about dictionaries, visit [url]http://docs.python.org/library/stdtypes.html#dict[/url] , or read the Python Manual which came with your installer, or the online Python … | |
Re: Ok, so I've looked over your assignment, and I've come up with this. I don't know if it really helps you, but here goes. [CODE]''' Created on Feb 15, 2012 @author: sin ''' import Image, ImageDraw #As a first thing, you must have the third party graphics libraries. #You can … | |
[CODE]def prel(x, i, j): if (i < j - 1): k1 = (j - i + 1) / 3 k2 = 2 * k1 prel(x, i, i + k1) prel(x, i + k1 + 1, i + k2) prel(x, i + k2 + 1, j) for k in range(i, j): … | |
Re: How about Approximately 217.000.000 results(0,26 seconds)... And I found some websites... |
The End.