10 Solved Topics
Remove Filter Assuming that every person has a National ID number, I am trying to check if the Entered number is a valid ID number, under these conditions: 1. ID number must be of 10 digits length. 2. If ID length is greater than/equal to 8 and less than 10 digits, add … | |
This is me with another project for beginners :) The Project as stated by ZZucker about 2 months ago: "Given the length of three sides, write a function that checks if it is possible to create a triangle." I could solve it with an annonymus function like this: is_triangle = … | |
This is and answer to one of the Vegaseat's recent projects for beginners. I share my solution here because -as a begginer and do learn python as a hobby- I need your feedback. So please tell me am I doing it the right way? Thanks in advance for comments from … | |
How the following code can be rewritten in a better way? #!/usr/bin/env python """Simple program for finding popular names over last 100 years, in response to vegaseat's last post in Projects for Beginners(9/1/2012). It first lists the popular names and then search for entered name by user""" oldnames = """Mary,Helen,Margaret,Anna,Ruth … | |
Hi I found this script from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/189858 it uses getopt module for managing cmd arguments, but I need it to work on mobile phones. I want to make a Mobile app using this script but I cant figure out how to change the comand Args to simple raw_inputs. can somebody … | |
I tried many times but no luck. I want to parse a text file with a vcard format (from my phone contacts). the text file looks like this: BEGIN:VCARD VERSION:2.1 REV:20110913T095232Z UID:aac119d5fe3bc9dc-00e17913379d6cc8-3 N;X-EPOCCNTMODELLABEL1=First name:;[B]Maj[/B];;; TEL;VOICE:[B]09120000000[/B] X-CLASS:private END:VCARD BEGIN:VCARD VERSION:2.1 REV:20110228T083215Z UID:aac119d5fe3bc9dc-00e17b0693898c98-4 N;X-EPOCCNTMODELLABEL1=First name:;[B]Ali jahan[/B];;; TEL;VOICE:[B]09120000001[/B] X-CLASS:private END:VCARD BEGIN:VCARD VERSION:2.1 REV:20110228T083510Z … | |
Hi All How can I select some random names from a list, so that in next time, those previously selected names become omitted from the list? for example, say we have 100 names in test.txt file, and we want to select 3 names randomly. then by recalling the selection function, … | |
Hi All When trying to open a URL with bellow code, it Gives "TypeError: not all arguments converted during string formatting" [CODE=python]import urllib City="%D9%85%D9%87%D8%B1%D8%A7%D9%86" Province="%D8%A7%DB%8C%D9%84%D8%A7%D9%85" myurl = 'http://www.owghat.com/owghat.png.aspx?Province='+'%s'+'&City='+'%s'%(Province, City) #the real address is:http://www.owghat.com/owghat.png.aspx?Province=%D8%A7%DB%8C%D9%84%D8%A7%D9%85&City=%D9%85%D9%87%D8%B1%D8%A7%D9%86 a="e:\\img.png" urllib.urlretrieve(myurl,a)[/CODE] So, what I'm doing wrong? AND Another question: How to encode a utf-8 string(example: مهران) … | |
Hi All Please some one Help me find out why this code doesn't work: [code=python]codes=['zlib', 'zip', 'base64', 'hex', 'utf-8'] def encoder(str, i): return str.encode(codes[i]) def decoder(str, i): return str.decode(codes[i]) en = encoder('Some string here', 2) print en[/code] | |
Hello All This is my first post in this forum, despite my long visiting hours as a guest:D I don't have any background in programming and I'm a newbie in python too. But Learning python for S60(Python distro for Symbian Phones. anyway, I have a problem with printing from two … |
The End.