Quantcast
Channel: Active questions tagged python - Stack Overflow
Browsing all 13891 articles
Browse latest View live
↧

Image may be NSFW.
Clik here to view.

Increase font size in tkinter for large screens

I am writing a small application in tkinter which will run on a large screen. For the audience to see something at all I need huge font sizes for some widgets.My problem now is, that tkinter seems to...

View Article


Compress PDFs using Python

So I have a gazillion pdfs in a folder, I want to recursively (using os.path.walk) shrink them. I see that adobe pro has a save as reduced size. Would I be able to use this / how do you suggest I do it...

View Article


Combing degrees and minutes data columns, accounting for rolling over to next...

I have a have a weird format for some data that I'm stuck working with. it's a csv file that includes a timestamp column, a latitude minutes column which is a float, and longitude minutes column...

View Article

'X' object has no attribute 'functionName' - Pyspark / Python

I'm new to Pyspark so just learning as I go.I'm trying to experiment with UnitTest and I am getting some error below:def drop_duplicates(df): df = df.dropDuplicates(df) return dfimport unittestclass...

View Article

Trying to scrape a dynamic website in python with requests_html

When i try to scrape this site site i run into an issue and i can't figure out what's wrong. i tried using Htmlsession but python told me to use AsyncHTMLSession because the former can't perform loops....

View Article


typing: Dynamically Create Literal Alias from List of Valid Values

I have a function which validates its argument to accept only values from a given list of valid options. Typing-wise, I reflect this behavior using a Literal type alias, like so:from typing import...

View Article

Django site working for all pages except for a few

I'm using a combo of python and django in order to load a site. A HTML home file is also present in the templates folder.I coded all parts of my site the way I normally do, which has worked for every...

View Article

Writing repeating words in a line in a textfile to another textfile

I'm trying to make a function where it reads a textfile and it inputs the repeated words once in another textfile. The problem is that this code just gives the last line repeated words.import string...

View Article


Element cant be found in any way with selenium

I'm attempting to toggle comments using Selenium, but it seems unable to locate the toggle button. I've attempted to locate every SVG element to confirm the presence of the '-' button, but it only...

View Article


Why are there no sorted containers in Python's standard libraries?

Is there a Python design decision (PEP) that precludes a sorted container from being added to Python?(OrderedDict is not a sorted container since it is ordered by insertion order.)

View Article

Python Background Thread Timer

def run_timer(duration): import threading import time import sys class Timer: def __init__(self , duration): self.duration = duration self.remaining_time = duration self.timer_thread =...

View Article

How to read a .txt file to graph a plot that show day by day, even months

I got this file in the next format:00:01:28,102,103,103 20-03-202400:02:16,111,110,11000:02:33,108,109,10900:02:49,107,108,10824 hours...

View Article

Streamlit multiple nested buttons, not working

I am trying to implement streamlit UI and two mutually exclusive operation button. each operation has nested streamlit buttons. The buttons behavior should be like if i click on one button, than...

View Article


Does Python have a ternary conditional operator?

Is there a ternary conditional operator in Python?

View Article

Image may be NSFW.
Clik here to view.

How would I groupby and rank in Pandas while excluding one value of the group?

Say I have this dataframe pictured in the 1st screenshot below, I want to rank the scores by Day without considering the "Total" value for each group.The 2nd screenshot below is what I would like the...

View Article


Grammar for access to properties and calls to embedded functions

I'm writing a grammar for a small interpreter in PLY. The part I am working on and where I am having problems is the one that refers to expressions, since this can contain both access to properties and...

View Article

NameError: name 'functools' is not defined

Have googled and found this but unrelated.Trying to run a simple Elastic Net demo and getting the referenced error with the below code.Using Python 3.9 with sklearn...

View Article


How to deal with nodes with no outgoing and incoming flows but show them in...

I am just wondering how to deal with the nodes with no incoming and outgoing flows in Sankey diagram with plotly in Python. To be specific, let's say there are some nodes and links for all nodes but...

View Article

Image may be NSFW.
Clik here to view.

How to display only filename selected in pysimplegui when using a text label...

It's my first try at a pysimplegui application.Before I was using tkinter a lot but interface doesn't look that pretty and modern looking.What I want to do is to have a window with 3 button, 2 to...

View Article

Image may be NSFW.
Clik here to view.

I can't make the last line spread across in my display

I have the following code to print a schedule from inputs but can't make the last line spread under the like the header does.My showRecord code is as follows...Class Appointment: def __str__(appt):...

View Article
Browsing all 13891 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>