A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/105631.html below:

How to restrict the base when using string.atoi() in converting string to number in base?

How to restrict the base when using string.atoi() in converting string to number in base? How to restrict the base when using string.atoi() in converting string to number in base?EdwardT edwardt at trillium.com
Mon Apr 16 19:42:21 EDT 2001
Hi I have a funciton that converts number written in hex to numerical value.

I use code like:

string.atoi(inputString,16) to do it.

For example:

0X06

shall be converted to 6.

But I want to restrict user from using 0A06, 0a08 etc; only allows the
decimal case or the hex case, ie. 6,06,006, 0X06, 0x06 shall all be allowed
.....

How can I do that?

Thanks




More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4