Python Forum
[PyQt] command require close window
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] command require close window
(Nov-18-2022, 09:48 PM)deanhystad Wrote: What is preventing you from opening the window with new data?

Normally a GUI stays open. You push a button and it draws a plot. Maybe you enter some information, a filename or some numbers, you push the button and the old plot is replaced with a new plot.

It sounds like you have a script. It runs a program to display a plot. When you are done looking at the plot you close the window and the script creates another window that displays a plot. Is that correct?

Yes Dean it's very correct.
(Nov-18-2022, 11:19 PM)Yoriz Wrote: The Button code looks like tkinter it shows Map as being the code called on a button press,
but the definition of Map is not shown in any of the code.

The rest of the code shown is PyQt you should not mix a tkinter Button with PyQt.

Can you please show more complete code including the imports.

import csv
from tkinter import *
from tkinter import ttk
from tkinter import ttk, filedialog
from tkinter import messagebox
import pymysql
from tkcalendar import DateEntry
import os
from datetime import datetime
from PyQt5.QtWidgets import QApplication, QWidget, QHBoxLayout, QVBoxLayout
from PyQt5.QtWebEngineWidgets import QWebEngineView  # pip install PyQtWebEngine
from cmath import pi
from math import radians, cos, sin, sqrt, degrees, asin, atan2, acos
import folium
import sys
import io
import babel.numbers
indeed the rest is made with tkinter
you should make up your mind, tkinter or PyQt. Don't mix both.
(Nov-19-2022, 10:46 AM)Axel_Erfurt Wrote: you should make up your mind, tkinter or PyQt. Don't mix both.

Thank you Axel, i will follow your tutorial and try the code from tkinter. !
from tkinter import *
import tkintermapview

root = Tk()
root.title('Map Viewer')

map_widget = tkintermapview.TkinterMapView(root, width=800, height=600, corner_radius=0), rely=0.5, anchor=CENTER)

map_widget.set_position(48.860381, 2.338594)  # Paris, France
marker_2 = map_widget.set_marker(48.860381, 2.338594, text="Paris")

I managed to do something working...
The next question will be ?Do you know a way for working offline, a way to download offline maps for TkinterMapView? Or working on a piece of map like South West of France or any other country?

Possibly Related Threads…
Thread Author Replies Views Last Post
  tkinter window and turtle window error 1885 3 5,190 Nov-02-2019, 12:18 PM
Last Post: 1885
  Require scroll bars horizontal and vertical throughout the window tejgandhi 2 2,159 Jun-28-2019, 03:13 AM
Last Post: tejgandhi
  Launch pdf and close on delete window event ashtona 6 4,194 Mar-22-2018, 03:04 PM
Last Post: ashtona
  update a variable in parent window after closing its toplevel window gray 5 7,530 Mar-20-2017, 10:35 PM
Last Post: Larz60+
  [Tkinter] I have a Toplevel button in tkinker that I want to close the window and then perform Bloodypizza17 2 6,827 Jan-06-2017, 07:18 PM
Last Post: Bloodypizza17
  Hide command window sparkz_alot 8 18,788 Sep-29-2016, 10:14 AM
Last Post: wavic

Forum Jump:

User Panel Messages

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