Re: Using filepath method to identify an .html page

2013-01-23 Thread Dave Angel
On 01/23/2013 01:36 PM, Mark Lawrence wrote: On 23/01/2013 18:19, Leonard, Arah wrote: 3) This is a Python-specific resource and that's not even Python code. What next? Javascript? Ada? Fortran? COBOL? 8-bit x86 assembly with minimal comments written in Esperanto? Please can we have COR

Re: Using filepath method to identify an .html page

2013-01-23 Thread Mark Lawrence
On 23/01/2013 18:19, Leonard, Arah wrote: 3) This is a Python-specific resource and that's not even Python code. What next? Javascript? Ada? Fortran? COBOL? 8-bit x86 assembly with minimal comments written in Esperanto? Please can we have CORAL 66 mentioned on the odd occasion. 4) Th

RE: Using filepath method to identify an .html page

2013-01-23 Thread Leonard, Arah
> = > my @i = split(//,$url); # put each letter in it's own bin > my $j=0; # Initailize our > my $k=1; # hashing increment values > my @m=(); # workspace > foreach my $n(@i){ >my $q=ord($n); # ASCII for character >$k += $j;

Re: Using filepath method to identify an .html page

2013-01-23 Thread Ferrous Cranus
Τη Τετάρτη, 23 Ιανουαρίου 2013 6:33:11 μ.μ. UTC+2, ο χρήστης Leonard, Arah έγραψε: > > "his quote string is Cyrillic"? > > > > > > If you're referring to the "Τη Τρίτη, 22 Ιανουαρίου 2013 6:23:16 μ.μ. > > > UTC+2, ο χρήστης Leonard, Arah έγραψε", that's Greek. > > > > > > Cyrillic or not,

RE: Using filepath method to identify an .html page

2013-01-23 Thread Leonard, Arah
> "his quote string is Cyrillic"? > > If you're referring to the "Τη Τρίτη, 22 Ιανουαρίου 2013 6:23:16 μ.μ. > UTC+2, ο χρήστης Leonard, Arah έγραψε", that's Greek. > Cyrillic or not, it's all Greek to me. ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: Using filepath method to identify an .html page

2013-01-23 Thread Ferrous Cranus
Τη Τετάρτη, 23 Ιανουαρίου 2013 5:25:36 μ.μ. UTC+2, ο χρήστης Michael Torrie έγραψε: > On 01/23/2013 12:25 AM, Ferrous Cranus wrote: > > > > > > Using that method ABC.html and CBA.html now have different values > > > because each letter position's value gets bumped up increasingly from > > > l

Re: Using filepath method to identify an .html page

2013-01-23 Thread Michael Torrie
On 01/23/2013 12:25 AM, Ferrous Cranus wrote: > > Using that method ABC.html and CBA.html now have different values > because each letter position's value gets bumped up increasingly from > left to right. You have run this little "hash" algorithm on a whole bunch of files, say C:\windows\system32

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 9:16:34 μ.μ. UTC+2, ο χρήστης Peter Otten έγραψε: > Ferrous Cranus wrote: > > > > > Τη Τρίτη, 22 Ιανουαρίου 2013 6:11:20 μ.μ. UTC+2, ο χρήστης Chris Angelico > > > έγραψε: > > > > >> all of it. You are asking something that is fundamentally > > >> impossible[1].

Re: Using filepath method to identify an .html page

2013-01-22 Thread Michael Torrie
On 01/22/2013 05:40 PM, MRAB wrote: > "his quote string is Cyrillic"? > > If you're referring to the "Τη Τρίτη, 22 Ιανουαρίου 2013 6:23:16 μ.μ. > UTC+2, ο χρήστης Leonard, Arah έγραψε", that's Greek. Oh, haha! you're so right! -- http://mail.python.org/mailman/listinfo/python-list

Re: Using filepath method to identify an .html page

2013-01-22 Thread Chris Angelico
On Wed, Jan 23, 2013 at 2:04 PM, rusi wrote: > Considering that you've fried the of all the poor "out- > of-my-control' double-posting GG users, what punishment shall we find > for you? > > Heres an idea: Use GG yourself. > It will help the group/mailing list by reducing 5-fold double-posting > t

Re: Using filepath method to identify an .html page

2013-01-22 Thread MRAB
On 2013-01-23 03:15, Dennis Lee Bieber wrote: On 22 Jan 2013 23:40:24 GMT, Steven D'Aprano declaimed the following in gmane.comp.python.general: On Tue, 22 Jan 2013 11:36:31 -0700, Michael Torrie wrote: > I'm sorry you are getting so frustrated. There's obviously a language > barrier here,

Re: Using filepath method to identify an .html page

2013-01-22 Thread rusi
On Jan 23, 7:50 am, Steven D'Aprano wrote: > On Tue, 22 Jan 2013 23:40:24 +, Steven D'Aprano wrote: > > [snip content] > > Holy crap! Sorry for the flood of duplicated posts. That was out of my > control, honest. > > -- > Steven Now Now! Considering that you've fried the of all the poor "ou

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 23:40:24 +, Steven D'Aprano wrote: [snip content] Holy crap! Sorry for the flood of duplicated posts. That was out of my control, honest. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Using filepath method to identify an .html page

2013-01-22 Thread alex23
On Jan 22, 8:07 pm, Ferrous Cranus wrote: > Hello, i decided to switch from embedding string into .html to actually grab > the filepath in order to identify it So all that crap you wrote in past threads about absolutely essentially needing to identify a html page _no matter where it was stored o

Re: Using filepath method to identify an .html page

2013-01-22 Thread MRAB
On 2013-01-23 00:07, Michael Torrie wrote: On 01/22/2013 04:40 PM, Steven D'Aprano wrote: On Tue, 22 Jan 2013 11:36:31 -0700, Michael Torrie wrote: I'm sorry you are getting so frustrated. There's obviously a language barrier here, I don't think there is. The OP's posts have been written in

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 11:36:31 -0700, Michael Torrie wrote: > I'm sorry you are getting so frustrated. There's obviously a language > barrier here, I don't think there is. The OP's posts have been written in excellent English. I think we've been well and truly trolled, by somebody who even uses

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 11:36:31 -0700, Michael Torrie wrote: > I'm sorry you are getting so frustrated. There's obviously a language > barrier here, I don't think there is. The OP's posts have been written in excellent English. I think we've been well and truly trolled, by somebody who even uses

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 11:36:31 -0700, Michael Torrie wrote: > I'm sorry you are getting so frustrated. There's obviously a language > barrier here, I don't think there is. The OP's posts have been written in excellent English. I think we've been well and truly trolled, by somebody who even uses

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 11:36:31 -0700, Michael Torrie wrote: > I'm sorry you are getting so frustrated. There's obviously a language > barrier here, I don't think there is. The OP's posts have been written in excellent English. I think we've been well and truly trolled, by somebody who even uses

Re: Using filepath method to identify an .html page

2013-01-22 Thread Mitya Sirenef
On 01/22/2013 12:33 PM, rusi wrote: On Jan 22, 8:59 pm, Ferrous Cranus wrote: >> I just need a way to CONVERT a string(absolute path) to a 4-digit unique number with INT!!! >> That's all i want!! But i cannot make it work :( > > I just need a way to eat my soup with a screwdriver. > No I WONT

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 11:36:31 -0700, Michael Torrie wrote: > I'm sorry you are getting so frustrated. There's obviously a language > barrier here, I don't think there is. The OP's posts have been written in excellent English. I think we've been well and truly trolled, by somebody who even uses

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 11:36:31 -0700, Michael Torrie wrote: > I'm sorry you are getting so frustrated. There's obviously a language > barrier here, I don't think there is. The OP's posts have been written in excellent English. I think we've been well and truly trolled, by somebody who even uses

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 11:36:31 -0700, Michael Torrie wrote: > I'm sorry you are getting so frustrated. There's obviously a language > barrier here, I don't think there is. The OP's posts have been written in excellent English. I think we've been well and truly trolled, by somebody who even uses

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 11:36:31 -0700, Michael Torrie wrote: > I'm sorry you are getting so frustrated. There's obviously a language > barrier here, I don't think there is. The OP's posts have been written in excellent English. I think we've been well and truly trolled, by somebody who even uses

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 11:36:31 -0700, Michael Torrie wrote: > I'm sorry you are getting so frustrated. There's obviously a language > barrier here, I don't think there is. The OP's posts have been written in excellent English. I think we've been well and truly trolled, by somebody who even uses

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 11:36:31 -0700, Michael Torrie wrote: > I'm sorry you are getting so frustrated. There's obviously a language > barrier here, I don't think there is. The OP's posts have been written in excellent English. I think we've been well and truly trolled, by somebody who even uses

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 11:36:31 -0700, Michael Torrie wrote: > I'm sorry you are getting so frustrated. There's obviously a language > barrier here, I don't think there is. The OP's posts have been written in excellent English. I think we've been well and truly trolled, by somebody who even uses

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 11:36:31 -0700, Michael Torrie wrote: > I'm sorry you are getting so frustrated. There's obviously a language > barrier here, I don't think there is. The OP's posts have been written in excellent English. I think we've been well and truly trolled, by somebody who even uses

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 11:36:31 -0700, Michael Torrie wrote: > I'm sorry you are getting so frustrated. There's obviously a language > barrier here, I don't think there is. The OP's posts have been written in excellent English. I think we've been well and truly trolled, by somebody who even uses

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 10:07:21 -0800, Ferrous Cranus wrote: > No, because i DO NOT WANT to store LOTS OF BIGS absolute paths in the > database. They are not big. They are tiny. Please stop being too arrogant to listen to advice from people who have been programming for years or decades. -- St

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 09:33:00 -0800, rusi wrote: > On Jan 22, 8:59 pm, Ferrous Cranus wrote: >> I just need a way to CONVERT a string(absolute path) to a 4-digit >> unique number with INT!!! That's all i want!! But i cannot make it work >> :( > > I just need a way to eat my soup with a screwdrive

Re: Using filepath method to identify an .html page

2013-01-22 Thread Michael Torrie
On 01/22/2013 04:40 PM, Steven D'Aprano wrote: > On Tue, 22 Jan 2013 11:36:31 -0700, Michael Torrie wrote: > >> I'm sorry you are getting so frustrated. There's obviously a language >> barrier here, > > I don't think there is. The OP's posts have been written in excellent > English. Well, his

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 11:36:31 -0700, Michael Torrie wrote: > I'm sorry you are getting so frustrated. There's obviously a language > barrier here, I don't think there is. The OP's posts have been written in excellent English. I think we've been well and truly trolled, by somebody who even uses

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 09:33:00 -0800, rusi wrote: > On Jan 22, 8:59 pm, Ferrous Cranus wrote: >> I just need a way to CONVERT a string(absolute path) to a 4-digit >> unique number with INT!!! That's all i want!! But i cannot make it work >> :( > > I just need a way to eat my soup with a screwdrive

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 11:36:31 -0700, Michael Torrie wrote: > I'm sorry you are getting so frustrated. There's obviously a language > barrier here, I don't think there is. The OP's posts have been written in excellent English. I think we've been well and truly trolled, by somebody who even uses

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 11:36:31 -0700, Michael Torrie wrote: > I'm sorry you are getting so frustrated. There's obviously a language > barrier here, I don't think there is. The OP's posts have been written in excellent English. I think we've been well and truly trolled, by somebody who even uses

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 11:36:31 -0700, Michael Torrie wrote: > I'm sorry you are getting so frustrated. There's obviously a language > barrier here, I don't think there is. The OP's posts have been written in excellent English. I think we've been well and truly trolled, by somebody who even uses

Re: Using filepath method to identify an .html page

2013-01-22 Thread Peter Otten
Ferrous Cranus wrote: > Τη Τρίτη, 22 Ιανουαρίου 2013 6:11:20 μ.μ. UTC+2, ο χρήστης Chris Angelico > έγραψε: >> all of it. You are asking something that is fundamentally >> impossible[1]. There simply are not enough numbers to go around. > Fundamentally impossible? > > Well > > OK: How abou

Re: Using filepath method to identify an .html page

2013-01-22 Thread Dave Angel
On 01/22/2013 01:26 PM, Ferrous Cranus wrote: sub hashit { my $url=shift; my @ltrs=split(//,$url); my $hash = 0; foreach my $ltr(@ltrs){ $hash = ( $hash + ord($ltr)) %1; } printf "%s: %0.4d\n",$url,$hash } which yields: $ perl testMD5.pl /index.html:

Re: Using filepath method to identify an .html page

2013-01-22 Thread Michael Torrie
On 01/22/2013 11:26 AM, Ferrous Cranus wrote: > which yields: > $ perl testMD5.pl > /index.html: 1066 > /about/time.html: 1547 Well do it the same with in python then. Just read the docs on the hashlib so you know what kind of object it returns and how to call methods on that object to return a

Re: Using filepath method to identify an .html page

2013-01-22 Thread Michael Torrie
On 01/22/2013 11:13 AM, Ferrous Cranus wrote: > a) I'am a reseller, i have unlimited ftp quota, hence database space Space doesn't even come into the equation. There's virtually no difference between a 4-digit number and a 100-character string. Yes there is an absolute difference in storage spac

Re: Using filepath method to identify an .html page

2013-01-22 Thread MRAB
On 2013-01-22 18:26, Ferrous Cranus wrote: Τη Τρίτη, 22 Ιανουαρίου 2013 6:11:20 μ.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: On Wed, Jan 23, 2013 at 2:59 AM, Ferrous Cranus wrote: > I just need a way to CONVERT a string(absolute path) to a 4-digit unique number with INT!!! That's all i want!

Re: Using filepath method to identify an .html page

2013-01-22 Thread John Gordon
In <4847a0e3-aefa-4330-9252-db08f2e99...@googlegroups.com> Ferrous Cranus writes: > And the .html files are not even close 10.000 You said you wanted a 4-digit number. There are 10,000 different 4-digit numbers. 0001 0002 ... -- John Gordon A is for Amy, who fell

Re: Using filepath method to identify an .html page

2013-01-22 Thread Michael Torrie
I'm sorry you are getting so frustrated. There's obviously a language barrier here, but also your frustration is preventing you from thinking clearly. You need to take a step back, breath, and re-read everything that's been written to you on this thread. All your questions that can be answered h

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 6:11:20 μ.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > On Wed, Jan 23, 2013 at 2:59 AM, Ferrous Cranus wrote: > > > I just need a way to CONVERT a string(absolute path) to a 4-digit unique > > number with INT!!! That's all i want!! But i cannot make it work :( > >

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 7:33:00 μ.μ. UTC+2, ο χρήστης rusi έγραψε: > On Jan 22, 8:59 pm, Ferrous Cranus wrote: > > > I just need a way to CONVERT a string(absolute path) to a 4-digit unique > > number with INT!!! > > > That's all i want!! But i cannot make it work :( > > > > I just need

Re: Using filepath method to identify an .html page

2013-01-22 Thread Michael Torrie
On 01/22/2013 03:07 AM, Ferrous Cranus wrote: > Now, can you pleas help me write the switch to filepath identifier? > I'am having trouble writing it. Unfortunately this isn't the way to go either. Apache uses its own config and rules to map a url to a "filepath." There's no way for Python to do

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 6:23:16 μ.μ. UTC+2, ο χρήστης Leonard, Arah έγραψε: > > Thank you but the number needs to be a 4-digit integer only, if its to be > > stored in the database table correctly. > > > > Okay, I think we need to throw the flag on the field at this point. What > you're

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 6:55:02 μ.μ. UTC+2, ο χρήστης John Gordon έγραψε: > In Ferrous Cranus > writes: > > > > > I just need a way to CONVERT a string(absolute path) to a 4-digit unique > > > number with INT!!! That's all i want!! But i cannot make it work :( > > > > Given your requ

Re: Using filepath method to identify an .html page

2013-01-22 Thread Mark Lawrence
On 22/01/2013 17:33, rusi wrote: On Jan 22, 8:59 pm, Ferrous Cranus wrote: I just need a way to CONVERT a string(absolute path) to a 4-digit unique number with INT!!! That's all i want!! But i cannot make it work :( I just need a way to eat my soup with a screwdriver. No I WONT use a spoon.

Re: Using filepath method to identify an .html page

2013-01-22 Thread rusi
On Jan 22, 8:59 pm, Ferrous Cranus wrote: > I just need a way to CONVERT a string(absolute path) to a 4-digit unique > number with INT!!! > That's all i want!! But i cannot make it work :( I just need a way to eat my soup with a screwdriver. No I WONT use a spoon. Im starving HELP -- http://ma

Re: Using filepath method to identify an .html page

2013-01-22 Thread John Gordon
In Ferrous Cranus writes: > I just need a way to CONVERT a string(absolute path) to a 4-digit unique > number with INT!!! That's all i want!! But i cannot make it work :( Given your requirements, I don't think it *can* work. There's just no way to do it. How can the computer guarantee that b

RE: Using filepath method to identify an .html page

2013-01-22 Thread Leonard, Arah
> Thank you but the number needs to be a 4-digit integer only, if its to be > stored in the database table correctly. Okay, I think we need to throw the flag on the field at this point. What you're asking for has gone into a realm where you clearly don't even appear to understand what you're a

Re: Using filepath method to identify an .html page

2013-01-22 Thread Dave Angel
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...67752282212692

Re: Using filepath method to identify an .html page

2013-01-22 Thread Chris Angelico
On Wed, Jan 23, 2013 at 2:59 AM, Ferrous Cranus wrote: > I just need a way to CONVERT a string(absolute path) to a 4-digit unique > number with INT!!! That's all i want!! But i cannot make it work :( Either you are deliberately trolling, or you have a major comprehension problem. Please go back

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 5:25:42 μ.μ. UTC+2, ο χρήστης Peter Otten έγραψε: > Ferrous Cranus wrote: > > > > > I insist, perhaps compeleld, to use a key to associate a number to a > > > filename. Would you help please? > > > > > > I dont know this is supposed to be written. i just know i n

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
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 dis

Re: Using filepath method to identify an .html page

2013-01-22 Thread Peter Otten
Ferrous Cranus wrote: > I insist, perhaps compeleld, to use a key to associate a number to a > filename. Would you help please? > > I dont know this is supposed to be written. i just know i need this: > > number = function_that_returns_a_number_out_of_a_string( > absolute_path_of_a_html_file) >

Re: Using filepath method to identify an .html page

2013-01-22 Thread Chris Angelico
On Wed, Jan 23, 2013 at 2:21 AM, Ferrous Cranus wrote: > Why the hell > > pin = int ( '/home/nikos/public_html/index.html' ) > > fails? because it has slashes in it? What do you expect it to return? 141592653589793? Go through the Python tutorial. Better yet, find a book that distinguishes betwe

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 5:05:49 μ.μ. UTC+2, ο χρήστης Dave Angel έγραψε: > On 01/22/2013 09:55 AM, Ferrous Cranus wrote: > > > Τη Τρίτη, 22 Ιανουαρίου 2013 4:33:03 μ.μ. UTC+2, ο χρήστης Chris Angelico > > έγραψε: > > >> On Wed, Jan 23, 2013 at 12:57 AM, Ferrous Cranus > >> wrote: > > >>

Re: Using filepath method to identify an .html page

2013-01-22 Thread Chris Angelico
On Wed, Jan 23, 2013 at 1:55 AM, Ferrous Cranus wrote: > I insist, perhaps compeleld, to use a key to associate a number to a filename. > Would you help please? > > I dont know this is supposed to be written. i just know i need this: > > number = function_that_returns_a_number_out_of_a_string( >

Re: Using filepath method to identify an .html page

2013-01-22 Thread Dave Angel
On 01/22/2013 09:55 AM, Ferrous Cranus wrote: Τη Τρίτη, 22 Ιανουαρίου 2013 4:33:03 μ.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: On Wed, Jan 23, 2013 at 12:57 AM, Ferrous Cranus wrote: Τη Τρίτη, 22 Ιανουαρίου 2013 3:04:41 μ.μ. UTC+2, ο χρήστης Steven D'Aprano έγραψε: What do you expec

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 4:33:03 μ.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > On Wed, Jan 23, 2013 at 12:57 AM, Ferrous Cranus > wrote: > > > Τη Τρίτη, 22 Ιανουαρίου 2013 3:04:41 μ.μ. UTC+2, ο χρήστης Steven D'Aprano > > έγραψε: > > > > > >> What do you expect int("my-web-page.html") t

Re: Using filepath method to identify an .html page

2013-01-22 Thread Chris Angelico
On Wed, Jan 23, 2013 at 12:57 AM, Ferrous Cranus wrote: > Τη Τρίτη, 22 Ιανουαρίου 2013 3:04:41 μ.μ. UTC+2, ο χρήστης Steven D'Aprano > έγραψε: > >> What do you expect int("my-web-page.html") to return? Should it return 23 >> or 794 or 109432985462940911485 or 42? > > I expected a unique number fr

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 3:04:41 μ.μ. UTC+2, ο χρήστης Steven D'Aprano έγραψε: > What do you expect int("my-web-page.html") to return? Should it return 23 > or 794 or 109432985462940911485 or 42? I expected a unique number from the given string to be produced so i could have a (number <=>

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 04:47:16 -0800, Ferrous Cranus wrote: > htmlpage = a string respresenting the absolute path of the requested > .html file That is a very misleading name for a variable. The contents of the variable are not a html page, but a file name. htmlpage = "/home/steve/my-web-page.ht

Re: Using filepath method to identify an .html page

2013-01-22 Thread Chris Angelico
On Tue, Jan 22, 2013 at 11:47 PM, Ferrous Cranus wrote: > What i want to do, is to associate a number to an html page's absolute path > for to be able to use that number for my database relations instead of the > BIG absolute path string. > > so to get an integer out of a string i would just hav

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 2:47:16 μ.μ. UTC+2, ο χρήστης Ferrous Cranus έγραψε: > Τη Τρίτη, 22 Ιανουαρίου 2013 2:29:21 μ.μ. UTC+2, ο χρήστης Dave Angel έγραψε: > > > On 01/22/2013 07:02 AM, Ferrous Cranus wrote: > > > > > > > # > > > =

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
Τη Τρίτη, 22 Ιανουαρίου 2013 2:29:21 μ.μ. UTC+2, ο χρήστης Dave Angel έγραψε: > On 01/22/2013 07:02 AM, Ferrous Cranus wrote: > > > # > > > > > # produce a hash st

Re: Using filepath method to identify an .html page

2013-01-22 Thread Dave Angel
On 01/22/2013 07:02 AM, Ferrous Cranus wrote: # # produce a hash string based on html page's filepath and convert it to an integer, that will then be used to iden

Re: Using filepath method to identify an .html page

2013-01-22 Thread Chris Angelico
On Tue, Jan 22, 2013 at 10:53 PM, Ferrous Cranus wrote: > # == > # produce a hash based on html page's filepath and convert it to an integet, > that will be uses to identify the page itself. > # == > >

Re: Using filepath method to identify an .html page

2013-01-22 Thread Lele Gaifax
Ferrous Cranus writes: > pin = int( hashlib.md5( htmlpage ) ) > > This fails. why? > > htmlpage = a string respresenting the absolute path of the requested .html > file > hashlib.md5( htmlpage ) = conversion of the above string to a hashed string No, that statement does not "convert" a string i

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
# # produce a hash string based on html page's filepath and convert it to an integer, that will then be used to identify the page itself #

Re: Using filepath method to identify an .html page

2013-01-22 Thread Ferrous Cranus
# == # produce a hash based on html page's filepath and convert it to an integet, that will be uses to identify the page itself. # == pin = int( hashlib.md5( htmlpage ) ) I just tried that but it pro

Re: Using filepath method to identify an .html page

2013-01-22 Thread Steven D'Aprano
On Tue, 22 Jan 2013 02:07:54 -0800, Ferrous Cranus wrote: > Hello, i decided to switch from embedding string into .html to actually > grab the filepath in order to identify it: What do you think "the filepath" means, and how do you think you would grab it? I can only guess you mean the full pat