Thanks to visit codestin.com
Credit goes to github.com

Skip to content

WinPython (lightweight) control panel GUI requests unavailable PyQt #346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
compute-e opened this issue Jun 23, 2016 · 14 comments
Closed

WinPython (lightweight) control panel GUI requests unavailable PyQt #346

compute-e opened this issue Jun 23, 2016 · 14 comments
Labels

Comments

@compute-e
Copy link

compute-e commented Jun 23, 2016

WinPython control panel fails to start in version 3.5.1.3Zero 32bit.
Finding the file "\python-3.5.1\Lib\site-packages\winpython\controlpanel.py" (where is the root directory of the installation) which I believe runs the WinPython control panel, I ran it from the Windows Command Prompt terminal which produced the following module import error (see image).
image
This control panel start error is definitely an issue, however I am not sure if I have correctly identified the source of it. (UPDATE) I doubt I have as this file is run by default with a different version of Python (that doesn't have the WinPython package). I then ran it with the WinPython interpreter and encountered another proper error, in a qt module file in the WinPython module folder:
image

@stonebig
Copy link
Contributor

stonebig commented Jun 24, 2016

Indeed:

  • "Zero" version don't include PyQt/Qt, as it's "enormous"
  • I didn't have the courage to redo a "WinPython Control Panel" in other lightweight technology yet:
    • tcl/tk,
    • pythonnet,
    • web (bottle ?)
  • another point is that we are more "pip" than ever, so maybe "pip" lords will provide that gui for us one day.

@compute-e
Copy link
Author

compute-e commented Jun 26, 2016

The WinPython Control Panel is a definitely a useful idea made into a tool. It makes configuring things that may otherwise be hard to do easier, with the benefit of being in a graphical user interface as well. So the WinPython team should try to fix this problem, and as @stonebig suggests, it could even be changed to use faster/simpler technology (user interfaces, programming languages) such as:

  • Tk U.I. (could be controlled using the Python language, as it is built-in with WinPython - Tkinter module)
  • Qt U.I. (can also be controlled using the built-in Python language in WinPython - PyQt plug-in)
  • other solutions and programming languages (may not be as "lightweight" or already part of WinPython package)

P.S. (to Stonebig) I assume you mean the current (at time of comment) "Zero" version doesn't include PyQt or Qt as the version 3.5.1.3Zero seems to have Qt but not PyQt.

@stonebig
Copy link
Contributor

no no, there is no Qt in Zero, only tcl/tk and what is already on your system, a browser and .Net.

@stonebig stonebig changed the title WinPython control panel fails to start in version 3.5.1.3Zero 32bit. WinPython control panel GUI should not rely on PyQt Jul 21, 2016
@stonebig
Copy link
Contributor

Apparently this effort is useless;

  • we will still need PyQt for Spyder next year,
  • next year we drop Python 3.4, so we have "pip install PyQt5.7" easy step,
  • some noise on Pypi considering doing a GUI, if not Jupyter or Flexx, after next year.

@compute-e compute-e changed the title WinPython control panel GUI should not rely on PyQt WinPython (lightweight) control panel GUI requests unavailable PyQt Jul 14, 2017
@compute-e
Copy link
Author

compute-e commented Jul 14, 2017

@stonebig Leaving the graphical user interface of the lightweight WinPython control panel broken is still a bad idea so you could reopen this issue as a reminder for someone to fix it.

@stonebig stonebig reopened this Jul 15, 2017
@stonebig
Copy link
Contributor

stonebig commented Jan 22, 2023

in recent Winpython via command line we get clother to the functionnalities:

  • you can see the list of package via "pip list"
  • you can navigate the dependancies via "wppm -p " or upward dependancies via "wppm -r "
wppm
usage: wppm [-h] [-t TARGET] [-i] [-u] [-r] [-p] [-l LEVELS_OF_DEPTH] [--register] [--unregister] [package]

WinPython Package Manager: view, install, uninstall or upgrade Python packages on a Windows Python distribution like WinPython.

positional arguments:
  package               path to a Python package, or package name

options:
  -h, --help            show this help message and exit
  -t TARGET, --target TARGET
                        path to target Python distribution (default: "C:\WinP\bd310\bu\WPy64-31090\python-3.10.9.amd64")  -i, --install         install package (this is the default action)
  -u, --uninstall       uninstall package
  -r, --reverse-tree    show reverse dependancies of the package
  -p, --package-tree    show  dependancies of the package
  -l LEVELS_OF_DEPTH, --levels_of_depth LEVELS_OF_DEPTH
                        show  l levels_of_depth
  --register            Register distribution
                        (experimental)
                        This will associate file extensions, icons and
                        Windows explorer's context menu entries ('Edit with IDLE', ...)
                        with selected Python distribution in Windows registry.

                        Shortcuts for all WinPython launchers will be installed
                        in WinPython Start menu group (replacing existing
                        shortcuts).

                        Note: these actions are similar to those performed
                        when installing old Pythons with the official installer before 'py'
                        .
  --unregister          Unregister distribution
                        ({bold}experimental{unbold})
                        This will remove file extensions associations, icons and
                        Windows explorer's context menu entries ('Edit with IDLE', ...)
                        with selected Python distribution in Windows registry.

                        Shortcuts for all WinPython launchers will be removed
                        from {bold}WinPython{unbold} Start menu group."
                        .

a web interface via remi is still to build or get for free from the community

@stonebig
Copy link
Contributor

stonebig commented Jan 22, 2023

hummm, let's ask to our new community member:

image

@stonebig
Copy link
Contributor

stonebig commented Jan 22, 2023

import remi.gui as gui
from remi import start, App

class MyApp(App):
    def __init__(self, *args):
        super(MyApp, self).__init__(*args)

    def main(self):
        container = gui.VBox(width=300, height=200)

        self.list1 = gui.Table.new_from_list(["Item 1", "Item 2", "Item 3"], width=150, height=150)
        self.list2 = gui.Table.new_from_list(["Item 4", "Item 5", "Item 6"], width=150, height=150)
        container.append(self.list1)
        container.append(self.list2)

        self.list1.set_on_drag_start(self.on_drag_start)
        self.list2.set_on_drag_start(self.on_drag_start)
        self.list1.set_on_drop(self.on_drop)
        self.list2.set_on_drop(self.on_drop)

        # returning the root widget
        return container

    def on_drag_start(self, emitter, x, y, data):
        if emitter == self.list1:
            data['list'] = 1
        else:
            data['list'] = 2
        data['item'] = emitter.get_item_at_coordinates(x, y)

    def on_drop(self, emitter, x, y, data):
        if emitter == self.list1:
            other_list = self.list2
        else:
            other_list = self.list1

        if data['list'] == 1:
            self.list1.remove_at(self.list1.get_item_index(data['item']))
        else:
            self.list2.remove_at(self.list2.get_item_index(data['item']))

        other_list.append(data['item'])

if __name__ == "__main__":
    start(MyApp)

@stonebig
Copy link
Contributor

hum, lets'try otherwise
image

@stonebig
Copy link
Contributor

import PySimpleGUI as sg

layout = [[sg.Listbox(values=["Item 1", "Item 2", "Item 3"], key='list1', size=(30, 6), enable_events=True)],
          [sg.Listbox(values=["Item 4", "Item 5", "Item 6"], key='list2', size=(30, 6), enable_events=True)],
          [sg.Button('Move')]]

window = sg.Window('Drag and Drop', layout)

while True:
    event, values = window.read()

    if event == 'Move':
        list1 = values['list1']
        list2 = values['list2']
        for i in list1:
            window['list1'].remove(i)
            window['list2'].append(i)
    elif event == sg.WIN_CLOSED:
        break

window.close()

image

@stonebig
Copy link
Contributor

looks like remi nor pysimplegui are not ideal... let ask to our padawan with tcl/tk
image

@stonebig
Copy link
Contributor

import tkinter as tk

def on_select(evt):
    w = evt.widget
    index = int(w.curselection()[0])
    value = w.get(index)
    print(f'You selected item {value}')

root = tk.Tk()

listbox1 = tk.Listbox(root, selectmode=tk.SINGLE)
listbox2 = tk.Listbox(root, selectmode=tk.SINGLE)

for item in ["Item 1", "Item 2", "Item 3"]:
    listbox1.insert(tk.END, item)

for item in ["Item 4", "Item 5", "Item 6"]:
    listbox2.insert(tk.END, item)

listbox1.pack(side=tk.LEFT)
listbox2.pack(side=tk.LEFT)

listbox1.bind('<<ListboxSelect>>', on_select)
listbox2.bind('<<ListboxSelect>>', on_select)

root.mainloop()

image

@stonebig
Copy link
Contributor

stonebig commented May 2, 2023

hum..... following AndreNg "one hour + thinking" course on how to use LLM (Large Langage Models, aka ChatGPT):

  • lesson is : give more time for the LLM to think on your problem,
  • and so I tried on the "free" chatGPT4 included in Edge. with feddbacking errors.

Another (1 hour teaching by simple exercize) stone on Andrew Ng Wall of Fame
https://deeplearning.ai/short-courses/chatgpt-prompt-engineering-for-developers/

result at the 6th iteration is a success (or 5 iterations to get there):

image

image

code:

import tkinter as tk
from tkinter import ttk

class DragDropTable(tk.Frame):
    def __init__(self, master=None):
        super().__init__(master)
        self.master = master
        self.initUI()

    def initUI(self):
        self.master.title("Drag and Drop Table")

        # Create two tables
        self.table1 = ttk.Treeview(self.master)
        self.table1.heading("#0", text="Table 1")
        self.table1.pack(side=tk.LEFT)

        self.table2 = ttk.Treeview(self.master)
        self.table2.heading("#0", text="Table 2")
        self.table2.pack(side=tk.RIGHT)

        # Add some sample data to the tables
        for i in range(10):
            self.table1.insert("", "end", text=f"Item {i}")

        for i in range(5):
            self.table2.insert("", "end", text=f"Item {i}")

        # Allow drag and drop between the tables
        self.table1.bind("<Button-1>", self.on_button_press)
        self.table2.bind("<Button-1>", self.on_button_press)
        self.table1.bind("<B1-Motion>", self.on_motion)
        self.table2.bind("<B1-Motion>", self.on_motion)

    def on_button_press(self, event):
        widget = event.widget
        item = widget.identify_row(event.y)
        
        # Check if item exists in the table
        if item:
            widget.selection_set(item)

    def on_motion(self, event):
        widget = event.widget
        
        # Check if selection is not empty
        if widget.selection():
            item = widget.selection()[0]
            
            # Use parent() method to get the parent of the item
            parent = widget.parent(item)
            
            # Use index() method to get the index of the item
            index = widget.index(item)
            
            # Move the item to the new position
            widget.move(item, "", index)
            
            # Insert the item into the new table
            if parent == "":
                if widget == self.table1:
                    new_parent = self.table2.insert("", "end", text=widget.item(item)["text"])
                else:
                    new_parent = self.table1.insert("", "end", text=widget.item(item)["text"])
            else:
                if widget == self.table1:
                    new_parent = self.table2.insert(parent, "end", text=widget.item(item)["text"])
                else:
                    new_parent = self.table1.insert(parent, "end", text=widget.item(item)["text"])
            
            # Delete the item from the old table
            widget.delete(item)

def main():
    root = tk.Tk()
    app = DragDropTable(master=root)
    app.mainloop()

if __name__ == '__main__':
    main()

@stonebig
Copy link
Contributor

stonebig commented May 4, 2025

pysimplegui has turn different...

so:

  • looked for options in flet #1535
  • will need an IA when a liked option will emerge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants