Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: What is the best way to add entries from 1 dictionary to another?
Post: RE: What is the best way to add entries from 1 di...

From python 3.9 there are also union operators for dicts! - PEP 584 **smile** so this: d = {'a': 1, 'b': 2} d.update({'d': 4}can be also written this way: d = {'a': 1, 'b': 2} d |= {'d': 4}
mlieqo General Coding Help 5 2,383 Oct-20-2020, 03:27 PM
    Thread: Trying to set up virtualenv for windows not working
Post: RE: Trying to set up virtualenv for windows not wo...

Try:  python3 -m virtualenv .
mlieqo Web Scraping & Web Development 2 2,062 Oct-11-2020, 03:44 PM
    Thread: Need help with Flask App
Post: RE: Need help with Flask App

well I supose it should be right below this part''' Show alls contacts ''' **smile** you should probably read up on flask, here is a quickstart - https://flask.palletsprojects.com/en/1.1.x/quickstar...
mlieqo Web Scraping & Web Development 8 5,535 Oct-02-2020, 01:48 PM
    Thread: Need help with Flask App
Post: RE: Need help with Flask App

Well you are redirecting from index to contacts endpoint, but I don't see the contacts endpoint defined anywhere
mlieqo Web Scraping & Web Development 8 5,535 Oct-01-2020, 08:02 PM
    Thread: Locating elements via Selenium
Post: RE: Locating elements via Selenium

If you want the tag name: print(itm.tag_name)get_attribute from docs - Quote:Gets the given attribute or property of the element. meaning that if you do something like: print(itm.get_attribute('class'...
mlieqo Web Scraping & Web Development 2 2,516 Oct-01-2020, 07:55 PM
    Thread: Need help with Flask App
Post: RE: Need help with Flask App

From the information you provided I can't really tell, if you could post part of the code where you do the 'routing' as well, that would be great. Also a full error traceback is always helpful. Regar...
mlieqo Web Scraping & Web Development 8 5,535 Oct-01-2020, 07:42 PM
    Thread: TensorFlow
Post: RE: TensorFlow

Also, one of the tensorflow requirements - Windows 7 or later (64-bit) (emphasis on 64 bit)
mlieqo General Coding Help 3 1,977 Sep-24-2020, 07:25 PM
    Thread: Using my REPL to bisect numbers and lists with classes (PyBite #181)
Post: RE: Using my REPL to bisect numbers and lists with...

you need to create an instance of OrderedList: >>> dummy = order.OrderedList()
mlieqo General Coding Help 2 2,089 Sep-24-2020, 01:35 PM
    Thread: Web scrapping - Stopped working
Post: RE: Web scrapping - Stopped working

It looks like when you visit https://www.nseindia.com/option-chain it sets up some cookies, that are used in a request header when requesting https://www.nseindia.com/api/option-chai...symbol=ACC , an...
mlieqo Web Scraping & Web Development 2 3,119 Sep-22-2020, 07:51 PM
    Thread: Python error on pythonanywhere
Post: RE: Python error on pythonanywhere

I suggest trying it with verify_ssl = False in you aiohttp request
mlieqo General Coding Help 10 3,830 Sep-21-2020, 06:48 PM
    Thread: Async / Await usage with asyncio to retrieve urls in parallel
Post: RE: Async / Await usage with asyncio to retrieve u...

1.) yes good point, you definitely don't want to create a session per request, so in this case you can just move the context manager in the gather_coro and pass it as a argument to get_url_result func...
mlieqo General Coding Help 7 3,120 Sep-21-2020, 06:38 PM
    Thread: Async / Await usage with asyncio to retrieve urls in parallel
Post: RE: Async / Await usage with asyncio to retrieve u...

Just a few small changes. I would personally leave the collection of all the results in the get_results function: def get_results(urls): async def gather_coro(): return await asyncio.gath...
mlieqo General Coding Help 7 3,120 Sep-20-2020, 08:18 PM
    Thread: Async / Await usage with asyncio to retrieve urls in parallel
Post: RE: Async / Await usage with asyncio to retrieve u...

1.) Yes it's possible, you can just call the asyncio.run in getResults but you will have to move the asyncio.gather to a new coroutine 2.) Let's say your new getResult function will look something li...
mlieqo General Coding Help 7 3,120 Sep-20-2020, 06:35 PM
    Thread: Async / Await usage with asyncio to retrieve urls in parallel
Post: RE: Async / Await usage with asyncio to retrieve u...

1.) getResults function needs to be async function as well because you need to await asyncio.gather() 2.) asyncio.gather accepts individual coroutines as arguments not an iterable (specifically genera...
mlieqo General Coding Help 7 3,120 Sep-18-2020, 11:51 AM
    Thread: Why I feel like quitting Python
Post: RE: Why I feel like quitting Python

Hello Drone4four! Honestly to me it seems like you are focusing too much on tutorials / bootcamps etc. I think you should start working on your own stuff, and learning new things as you go along -&g...
mlieqo News and Discussions 8 4,681 Sep-18-2020, 08:30 AM
    Thread: don't know indenting of break and continue
Post: RE: don't know indenting of break and continue

break statement will exit the for loop so in your case if artist.lower() == "justin bieber": break print("No way!") -> this line will never be executed as you exit the l...
mlieqo General Coding Help 5 2,184 Sep-18-2020, 08:03 AM
    Thread: Django send email - email form
Post: RE: Django send email - email form

It seems that the problem is in the google mail server, which is sneaky enough to always use EMAIL_HOST_USER (user that is used for authentication) instead of the from_email value. The solution is to...
mlieqo Web Scraping & Web Development 2 2,335 Sep-17-2020, 09:38 PM
    Thread: Add package to pyenv base interpreter
Post: RE: Add package to pyenv base interpreter

Maybe just create alias that creates virtual environment and afterwards it also installs the wxpython?
mlieqo Bar 1 1,880 Sep-11-2020, 11:58 AM
    Thread: How can I count values between range dates ?
Post: RE: How can I count values between range dates ?

try using just .size instead of .size()
mlieqo General Coding Help 2 2,489 Sep-03-2020, 11:53 AM
    Thread: Idle and pycharm problem
Post: RE: Idle and pycharm problem

Did you use virtual environment or system python interpreter when you installed pillow? Pycharm often creates a virtual environment for you when you create a new project, which may be different from ...
mlieqo General Coding Help 3 2,365 Sep-03-2020, 11:45 AM

User Panel Messages

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