Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: How to find a specific word in a webpage and How to count it.
Post: RE: How to find a specific word in a webpage and H...

This should work, in a half-ass sense. import requests from bs4 import BeautifulSoup url = input("Enter the url: ") r = requests.get(url) soup = BeautifulSoup(r.content,'lxml') g = list(soup) t = 0 f...
zykbee Web Scraping & Web Development 11 45,208 Feb-08-2018, 03:19 AM
    Thread: Inherting from different class in PYQT
Post: RE: Inherting from different class in PYQT

That's what I thought, but it keeps saying "Third has no attribute 't'", presumably because it's within a function and not right under Class. Of course, I can do this: class Third(QWidget): t = "W...
zykbee General Coding Help 3 3,009 Feb-08-2018, 02:33 AM
    Thread: Time event
Post: RE: Time event

import time time.ctime() time.strftime("%a, %d %b %Y %H:%M:%S") h = int(time.strftime('%H')) if h > 7 and h<21: print("f")prints "f" if the time is between 0700 and 2100. Elsewise, instead...
zykbee General Coding Help 5 3,850 Feb-08-2018, 02:11 AM
    Thread: Inherting from different class in PYQT
Post: Inherting from different class in PYQT

I want to pull "self.t" from class Third and print the info in Class Fourth where it says "pass." How would I inherit it? class Third(QWidget): def __init__(self, parent=None): super(Third...
zykbee General Coding Help 3 3,009 Feb-08-2018, 01:44 AM
    Thread: BS4 - Is There A More Efficient Way Of Doing This?
Post: RE: BS4 - Is There A More Efficient Way Of Doing T...

Have you tried putting all the keywords in a list, and then running just 1 if statement instead of 30 separate ones? IE: keywordlist = [keyword1, keyword2, keyword3] comment_search = soup.body.find_a...
zykbee Web Scraping & Web Development 4 4,960 Nov-27-2017, 05:42 AM
    Thread: input issue elif
Post: RE: input issue elif

You have to input an integer on the first line x=int(input))
zykbee General Coding Help 2 3,184 Nov-23-2017, 06:29 AM
    Thread: Simple For Loop Question
Post: RE: Simple For Loop Question

Nevermind. In case anyone sees this in future, these are the changes I made: from bs4 import BeautifulSoup import requests import re site = requests.get('http://www.angelfire.com/comics/gameroom/').t...
zykbee Web Scraping & Web Development 2 2,758 Nov-23-2017, 04:48 AM
    Thread: Simple For Loop Question
Post: Simple For Loop Question

The purpose of the program is to go to a website, make a list of the links, then go to each link and send back the canonical tag. More or less, it works fine. However, I do have one issue: when there ...
zykbee Web Scraping & Web Development 2 2,758 Nov-23-2017, 02:52 AM
    Thread: Best Method for simple GUI?
Post: RE: Best Method for simple GUI?

Have you considered using tkinter to set up an entry box, and having the entry display in a text box upon click of a button ? For example: def __init__(self, master): Frame.__init__(se...
zykbee General Coding Help 4 3,579 Nov-17-2017, 06:16 AM
    Thread: List comprehension, I think(?)
Post: RE: List comprehension, I think(?)

YOU'RE INCREDIBLE! Thank You! If you have the chance, can you give me a quick rundown of what this did? --- all(item2[0].lower() not in item[0].lower() ---
zykbee General Coding Help 10 6,371 Nov-14-2017, 10:27 AM
    Thread: List comprehension, I think(?)
Post: RE: List comprehension, I think(?)

No. Ann will not always be at the start of the string. I want it to remove 'Ann' (and the string) no matter where it is in the list. For instance, this is what i want: list1= [hi], [bye], [ann], [an...
zykbee General Coding Help 10 6,371 Nov-14-2017, 09:01 AM
    Thread: List comprehension, I think(?)
Post: RE: List comprehension, I think(?)

This still arrives me upon the same dilemma as where I began. --- It's working w/o error, but still gives me ["[email protected]], [sandy], [chuck] when I run it --- I want it to just show Sandy and Chuck, ...
zykbee General Coding Help 10 6,371 Nov-14-2017, 08:41 AM
    Thread: List comprehension, I think(?)
Post: RE: List comprehension, I think(?)

Thanks for your assistance, but none of your solutions are working. I am trying to emit all the strings from the 'emit list'. This is what I got instead: FULL LIST ===[['[email protected]'], ['Cindy'], ['B...
zykbee General Coding Help 10 6,371 Nov-14-2017, 08:12 AM
    Thread: List comprehension, I think(?)
Post: List comprehension, I think(?)

Hey guys. When I run this, it properly writes to a new text file any line of the "full" list that doesn't have a corresponding line in the "emit" list. Unfortunately, if the entries aren't exact, it f...
zykbee General Coding Help 10 6,371 Nov-14-2017, 07:20 AM
    Thread: Learn pyqt5 using pyqt4
Post: RE: Learn pyqt5 using pyqt4

They're highly compatible. Shouldn't have any issue learning between the two.
zykbee GUI 5 5,807 Nov-13-2017, 06:29 AM
    Thread: Calling list from previous function
Post: Calling list from previous function

I am writing a program using python w/ tkinter. The GUI is three buttons. Two of them are to be used for inputting a text file, then converting it to a list. I got that part. Next, I need to call the ...
zykbee General Coding Help 1 2,958 Nov-13-2017, 05:38 AM
    Thread: Extracting random word from list
Post: RE: Extracting random word from list

(nevermind, Ive been at it too long today) Thank you! I got it !!!
zykbee General Coding Help 13 8,194 Nov-06-2017, 11:48 PM
    Thread: Extracting random word from list
Post: RE: Extracting random word from list

Still doesn't work. I'm about to just abandon that portion of the project. Nevertheless, I have one other issue here; do you happen to know why var1 won't show up in the entry box, yet it shows up per...
zykbee General Coding Help 13 8,194 Nov-06-2017, 11:35 PM
    Thread: Extracting random word from list
Post: RE: Extracting random word from list

Yeah, I think we're walking on two different planes here. I'm going to be inputting a LARGE token, not just a few words. Think : {{howdy|hey|hey there|heyyy|hi cutey|hi there =)|sup|heyy|hey hey|heyy...
zykbee General Coding Help 13 8,194 Nov-06-2017, 11:16 PM
    Thread: Extracting random word from list
Post: RE: Extracting random word from list

So enumerate? I'l give it a shot! Thanks for the advice.
zykbee General Coding Help 13 8,194 Nov-06-2017, 11:10 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020