Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #37298

Re: Using filepath method to identify an .html page

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <d@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'argument': 0.04; 'base.': 0.05; 'arguments': 0.07; 'filename': 0.07; 'function,': 0.07; 'only,': 0.07; 'plenty': 0.07; 'behave': 0.09; 'encode': 0.09; 'given,': 0.09; 'integer,': 0.09; 'literal': 0.09; 'prefixed': 0.09; 'subject:method': 0.09; 'surrounded': 0.09; 'zero.': 0.09; 'stored': 0.10; '(but': 0.15; '-16': 0.16; '16.': 0.16; '4-digit': 0.16; 'advice,': 0.16; 'literal,': 0.16; 'literals': 0.16; 'optionally': 0.16; 'radix': 0.16; 'range,': 0.16; 'skip:1 40': 0.16; 'truncates': 0.16; 'whitespace.': 0.16; 'string': 0.17; 'wrote:': 0.17; 'integer': 0.17; 'string,': 0.17; 'subject:page': 0.17; 'unicode': 0.17; '(or': 0.18; 'code.': 0.20; 'error.': 0.21; 'displayed': 0.22; 'int,': 0.22; 'interpret': 0.22; 'produces': 0.22; 'for?': 0.23; 'long,': 0.24; 'tried': 0.25; 'header:In- Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'values': 0.26; 'am,': 0.27; 'plain': 0.27; 'instead.': 0.27; "doesn't": 0.28; 'actual': 0.28; 'represent': 0.28; 'base,': 0.29; 'convert': 0.29; 'words': 0.29; 'function': 0.30; 'point': 0.31; 'towards': 0.32; 'url:python': 0.32; 'quickly': 0.32; 'page.': 0.33; "aren't": 0.33; 'correctly.': 0.33; 'point,': 0.33; 'subject: .': 0.33; 'to:addr:python-list': 0.33; '(with': 0.33; 'built-in': 0.35; 'described': 0.35; 'especially': 0.35; 'table': 0.35; 'there': 0.35; 'but': 0.36; 'url:org': 0.36; 'url:library': 0.36; 'thank': 0.36; 'why': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'url:docs': 0.38; 'page': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'space': 0.39; 'received:192.168': 0.40; 'think': 0.40; 'link': 0.60; 'visit': 0.64; '10.': 0.64; 'charset:windows-1252': 0.65; 'of:': 0.65; 'pin': 0.65; 'received:74.208': 0.71; 'float,': 0.84; 'subject:Using': 0.84; 'url:functions': 0.84
Date Tue, 22 Jan 2013 11:11:35 -0500
From Dave Angel <d@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2
MIME-Version 1.0
To python-list@python.org
Subject Re: Using filepath method to identify an .html page
References <adcfb222-a038-4700-8959-38e452c04b85@googlegroups.com> <50fe787e$0$30003$c3e8da3$5496439d@news.astraweb.com> <f4298c6f-81a2-45c7-903b-015e9f17d5a7@googlegroups.com> <mailman.784.1358857784.2939.python-list@python.org> <mailman.785.1358858844.2939.python-list@python.org> <50fe8e69$0$30003$c3e8da3$5496439d@news.astraweb.com> <0459659d-4ec2-4c7d-bee3-b4e363c916dd@googlegroups.com> <mailman.790.1358865192.2939.python-list@python.org> <ec8f1a56-d0f7-46a6-a8a3-9425d3aabf8e@googlegroups.com> <mailman.796.1358868351.2939.python-list@python.org> <9d89d978-e570-4b2c-a18e-58d86c35dd4c@googlegroups.com>
In-Reply-To <9d89d978-e570-4b2c-a18e-58d86c35dd4c@googlegroups.com>
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 8bit
X-Provags-ID V02:K0:CoCidLsOdy840EapQlb/6jor3GdfC7k2/eXfJJqgL1e HmPd1zBtIYf+Hk5bTtl9F/y6G0GtP+EQPic8GanAYWFIzZeM4j /GAilAirkd1ABm/rAGkYoSX9gfTFTrNmMyzTfzemVaN80+Ut3c aEmC3awkdEbrXOgTkpkJ43vhvuIldvHGC+nIAU9cp0k8dSYRGT rHaWPdD0bX6Ms8rigSHV3blMObDrqFAcR9adjntoo3BNg1nXtX IdRB7X6YC1QneAe6qpwVtuF7N43B/Xziu4ptcWb6WsubswJuS5 GLvnjurIQsRBI67QnzAYHrkqmlQm0y6dukTKoHIo/sBMoGEOA= =
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 <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.804.1358871116.2939.python-list@python.org> (permalink)
Lines 56
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1358871116 news.xs4all.nl 6854 [2001:888:2000:d::a6]:60162
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:37298

Show key headers only | View raw


On 01/22/2013 10:46 AM, Ferrous Cranus wrote:
> Thank you but the number needs to be a 4-digit integer only, if its to be stored in the database table correctly.
>
> pin = int( htmlpage.encode("hex"), 16 )
>
> I just tried whayt you gace me
>
> This produces a number of: 140530319499494727...677522822126923116L
>
> Visit http://superhost.gr to see that displayed error. I think it
>
> Why did you use "hex" for? to encode the string to hexarithmetic? what for?
>

There are plenty of people (but not me) giving you database advice, but 
you don't want it.

Apparently you do have web access, so why aren't you looking up the 
functions that don't behave the way you think they should?

This page has the built-in functions:
     http://docs.python.org/2/library/functions.html

To get quickly to a particular function, follow the link from the 
function name at the top of that page.

""""""
int(x=0)
int(x, base=10)
Convert a number or string x to an integer, or return 0 if no arguments 
are given. If x is a number, it can be a plain integer, a long integer, 
or a floating point number. If x is floating point, the conversion 
truncates towards zero. If the argument is outside the integer range, 
the function returns a long object instead.

If x is not a number or if base is given, then x must be a string or 
Unicode object representing an integer literal in radix base. 
Optionally, the literal can be preceded by + or - (with no space in 
between) and surrounded by whitespace. A base-n literal consists of the 
digits 0 to n-1, with a to z (or A to Z) having values 10 to 35. The 
default base is 10. The allowed values are 0 and 2-36. Base-2, -8, and 
-16 literals can be optionally prefixed with 0b/0B, 0o/0O/0, or 0x/0X, 
as with integer literals in code. Base 0 means to interpret the string 
exactly as an integer literal, so that the actual base is 2, 8, 10, or 16.

The integer type is described in Numeric Types — int, float, long, complex.
""""""""

Are there words in there which are unclear?  A filename is a string, but 
it doesn't represent an integer literal in any base, and especially not 
in base 10.



-- 
DaveA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 02:07 -0800
  Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 11:31 +0000
    Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 03:53 -0800
      Re: Using filepath method to identify an .html page Chris Angelico <rosuav@gmail.com> - 2013-01-22 23:26 +1100
    Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 04:02 -0800
      Re: Using filepath method to identify an .html page Lele Gaifax <lele@metapensiero.it> - 2013-01-22 13:22 +0100
      Re: Using filepath method to identify an .html page Dave Angel <d@davea.name> - 2013-01-22 07:29 -0500
        Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 04:47 -0800
          Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 04:50 -0800
          Re: Using filepath method to identify an .html page Chris Angelico <rosuav@gmail.com> - 2013-01-22 23:59 +1100
          Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 04:50 -0800
        Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 04:47 -0800
          Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 13:04 +0000
            Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 05:57 -0800
              Re: Using filepath method to identify an .html page Chris Angelico <rosuav@gmail.com> - 2013-01-23 01:33 +1100
                Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 06:55 -0800
                Re: Using filepath method to identify an .html page Dave Angel <d@davea.name> - 2013-01-22 10:05 -0500
                Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 07:21 -0800
                Re: Using filepath method to identify an .html page Chris Angelico <rosuav@gmail.com> - 2013-01-23 02:27 +1100
                Re: Using filepath method to identify an .html page Michael Torrie <torriem@gmail.com> - 2013-01-22 11:36 -0700
                Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 23:40 +0000
                Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 23:40 +0000
                Re: Using filepath method to identify an .html page Michael Torrie <torriem@gmail.com> - 2013-01-22 17:07 -0700
                Re: Using filepath method to identify an .html page MRAB <python@mrabarnett.plus.com> - 2013-01-23 00:40 +0000
                Re: Using filepath method to identify an .html page rusi <rustompmody@gmail.com> - 2013-01-22 18:55 -0800
                Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-23 02:50 +0000
                Re: Using filepath method to identify an .html page rusi <rustompmody@gmail.com> - 2013-01-22 19:04 -0800
                Re: Using filepath method to identify an .html page Chris Angelico <rosuav@gmail.com> - 2013-01-23 15:44 +1100
                Re: Using filepath method to identify an .html page Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-01-22 22:15 -0500
                Re: Using filepath method to identify an .html page MRAB <python@mrabarnett.plus.com> - 2013-01-23 03:35 +0000
                Re: Using filepath method to identify an .html page Michael Torrie <torriem@gmail.com> - 2013-01-22 22:10 -0700
                Re: Using filepath method to identify an .html page Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-01-23 01:13 -0500
                RE: Using filepath method to identify an .html page "Leonard, Arah" <Arah.Leonard@bruker-axs.com> - 2013-01-23 16:33 +0000
                Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-23 08:51 -0800
                RE: Using filepath method to identify an .html page "Leonard, Arah" <Arah.Leonard@bruker-axs.com> - 2013-01-23 18:19 +0000
                Re: Using filepath method to identify an .html page Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-01-23 18:36 +0000
                Re: Using filepath method to identify an .html page Dave Angel <d@davea.name> - 2013-01-23 17:46 -0500
                Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-23 08:51 -0800
                Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 23:34 +0000
                Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 23:35 +0000
                Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 23:34 +0000
                Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 23:36 +0000
                Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 23:36 +0000
                Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 23:37 +0000
                Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 23:39 +0000
                Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 23:38 +0000
                Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 23:39 +0000
                Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 23:37 +0000
                Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 23:38 +0000
                Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 23:39 +0000
                Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 23:36 +0000
                Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 23:35 +0000
                Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 23:37 +0000
                Re: Using filepath method to identify an .html page Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-01-22 16:44 -0500
                Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 07:21 -0800
                Re: Using filepath method to identify an .html page Chris Angelico <rosuav@gmail.com> - 2013-01-23 02:07 +1100
                Re: Using filepath method to identify an .html page Peter Otten <__peter__@web.de> - 2013-01-22 16:25 +0100
                Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 07:46 -0800
                Re: Using filepath method to identify an .html page Dave Angel <d@davea.name> - 2013-01-22 11:11 -0500
                RE: Using filepath method to identify an .html page "Leonard, Arah" <Arah.Leonard@bruker-axs.com> - 2013-01-22 16:23 +0000
                Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 10:13 -0800
                Re: Using filepath method to identify an .html page Michael Torrie <torriem@gmail.com> - 2013-01-22 11:43 -0700
                Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 10:13 -0800
                Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 07:46 -0800
                Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 07:59 -0800
                Re: Using filepath method to identify an .html page Chris Angelico <rosuav@gmail.com> - 2013-01-23 03:11 +1100
                Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 10:26 -0800
                Re: Using filepath method to identify an .html page MRAB <python@mrabarnett.plus.com> - 2013-01-22 18:49 +0000
                Re: Using filepath method to identify an .html page Michael Torrie <torriem@gmail.com> - 2013-01-22 11:49 -0700
                Re: Using filepath method to identify an .html page Dave Angel <d@davea.name> - 2013-01-22 14:00 -0500
                Re: Using filepath method to identify an .html page Peter Otten <__peter__@web.de> - 2013-01-22 20:16 +0100
                Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 23:25 -0800
                Re: Using filepath method to identify an .html page Michael Torrie <torriem@gmail.com> - 2013-01-23 08:25 -0700
                Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-23 07:56 -0800
                Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-23 07:56 -0800
                Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 23:25 -0800
                Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 10:26 -0800
                Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 07:59 -0800
                Re: Using filepath method to identify an .html page John Gordon <gordon@panix.com> - 2013-01-22 16:55 +0000
                Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 10:07 -0800
                Re: Using filepath method to identify an .html page John Gordon <gordon@panix.com> - 2013-01-22 18:37 +0000
                Re: Using filepath method to identify an .html page Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-01-22 17:01 -0500
                Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 23:23 +0000
                Re: Using filepath method to identify an .html page rusi <rustompmody@gmail.com> - 2013-01-22 09:33 -0800
                Re: Using filepath method to identify an .html page Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-01-22 17:54 +0000
                Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 10:23 -0800
                Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 22:45 +0000
                Re: Using filepath method to identify an .html page Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-22 22:44 +0000
                Re: Using filepath method to identify an .html page Mitya Sirenef <msirenef@lightbird.net> - 2013-01-22 19:23 -0500
                Re: Using filepath method to identify an .html page Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-22 06:55 -0800
  Re: Using filepath method to identify an .html page Michael Torrie <torriem@gmail.com> - 2013-01-22 11:21 -0700
  Re: Using filepath method to identify an .html page alex23 <wuwei23@gmail.com> - 2013-01-22 17:27 -0800

csiph-web