python-3.x

Writing a Python UI for a seperate program with tkinter. The stop button for this program basically freezes the UI and continues with the script

别说谁变了你拦得住时间么 提交于 2021-02-10 06:25:16
问题 Here is what I coded... import tkinter as tk import subprocess import sys import time import os import tkinter.font as font from tkinter.ttk import * app = tk.Tk() app.geometry("400x400") app.configure(bg='gray') photo = tk.PhotoImage(file=r"C:\Users\ex\ex_button_active.png") myFont = font.Font(family='Helvetica', size=20, weight='normal') tk.Label(app, text='EX', bg='gray', font=( 'Verdana', 15)).pack(side=tk.TOP, pady=10) app.iconbitmap(r'C:\Users\ex\ex_icon.ico') start = time.time() cmd =

Python pip install Not finding requierements versions

假装没事ソ 提交于 2021-02-10 06:25:15
问题 I am using Python 3.7, pip version: 10.0.1, OS: Windows 10 In CMD i am installing dependencies with the command: Python -m pip install requirements.txt But it show this message: Could not find a version that satisfies the requirement requirements.txt (from versions: ) No matching distribution found for requirements.txt requirements.txt contains: #Flask framework Flask #Flask packages Flask-RESTful Flask-JWT Flask-SQLAlchemy Flask-Mail 回答1: You're missing -r flag in your pip install command

Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings

爱⌒轻易说出口 提交于 2021-02-10 06:16:22
问题 I'm just starting coding and I was trying to download a GUI but the terminal keeps giving me this error Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. I'm trying to install it using this command python -m pip install --upgrade pip setuptools virtualenv 回答1: You need to download python from https://python.org. When in the installation, be sure to check the option that adds Python to PATH.

How to plot only the lower triangle of a seaborn heatmap?

眉间皱痕 提交于 2021-02-10 06:16:06
问题 I've a list of lists all_genres where each sub-lists contain genres for a particular tv-show and each different sub-list refers to different tv-shows. I want to plot a seaborn heatmap but with only the lower traiangle part. Here is what I've tried so far : import numpy as np import matplotlib.pyplot as plt import seaborn as sns sns.set(rc={'figure.figsize':(16,9)}) all_genres = [['Drama', 'History'], ['Documentary'], ['Action', 'Drama', 'History'], ['Documentary'], ['Crime', 'Drama',

Plot dash chart side by side

被刻印的时光 ゝ 提交于 2021-02-10 06:14:53
问题 i have 2 charts and i want it to display side by side . Barchart and piechart side by side and probably the same barchart below these 2 charts.i have tried a lot and i would really appreciate some help. this is the below code import dash import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go from dash.dependencies import Output, Input, State import numpy as np import pandas as pd import plotly.figure_factory as ff from pandas import read_excel

UnicodeDecodeError while starting the app under Windows with Pycharm

我与影子孤独终老i 提交于 2021-02-10 06:14:35
问题 The problem is that when i try to start the application (app.py) i get the following error: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb3 in position 5: invalid start byte The whole file app.py: # -*- coding: utf-8 -*- from flask import Flask app = Flask(__name__) @app.route("/") def hello(): return 'Hello World' if __name__ == "__main__": app.run(host='127.0.0.1') I read somewhere here on stackoverflow that this can help: # -*- coding: utf-8 -*- but it doesn't change anything.

Loops and Collatz Conjecture

北城余情 提交于 2021-02-10 06:14:34
问题 I have a problem with loops and declaring variables. currently I am making a program about Collatz Conjecture, the program should check what is the biggest steps to reach one from certain amount of Collatz Sequence. here's my code : start_num = int(input("insert a starting Number > ")) how_many = int(input("how many times you want to check? >")) def even_or_odd(number): if number % 2 == 0: return 'isEven' else: return 'notEven' def collatz(n): z = n counter = 0 while True: if n != 1: if even

Plot dash chart side by side

依然范特西╮ 提交于 2021-02-10 06:14:12
问题 i have 2 charts and i want it to display side by side . Barchart and piechart side by side and probably the same barchart below these 2 charts.i have tried a lot and i would really appreciate some help. this is the below code import dash import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go from dash.dependencies import Output, Input, State import numpy as np import pandas as pd import plotly.figure_factory as ff from pandas import read_excel

UnicodeDecodeError while starting the app under Windows with Pycharm

眉间皱痕 提交于 2021-02-10 06:14:00
问题 The problem is that when i try to start the application (app.py) i get the following error: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb3 in position 5: invalid start byte The whole file app.py: # -*- coding: utf-8 -*- from flask import Flask app = Flask(__name__) @app.route("/") def hello(): return 'Hello World' if __name__ == "__main__": app.run(host='127.0.0.1') I read somewhere here on stackoverflow that this can help: # -*- coding: utf-8 -*- but it doesn't change anything.

Plot dash chart side by side

限于喜欢 提交于 2021-02-10 06:13:43
问题 i have 2 charts and i want it to display side by side . Barchart and piechart side by side and probably the same barchart below these 2 charts.i have tried a lot and i would really appreciate some help. this is the below code import dash import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go from dash.dependencies import Output, Input, State import numpy as np import pandas as pd import plotly.figure_factory as ff from pandas import read_excel