[issue27051] Create PIP gui
Upendra Kumar added the comment: I have tried to inquire about the possibility of a pip API, however currently it doesn't seem that it is top priority for pip organisation as per these issue threads : 1. https://github.com/pypa/pip/issues/924 2. https://github.com/pypa/pip/issues/3999 Currently pip list has --format option to give output as json format. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: @Terry, I believe pip package doesn't solve the core purpose of GUI. Instead of that I should make a .deb, .rpm or .exe package so that beginners can directly install it. However, I will create the PyPI package by 10th Feb. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: @Terry, The attached files contain the master branch of the pip_gui. It contains all the work done by me till now in pip_gui. If this projects need to be continued as open source project, is it expected to be continued as independent project, or CPython project or pip project. I am confused about it. However, I think that the project should be continued with pip, which will also help speed up the process of standardization of output of pip for different commands. I believe still there are a lot of pip commands not having 'json' output. -- Added file: http://bugs.python.org/file46500/pip_gui-master.zip ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: Can I somehow change the setup.py script such that I can create a new set of (group, user) with specific privileges only needed for installation and uninstallation. Once a new set of (group, user) is created, I can always do os.setgid(gid) and os.setuid(uid) But, I can't figure out how to change setup.py to create a new set of permissions during installation. It should be possible because at time of installation setup.py runs with sudo privileges. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: I facing problems in running the GUI application with root or elevated privileges. I earlier used gksudo for linux. It turns out be a not very general solution as all linux distros don't have gksudo. Therefore, how to manage user permissions or group permissions. I want my program to run temporarirly with elevated permissions in order to install, update or uninstall python packages. I am using subprocess. Is it possible to run subprocess with elevated privileges and again reset the permissions when the shell process ends? -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: @Terry, I am switching between different frames using frame.tkraise() method in order to switch the user attention. Now, if I want to test which frame is at top what should I check for or which parameter I should check. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Tkinter based GUI for PIP : Needed Feedback
Hello everyone, We have made a preliminary version of GUI for PIP. This project is a part of GSoC 2016. This project is intended to provide a GUI version for "pip". ( target audience for the project : beginners in Python ). The project idea is discussed on these issues : 1. Issue #23551 : IDLE to provide menu link to PIP gui. 2. Issue #27051 : Create PIP GUI The GitHub repo of the project : https://github.com/upendra-k14/pip_gui Therefore, we would like to have feedback on this project so that we can improve the GUI and other features to it. Please post as many issues and suggestions here : https://github.com/upendra-k14/pip_gui/issues. -- https://mail.python.org/mailman/listinfo/python-list
[issue27051] Create PIP gui
Upendra Kumar added the comment: For using threading with Tkinter there are two options : either to use threading or asyncio ( coroutines ). Because asyncio is easier as compared to threading, therefore I would like to use it. But, coroutines are available only in Python >=3.5. Therefore should we target all Python 3 users or Python>=3.5 users? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: Refer to : msg269285 This is the code : ... from pip_tkinter.utils import pip_install_from_PyPI curr_item = self.multi_items_list.scroll_tree.focus() item_dict = self.multi_items_list.scroll_tree.item(curr_item) selected_module = item_dict['values'][0] self.controller.debug_bar.config( text='Installing package {}...Please wait'.format(selected_module)) self.install_queue = queue.Queue() self.install_thread = threading.Thread( target=pip_install_from_PyPI, kwargs={ 'package_args':selected_module, 'thread_queue':self.install_queue}) self.install_thread.start() self.after(100, self.check_install_queue) -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: I am trying something similar to BrownTruck in issue : https://github.com/pypa/pip/pull/3733 I tried to execute pip.main('install','-U',) from a thread. I got a similar error : Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/pip/commands/install.py", line 299, in run requirement_set.prepare_files(finder) File "/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 370, in prepare_files ignore_dependencies=self.ignore_dependencies)) File "/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 476, in _prepare_file with indent_log(): File "/usr/lib/python3.4/contextlib.py", line 59, in __enter__ return next(self.gen) File "/usr/local/lib/python3.4/dist-packages/pip/utils/logging.py", line 34, in indent_log _log_state.indentation += num AttributeError: '_thread._local' object has no attribute 'indentation' There is some problem with threading.local() in pip.utils.logging. Can anyone please suggest a workaround for it. It is necessary for me to use threads other than the main GUI thread to update text. I need to update text and do long processes ( like searching for results using pip search command or installing or uninstalling) when someone presses a button. When I don't use threading to update text, the GUI text is updated only after the callback returns. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: In ref. to msg269264: @Terry, I am ready to maintain this project. But for as backup is concerned I really don't know a lot of people and where should I look for them. In reference to msg269038: I was more engrossed in reading through other messages related to pip gui that I forgot to clarify about it. For pip install and uninstall command, I have used the pip.main() instead of subprocess module. There were two reasons for it ( what I thought): 1. More reliable, because I thought the output on CLI may change more frequently than arguments in pip.main(). (I think may be this assumption is wrong). 2. I figured out a way to clear pip loggers ( which caused to produce duplicate output ). I found it on a issue in pip Github repo : Adding one line of : pip.logger.consumers = [] in runpip(). It cleared the pip loggers responsible for producing duplicate output. ( due to this I liked pip.main(). The only troubling part about it was duplicate output ) This is just what I thought. I can very easily switch to subprocess module. Very less changes will be required in the code. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: Sorry for trouble. I think I messed up with my Python installation. I reinstalled Python and pip. The "pip install command issue" is fixed. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: Hey, can anyone help me with this code : ### Python 3.4.3 (default, Oct 14 2015, 20:33:09) [GCC 4.8.4] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import pip >>> pip.main(["install","-U","wheel"]) Requirement already up-to-date: wheel in /usr/local/lib/python3.4/dist-packages Cleaning up... 0 >>> pip.main(["install","-U","timingwheel"]) Downloading/unpacking timingwheel Downloading/unpacking timingwheel Downloading timingwheel-0.4.tar.gz Downloading timingwheel-0.4.tar.gz Running setup.py (path:/tmp/pip_build_scorpio/timingwheel/setup.py) egg_info for package timingwheel Running setup.py (path:/tmp/pip_build_scorpio/timingwheel/setup.py) egg_info for package timingwheel Traceback (most recent call last): Traceback (most recent call last): File "", line 17, in File "", line 17, in File "/tmp/pip_build_scorpio/timingwheel/setup.py", line 3, in File "/tmp/pip_build_scorpio/timingwheel/setup.py", line 3, in from timingwheel import version from timingwheel import version File "/tmp/pip_build_scorpio/timingwheel/timingwheel/__init__.py", line 1, in File "/tmp/pip_build_scorpio/timingwheel/timingwheel/__init__.py", line 1, in from timingwheel import BaseWheel, TimingWheel from timingwheel import BaseWheel, TimingWheel ImportError: cannot import name 'BaseWheel' ImportError: cannot import name 'BaseWheel' Complete output from command python setup.py egg_info: Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 17, in File "/tmp/pip_build_scorpio/timingwheel/setup.py", line 3, in from timingwheel import version File "/tmp/pip_build_scorpio/timingwheel/timingwheel/__init__.py", line 1, in from timingwheel import BaseWheel, TimingWheel ImportError: cannot import name 'BaseWheel' Traceback (most recent call last): File "", line 17, in File "/tmp/pip_build_scorpio/timingwheel/setup.py", line 3, in from timingwheel import version File "/tmp/pip_build_scorpio/timingwheel/timingwheel/__init__.py", line 1, in from timingwheel import BaseWheel, TimingWheel ImportError: cannot import name 'BaseWheel' Cleaning up... Cleaning up... Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_scorpio/timingwheel Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_scorpio/timingwheel Storing debug log for failure in /home/scorpio/.pip/pip.log Storing debug log for failure in /home/scorpio/.pip/pip.log 1 ### ### In the above failure, pip install functionality fails. I don't know why. Other functionalities like "search" and "list" works perfectly. But, when I tried to connect this pip install command with my GUI button, I got the above error. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: For blog posts related to this project, here is the blog link : https://scorython.wordpress.com For now, there are following posts : 1. Application Screenshots 2. Design Patterns: How to write reusable and tidy software? ( to be completed) 3. Menace of Global Variables : Just a light post 4. Page Layouts and Application Flow of Logic 5. Ist Design Iteration of ‘pip’ GUI 6. My First GSoC Post : Notes on process of designing a GUI application -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: For executing it currently, we need to run it like this: python -m pip_tkinter Recently, I have changed code. Therefore we can't execute individual pages/layouts by running it with "python -m pip_tkinter.". I will change the code in "__main__" section so that they can be executed independently. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: I, actually want to make a 'configuration object' before running the 'pip' GUI. Therefore one of the parameters of the configuration object will be to detect the path to installed 'python.exe' in Windows. In order to get executable paths I need to read the Windows registry keys. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: I am unable to print anything using winreg module. Does it require administrative privileges? I am using this code sample : import os import errno import winreg proc_arch = os.environ['PROCESSOR_ARCHITECTURE'].lower() try: proc_arch64 = os.environ['PROCESSOR_ARCHITEW6432'].lower() except KeyError: proc_arch64 = None pass if proc_arch == 'x86' and not proc_arch64: arch_keys = {0} elif proc_arch == 'x86' or proc_arch == 'amd64': arch_keys = {winreg.KEY_WOW64_32KEY, winreg.KEY_WOW64_64KEY} else: raise Exception("Unhandled arch {}".format(proc_arch)) for arch_key in arch_keys: key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Python", 0, winreg.KEY_READ | arch_key) for i in range(0, winreg.QueryInfoKey(key)[0]): skey_name = winreg.EnumKey(key, i) skey = winreg.OpenKey(key, skey_name) try: print(winreg.QueryValueEx(skey, 'DisplayName')[0]) except OSError as e: if e.errno == errno.ENOENT: pass finally: skey.Close() -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: @Terry and @Lorenzo, As shown in the GUI of "install_pyPI_v1.png", I needed to add some tkinter widget into treeview. For example, adding a checkbox to the treeview so that multiple selections are possible. In figure "install_pyPI_v1.png", a checkbox in each row of treeview is needed. I am not getting idea about how to implement it? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: Actually now we don't need "pip list" command to get list of installed distributions. We can directly get it : from pip_tkinter._vendor import pkg_resources installed_packages = [p.project_name for p in pkg_resources.working_set] -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: @Terry, code updates can be followed on https://github.com/upendra-k14/pip_gui/tree/dump_code Please review the code in dump_code branch. For now, only pip_gui_v3.py is relevant. 1. I had doubt about including a private module from pip ( "pip._vendor" ). As this module contains a lot of important utilites I have included it by copying the "_vendor" module in my package and changed all the package references of "pip._vendor" to "pip_tkinter._vendor" to make it work. Since, it was a private module, I included it by copying it. One more reason is that pip has mentioned this module has immutable. There are very less chances that further changes in this module will be introduced in future. 2. Except a few complex commands like install, I have planned to inherit the pip command classes. For example, I have inherited the pip.commands.SearchCommand class from pip and overrided the "run" method. It helped me to give finer control over the search results. For example, Now we can retrieve all previous versions of a package ( which is not provided by pip ) and search results can be directly obtained in form of tuple lists without parsing the output. But, I think doing something similar for pip.commands.InstallCommand is very difficult. Therefore, for now I have chosen to use "runpip and pip.main" for pip install command. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Changes by Upendra Kumar <upendra@iiits.in>: Added file: http://bugs.python.org/file42998/update_package_v1.png ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Changes by Upendra Kumar <upendra@iiits.in>: Added file: http://bugs.python.org/file42997/install_local_archive_v1.jpg ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Changes by Upendra Kumar <upendra@iiits.in>: Added file: http://bugs.python.org/file42996/install_requirement_v1.jpg ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Changes by Upendra Kumar <upendra@iiits.in>: Added file: http://bugs.python.org/file42995/install_pyPI_v1.png ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Changes by Upendra Kumar <upendra@iiits.in>: Added file: http://bugs.python.org/file42993/welcome_v1.jpg ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Changes by Upendra Kumar <upendra@iiits.in>: Added file: http://bugs.python.org/file42994/select_venv_system.jpg ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: I am posting flow of logic for application and related page layouts. Related layouts are : 1. welcome_v1 2. select_venv_system 3. install_pyPI_v1 4. install_local_archive_v1 5. install_pythonlibs_v1 6. install_requirements_v1 7. update_package_v1 8. remove_package_v1 9. finish_tasks_v1 ( can be decided later depending on further options ) Here , update_package_v1 and remove_package_v1 will be very similar. Therefore, for now I have made layout for update_package_v1 only. -- Added file: http://bugs.python.org/file42992/design_flow.pdf ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: 3. Detecting Virtual Environment Virtual environment can be detected using pip module : from pip.locations import running_under_virtualenv if running_under_virtualenv(): #If user provided path for virtual environment, evrything okay else: #Prompt for error -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: 2. Detecting different versions of Python installed : For Windows : It is explained in PEP 514 by Steve Dower. Windows has registry keys which can be accessed by winreg or _winreg module. Priority of registry keys : HKEY_CURRENT_USER > HKEY_LOCAL_MACHINE On 64 bit Windows there is another registry key for 32 bit programs, HKEY_LOCAL_MACHINE\Software\Wow6432Node Therefore using registry keys we can know about Python packages installed by enumerating on : 1. HKEY_CURRENT_USER\Software\Python\\\ 2. HKEY_LOCAL_MACHINE\Software\Python\\\ 3. HKEY_LOCAL_MACHINE\Wow6432Node\Python\\\ will tell the version number of Python, and in key there are two more subkeys which will tell the location of Python executable : 1. 2. For Linux : We can find Python installations in /usr/bin/pythonXYZ For MAC OS : It can be searched for in /Library/Frameworks/ /System/Library/Frameworks If Python was installed by Homebrew : Then the location can be in /usr/local -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: These are some of the code parts which may be necessary : 1. Code for identification of OS from sys import platform if platform.startswith("linux"): #linux elif platform == "darwin": #mac os x else platform == "win32": # Windows -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
Upendra Kumar added the comment: I have uploaded my first iteration of design process for Tkinter. In the uploaded document "Design_notes_v1.docx", we have tried to identify different use cases and tasks to be fulfilled by the PIP GUI. If there are any suggestions regarding further changes or possible use cases, please let me know. I will upload design of different page layouts for the GUI soon. -- Added file: http://bugs.python.org/file42927/Design_notes_v1.docx ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27051] Create PIP gui
New submission from Upendra Kumar: This is new issue opened for creating a GUI (tkinter) front end for pip. It is in continuation with Issue #23551. -- components: Tkinter messages: 265810 nosy: terry.reedy, upendra-k14 priority: normal severity: normal status: open title: Create PIP gui type: enhancement ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27051> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23551] IDLE to provide menu link to PIP gui.
Upendra Kumar added the comment: I have one doubt about writing unittests for pip_gui. For writing the unittest what should I use as a test instance? For example, if we take particular pip package like : Flask Now, if I have to test the 'get_data_show()' function in temp_pip_v3.py (using the assertXYZ functions), then I will use the output of 'pip show flask' as an example test case. But, it may be the case that Flask is not installed in others' machine. In this case the test would fail. Therefore, what should I use as a example test case? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23551> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23551] IDLE to provide menu link to PIP gui.
Upendra Kumar added the comment: I had just one more idea after carefully going through all the options provided by pip. Other than the features suggested by Raymond, we should also provide option for installing using proxy settings. Sometimes, configuring proxy can also be tricky while downloading. Can this be an additional feature? It can be easily implemented as pip provides --proxy option. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23551> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23551] IDLE to provide menu link to PIP gui.
Upendra Kumar added the comment: @Terry, I have tried to implement the treeview (as suggested by Alexander) and separate out the functions for retrieving data and displaying data. But, I have doubt on how to separate out the functions for getting data and displaying data. Further, I have changed the definition of 'runpip' function. I have used the subprocess module. Because of that few bugs are removed, but the speed of getting results from the pip command is slightly reduced. Therefore, if you can get time to review my updated code, please tell me about possible improvements. -- Added file: http://bugs.python.org/file42287/tem_pip_v3.py ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23551> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23551] IDLE to provide menu link to PIP gui.
Upendra Kumar added the comment: Here, I have one doubt regarding the get_data function that should the get_data function be a common function for different features for example : def _get_data(self, func_option): """ A separate function for extracting data from the runpip() function. It is done in order to get this function tested using unittest module According to func_option, it returns the data extracted : Options: --- 1. list : for listing all currently installed packages 2. show : show details of installed packages 3. search : show formated search results 4. install : get results while installing packages """ splitted_options = func_option.split() if splitted_options[0] == 'list': return runpip(func_option) elif splitted_options[0] == 'show': return runpip(func_option) elif splitted_options[0] == 'search': return runpip(func_option) elif splitted_options[0] == 'install': return runpip(func_option) I am not clear would this single function for retrieving data would be good for uniitest or different functions would be good for retrieving data. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23551> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23551] IDLE to provide menu link to PIP gui.
Upendra Kumar added the comment: I trying to write the Tk application for the pip package manager. It is in very initial stage, with none of the functionalities implemented yet. I have attached the current state of code written by me. I have also included the wrapper provided by Terri for pip command line. Please can someone review my current code , if I am on correct path? If there are some objections to my coding style and the structure of program, please do tell me. -- Added file: http://bugs.python.org/file41825/tem_pip_v2.py ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23551> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23551] IDLE to provide menu link to PIP gui.
Upendra Kumar added the comment: @Terry, I am an intended GSOC student and I came through this idea of developing a GUI based on Tkinter in the python core-mentorship mailing lists. You highlighted/mentioned this issue in the mailing list. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23551> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23551] IDLE to provide menu link to PIP gui.
Upendra Kumar added the comment: I am trying to make a Tk based GUI for pip package manager. In reference to msg256736, I am confused about the discovery method mentioned. Is there any way already implemented to detect the Python versions installed systemwide? Moreover, how to manage the non-standard installation of Python by users? I think in that case, it would be very difficult to detect the Python versions installed in the user's system. In addition to it different tools used for installation of Python generally end up in installing in different folders or paths. Therefore, initially what functionality should I try to implement in it? Can anyone please suggest me? -- nosy: +upendra-k14 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23551> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26002] make statistics.median_grouped more efficient
Upendra Kumar added the comment: Yeah, I slightly modified the functions from the bisect docs to suit for the purpose here. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26002> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26002] make statistics.median_grouped more efficient
Upendra Kumar added the comment: Can someone please review my patch? I think it can increase the performance significantly of the median_grouped() function. But, I don't have any standard way of checking if it would improve or will be an overkill for the median_grouped() function? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26002> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26029] Broken sentence in extending documentation
Upendra Kumar added the comment: I am submitting the patch with small change suggested by you. Thank you. -- keywords: +patch nosy: +upendra-k14 Added file: http://bugs.python.org/file41524/building_additional.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26029> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26001] Tutorial: write() does not expect string in binary mode
Upendra Kumar added the comment: I also think that for better clarification, binary mode and text mode should be specified clearly for both methods read() and write(). For read(), I have changed it to: ' some quantity of data and returns it as a string (in text mode) or bytes object (in binary mode).' For write(), I have changed it to: ' To write something other than a string (in text mode) or bytes object (in binary mode), it needs to be converted first to string or bytes object respectively. ' Please if someone could review it, as I have not submitted a patch related to docs before. And I am not sure, if I have made correct changes at right place. -- keywords: +patch nosy: +upendra-k14 Added file: http://bugs.python.org/file41486/fileiotutorial.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26001> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26002] make statistics.median_grouped more efficient
New submission from Upendra Kumar: statistics.median_grouped currently uses cf=data.index(x) to find the leftmost position of x in data ( line number 445 ). Here, data.index() has linear time complexity, which may not be good for long lists. But, here since the list 'data' is sorted beforehand, we can use binary search ( bisect_left() ) to find the leftmost occurrence of 'x' in 'data'. Similarly, for counting number of occurrence of 'x' in data after sorting, we can find the position of rightmost occurrence of 'x' in data[l1len(data)], where l1 is position of leftmost occurrence of 'x' (line number 447 ) -- components: Library (Lib) files: median_grouped.patch keywords: patch messages: 257419 nosy: upendra-k14 priority: normal severity: normal status: open title: make statistics.median_grouped more efficient type: performance versions: Python 3.4, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file41484/median_grouped.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26002> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21592] Make statistics.median run in linear time
Upendra Kumar added the comment: This is my first attempt to contribute. I have used the Median of Medians with n/5 groups of 5 elements each. It has linear time complexity. But, still I am not sure about it, because constants may be high. Therefore, if anyone can please benchmark it with other methods or check that can this method be a viable solution to finding median more efficiently? I will like it to be checked before I make attempts to convert it into a patch. -- nosy: +upendra-k14 Added file: http://bugs.python.org/file41479/effmedian.py ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21592> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21592] Make statistics.median run in linear time
Upendra Kumar added the comment: This method can also be further used to implement multiselect functionality with slight changes in the nth-order function. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21592> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
how to compare two fields in python
I have a very basic question in python. I want to go through each line of the a csv file and compare to see if the first field of line 1 is same as first field of next line and so on. If it finds a match then i would like to put that field in an object1 else put that field in a different object2. Finally i would like to count how many of the fields in object1 vs object2. Can this be done in python? Here is a small example. BRM_1 679 1929 BRM_1 203 567 BRM_2 367 1308 BRM_3 435 509 As you can see field1 of line1 is same as field2 of line2 and so that field BRM_1 should be place in object1 and BRM_2 and BRM_3 should be placed in object2. So the final numbers of object1 is 1 and object2 is 2. Thanks in advance.. Upendra -- http://mail.python.org/mailman/listinfo/python-list
Re: how to compare two fields in python
The data was sorted and so duplicates will not appear anywhere in the dataframe. The values does not have significance and can be ignored safely. Thanks Upendra On Tuesday, April 30, 2013 11:19:56 AM UTC-7, Tim Chase wrote: On 2013-04-30 10:41, upendra kumar Devisetty wrote: I have a very basic question in python. I want to go through each line of the a csv file and compare to see if the first field of line 1 is same as first field of next line and so on. If it finds a match then i would like to put that field in an object1 else put that field in a different object2. Finally i would like to count how many of the fields in object1 vs object2. Can this be done in python? Here is a small example. BRM_1 679 1929 BRM_1 203 567 BRM_2 367 1308 BRM_3 435 509 As you can see field1 of line1 is same as field2 of line2 and so that field BRM_1 should be place in object1 and BRM_2 and BRM_3 should be placed in object2. So the final numbers of object1 is 1 and object2 is 2. You underdefine the problem. What happens in the case of: BRM_1 ... BRM_1 ... BRM_2 ... BRM_1 ... -- duplicates a (not-immediately) previous line BRM_3 ... Also, do the values that follow have any significance for this, or are they just noise to be ignored? -tkc -- http://mail.python.org/mailman/listinfo/python-list