Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Python VLookup? Lookup Table?
Post: RE: Python VLookup? Lookup Table?

Is this for during execution only or are you also asking about the equivalent of a spreadsheet that uses VLookup? For execution only you can use dictionaries. You could store the data as a CSV, as JSO...
SamHobbs General Coding Help 3 2,431 Oct-25-2021, 07:35 PM
    Thread: selenium wait for text question
Post: RE: selenium wait for text question

I am a beginner to Python and Selenium but if JavaScript is updating the page then you probably need to wait for a DocumentComplete event. I am not sure (I forget) what event fires at the beginning of...
SamHobbs Web Scraping & Web Development 3 2,566 Oct-23-2021, 12:18 PM
    Thread: Python 3.9 and WINDOWS 10
Post: RE: Python 3.9 and WINDOWS 10

(Oct-16-2021, 05:38 PM)deep_logic Wrote: I use ATOMI do not know what ATOM is. When I search I find Atom and since searches are case-insensitive I assume it will be difficult for me to know for sure...
SamHobbs General Coding Help 2 1,732 Oct-16-2021, 10:05 PM
    Thread: Mult-threading and locking file
Post: RE: Mult-threading and locking file

I think you just need to create a thread (one and only one) that does the writing. Access to the thread from other threads need to be synchronized. I am a beginner to Python; others can guide you bett...
SamHobbs General Coding Help 4 2,601 Oct-15-2021, 04:59 PM
    Thread: How To Create A "Birthday Calculator" in Python?
Post: RE: How To Create A "Birthday Calculator" in Pytho...

If the birth day and month have already passed for the current year then use the following year.
SamHobbs General Coding Help 3 3,717 Oct-11-2021, 08:03 PM
    Thread: is it pythonic to add a name 'attribute' to an existing variable?
Post: RE: is it pythonic to add a name 'attribute' to an...

That would be totally valid for a class. Why not use a class?
SamHobbs General Coding Help 6 2,199 Oct-04-2021, 07:44 PM
    Thread: Tutorials on sockets, threading and multi-threading?
Post: RE: Tutorials on sockets, threading and multi-thre...

Multi-Threading and Multi-Processing are different. For most operating systems each process executes in their own address space and are unable to do anything to each other unless each one does somethi...
SamHobbs General Coding Help 2 2,130 Oct-01-2021, 08:17 PM
    Thread: Show HTML in Python application and handle click
Post: RE: Show HTML in Python application and handle cli...

Flask might be useful if I wanted to develop an application; multiple pages that work together. I just need to support one page; the equivalent of using HTML as a word-processing format and Python for...
SamHobbs Web Scraping & Web Development 2 2,736 Sep-28-2021, 06:27 PM
    Thread: I am trying to reverse a string using loop
Post: RE: I am trying to reverse a string using loop

Count the number of open parentheses ( and close parentheses ) in: del(text[(len(text)) - 1]If the number is not the same then that is a problem.
SamHobbs General Coding Help 4 2,186 Sep-28-2021, 05:34 PM
    Thread: Show HTML in Python application and handle click
Post: Show HTML in Python application and handle click

I know how to do this using C#. C# has a WebBrowser class and later classes. I want to show a HTML file in a Python application, not in a browser (not in the usual manner) and process a click event l...
SamHobbs Web Scraping & Web Development 2 2,736 Sep-28-2021, 04:19 AM
    Thread: For Loop Returning 3 Results When There Should Be 1
Post: RE: For Loop Returning 3 Results When There Should...

(Sep-27-2021, 02:23 AM)knight2000 Wrote: The reason I changed the code in the end to include the additional div (unlike the original code), was because snippsat educated me that I shouldn't be using...
SamHobbs General Coding Help 12 4,131 Sep-27-2021, 03:18 AM
    Thread: For Loop Returning 3 Results When There Should Be 1
Post: RE: For Loop Returning 3 Results When There Should...

(Sep-26-2021, 11:05 AM)knight2000 Wrote: So I followed your suggestion to use lxml and tried the following code:In your fixed code you first find relevant div elements then look for a relevant span ...
SamHobbs General Coding Help 12 4,131 Sep-26-2021, 04:38 PM
    Thread: Learned Python Basics, what now?
Post: RE: Learned Python Basics, what now?

There is likely a big difference between what you want to do and what there is demand for. Which one do you really want to ask about? Web scraping is only necessary when the owners of the data do not...
SamHobbs General Coding Help 20 6,063 Sep-26-2021, 04:29 PM
    Thread: For Loop Returning 3 Results When There Should Be 1
Post: RE: For Loop Returning 3 Results When There Should...

I assume that len(soup) being 3 explains why you are getting 3 when you expect 1 but the BeautifulSoup documentation is not clear about what it is.
SamHobbs General Coding Help 12 4,131 Sep-26-2021, 05:29 AM
    Thread: For Loop Returning 3 Results When There Should Be 1
Post: RE: For Loop Returning 3 Results When There Should...

Can you use the following? from bs4 import BeautifulSoup with open(r"out_of_stock2.html", encoding="utf8") as fp: soup = BeautifulSoup(fp, 'html.parser') print(len(soup)) mt2 = soup.find('span',...
SamHobbs General Coding Help 12 4,131 Sep-26-2021, 03:56 AM
    Thread: width of Unicode character
Post: RE: width of Unicode character

I think it depends on the operating system or at least the Python library you are using.
SamHobbs General Coding Help 6 2,742 Sep-26-2021, 03:28 AM
    Thread: Learned Python Basics, what now?
Post: RE: Learned Python Basics, what now?

Okay sorry. Well I am learning a lot but unless muzikman asks for more I think I will leave things about WSGI here as they are so far.
SamHobbs General Coding Help 20 6,063 Sep-26-2021, 12:49 AM
    Thread: problem writing dataframe to oracle
Post: RE: problem writing dataframe to oracle

I am not sure I understand. If I understand then I do not know what your database field names are but perhaps you just need to use something as in the following. df=pd.read_csv('test.csv', names=["Id...
SamHobbs General Coding Help 4 2,665 Sep-25-2021, 11:20 PM
    Thread: Learned Python Basics, what now?
Post: RE: Learned Python Basics, what now?

(Sep-25-2021, 07:07 PM)snippsat Wrote: SamHobbs in general looking at WSGI specification and deeper dive into WSGI, is mostly useful if thinking of making a framework and not for making a web-site/a...
SamHobbs General Coding Help 20 6,063 Sep-25-2021, 09:49 PM
    Thread: Learned Python Basics, what now?
Post: RE: Learned Python Basics, what now?

I am learning very much about WSGI. Prior to a few minutes ago the descriptions of WSGI I have read say it is written in Python. See PEP 3333 -- Python Web Server Gateway Interface v1.0.1 | Python.org...
SamHobbs General Coding Help 20 6,063 Sep-25-2021, 06:30 PM

User Panel Messages

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