So I would need to remove the duplicates. I have dont this before in the past using:
Code:
tut_links=list(set(tut_links))
Let me give this a shot and see what happens. Thanks for all the help. I will let you know how it goes.
---------- Post updated 06-07-17 at 02:54 PM ---------- Previous update was 06-06-17 at 04:03 PM ----------
Thanks for all the help. Here is the finish code:
Code:
tut_links = {}
for subdir, dirs, files in os.walk('./html/tutorials/blah'):
for tut in files:
if tut.endswith(".html"):
tut_links[tut] = []
fpath = os.path.join("./html/tutorials/blah", tut)
content = open(fpath, "r").read()
file = BeautifulSoup(content, 'lxml')
for links in file.find_all('a', href=True):
urls = links.get('href')
if urls.startswith('http' or 'https'):
tut_links[tut].append(urls)
for dup in tut_links.values(): --> removes duplicate urls from the dictionary value list
dup[:] = list(set(dup))
Hey im new to unix!
I am tryin to create a web page in unix and have done it all but when i try and load it it says permission denied!?>
i have chmod a+rx for folder and file to make sure but still permissions wont let me?!
any ideas can anyone do a quick run through of how to make a web page... (4 Replies)
Hello,
I am new to unix, but wanted to know how can we fetch data from a web page (i.e. an HTML Page), my requirement is to read an html page and wanted to create a flat file (text file) based on the contents available in the mentioned HTML page.
Thanks
Imtiaz (3 Replies)
hey uhh this is my first post and i was wondering
how do i make a web page for like a small business or something
anything will help
thanks (3 Replies)
I'm 13 years of age and I am into computers. I am trying to learn how to make a webpage.
I could use the help and I would greatly appriciate it. (1 Reply)
Hello,
I'm a total newbie to HTTP commands, so I'm not sure how to do this. What I'd like is to write a C program to fetch the contents of a html page of a given address.
Could someone help with this?
Thanks in advance! (4 Replies)
Hello,
I have created a dictionary which has the following structure:
DOMAINWORD=(equivalent in English)gloss(es) in Hindi each separated by a comma(equivalent in English)gloss(es) in Hindi each separated by a comma or a semi-colon
An example will make this clear
... (13 Replies)
Hi,
I have written the following python snippet to store the capital letter starting words into a dictionary as key and no of its appearances as a value in this dictionary against the key.
#!/usr/bin/env python
import sys
import re
hash = {} # initialize an empty dictinonary
for line in... (1 Reply)
My main aim here is to create a database of verbs in a language to Hindi. The output if it works well will be put up on a University site for researchers to use for Machine Translation. This because one of the main weaknesses of MT is in the area of verbs.
Sorry for the long post but the problem... (4 Replies)
Discussion started by: gimley
4 Replies
LEARN ABOUT DEBIAN
lire::config::dictionary
Dictionary(3pm) LogReport's Lire Documentation Dictionary(3pm)NAME
Lire::Config::Dictionary - Dictionary Value object.
SYNOPSIS
use Lire::Config::Dictionary;
DESCRIPTION
Configuration parameter which contain a bunch of named parameters other values accessible by name.
This value is used for top-level configuration sets.
is_set( $name )
Returns true if the parameter $name was set in this dictionary.
get( $name )
Returns the Value object for the $name subparameter. An exception will be thrown if there is no subparameter named $name.
set( $value )
Sets a parameter in this dictionary.
AUTHORS
Wessel Dankers <wsl@logreport.org>
Wolfgang Sourdeau <wolfgang@logreport.org>
Francis J. Lacoste <flacoste@logrpeort.org>
VERSION
$Id: Dictionary.pm,v 1.19 2006/07/23 13:16:30 vanbaal Exp $
COPYRIGHT
Copyright (C) 2002-2004 Stichting LogReport Foundation LogReport@LogReport.org
This file is part of Lire.
Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with
http://www.gnu.org/copyleft/gpl.html.
Lire 2.1.1 2006-07-23 Dictionary(3pm)