Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #53889
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <mohsen@pahlevanzadeh.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.131 |
| X-Spam-Level | * |
| X-Spam-Evidence | '*H*': 0.75; '*S*': 0.01; 'subject:question': 0.10; 'def': 0.12; 'function?': 0.16; 'persian': 0.16; 'skip:[ 40': 0.16; 'skip:[ 50': 0.16; 'all,': 0.19; 'question': 0.24; 'equivalent': 0.26; 'skip:" 20': 0.27; 'function': 0.29; 'list:': 0.30; "skip:' 10": 0.31; 'yours,': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'mailing': 0.39; 'read': 0.60; 'show': 0.63; 'such': 0.63; 'dear': 0.65; 'reverse': 0.68; 'useful.': 0.68; 'skip:/ 30': 0.84; 'gift': 0.85 |
| DKIM-Signature | v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=pahlevanzadeh.org; s=default; h=Content-Transfer-Encoding:Mime-Version:Content-Type:Date:To:From:Subject:Message-ID; bh=UGtoW2s0sS54qOFupsx/Ahtq0mZX9/lIX+YRV/80zUk=; b=m/viri2BldShoOeUX/dgYTLeeTwz3FpBeyTjiwFlO2M8q11y31HN7a1KvQtuhAHpLZMU4iS7Gx2wYRYs2L0PcdE+dyFMlhD5NJAgLlj6iBooClqqo4H1rw376A4GJoiSPo9RMEZSpHH3nO7sfLga3c78Iil9bcdq7dq2juw62J8=; |
| Subject | a gift function and a question |
| From | Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> |
| To | python-list@python.org |
| Date | Tue, 10 Sep 2013 00:40:59 +0430 |
| Content-Type | text/plain; charset="UTF-8" |
| X-Mailer | Evolution 3.4.4-4+b1 |
| Mime-Version | 1.0 |
| Content-Transfer-Encoding | 8bit |
| X-AntiAbuse | This header was added to track abuse, please include it with any abuse report |
| X-AntiAbuse | Primary Hostname - part7.royal-servers.com |
| X-AntiAbuse | Original Domain - python.org |
| X-AntiAbuse | Originator/Caller UID/GID - [47 12] / [47 12] |
| X-AntiAbuse | Sender Address Domain - pahlevanzadeh.org |
| X-Get-Message-Sender-Via | part7.royal-servers.com: authenticated_id: mohsen@pahlevanzadeh.org |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.193.1378757469.5461.python-list@python.org> (permalink) |
| Lines | 27 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1378757469 news.xs4all.nl 15976 [2001:888:2000:d::a6]:58785 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:53889 |
Show key headers only | View raw
Dear all,
I have a gift for mailing list:
////////////////////////////////
def integerToPersian(number):
listedPersian = ['۰','۱','۲','۳','۴','۵','۶','۷','۸','۹']
listedEnglish = ['0','1','2','3','4','5','6','7','8','9']
returnList = list()
listedTmpString = list(str(number))
for i in listedTmpString:
returnList.append(listedPersian[listedEnglish.index(i)])
return ''.join(returnList)
////////////////////////////////////
When you call it such as : "integerToPersian(3455)" , it return ۳۴۵۵,
۳۴۵۵ is equivalent to 3455 in Persian and Arabic language.When you read
a number such as reading from databae, and want to show in widget, this
function is very useful.
My question is , do you have reverse of this function? persianToInteger?
Yours,
Mohsen
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
a gift function and a question Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> - 2013-09-10 00:40 +0430
Re: a gift function and a question Steven D'Aprano <steve@pearwood.info> - 2013-09-10 07:01 +0000
Re: a gift function and a question random832@fastmail.us - 2013-09-10 09:50 -0400
Re: a gift function and a question Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-10 15:11 +0000
csiph-web