Re: PEP668 / pipx and "--editable" installs

2023-09-20 Thread c.buhtz--- via Python-list
Dear Peter, maybe we have a missunderstanding. Am 20.09.2023 14:43 schrieb Peter J. Holzer via Python-list: > > "dateutil" is not available from PyPi for Python 3.11 That's quite a curious thing to write if you are aware that dateutil is in fact available from PyPi for Python 3.11. Do I mis

Re: PEP668 / pipx and "--editable" installs

2023-09-18 Thread c.buhtz--- via Python-list
On 2023-09-18 10:16 "Peter J. Holzer via Python-list" wrote: > On 2023-09-15 14:15:23 +, c.buhtz--- via Python-list wrote: > > I tried to install it via "pipx install -e .[develop]". It's > > pyproject.toml has a bug: A missing dependency "dateut

Re: PEP668 / pipx and "--editable" installs

2023-09-17 Thread c.buhtz--- via Python-list
Thanks for your reply. btw: I do know what a virtual environment is and how its works. No need to explain. And again: I do expect "pipx" to use virtual environments. So this thread is not about pro and cons of using virtual environments. On 2023-09-17 11:57 Rimu Atkinson via Python-list wrote: >

Re: PEP668 / pipx and "--editable" installs

2023-09-15 Thread c.buhtz--- via Python-list
Dear Rimu, thanks for your reply. I'm willing to learn for sure. On 2023-09-16 14:17 Rimu Atkinson via Python-list wrote: > There's your problem - everything else is a result of this. There is > just no nice way to work with a combination of pypi, apt-get and > system-wide python. > > Everyon

PEP668 / pipx and "--editable" installs

2023-09-15 Thread c.buhtz--- via Python-list
Hello, I wonder that today was the first day I stumbled over PEP668 / pipx and the "externally-managed-environment" problem. I migrated from Debian 11 to 12. I'm developing some Python packages; applications and libraries. I never used virtual environments and wouldn't like to start with it.

Re: Using "textwrap" package for unwrappable languages (Japanese)

2023-08-30 Thread c.buhtz--- via Python-list
Dear Peter, thanks for your reply. That is a very interesting topic. I was a bit wrong. I realized that textwrap.wrap() do insert linebreaks when "words" are to long. So even a string without any blank space well get wrapped. Am 30.08.2023 14:07 schrieb Peter J. Holzer via Python-list: anot

Using "textwrap" package for unwrappable languages (Japanese)

2023-08-30 Thread c.buhtz--- via Python-list
Hi, I do use "textwrap" package to wrap longer texts passages. Works well with English. But the source string used is translated via gettext before it is wrapped. Using languages like Japanese or Chinese would IMHO result in unwrapped text. Japanese rules do allow to break a line nearly wher

Re: GNU gettext: Print string translated and untranslated at the same time

2023-08-17 Thread c.buhtz--- via Python-list
Hello Mirko, thanks for reply. Am 17.08.2023 18:19 schrieb Mirko via Python-list: You could solve it by defining _() locally like so: def foobar(translate): _ = gettext.gettext I see no way to do that. It is not the "class based API" of gettext installing _() into the builtins namespace

GNU gettext: Print string translated and untranslated at the same time

2023-08-17 Thread c.buhtz--- via Python-list
X-Post: https://stackoverflow.com/q/76913082/4865723 I want to display one string in its original source (untranslated) version and in its translated version site by site without duplicating the string in the python source code? It wouldn't be a big deal if it is only one word. print('The

subprocess equivalent for "os.execvp()"?

2023-01-08 Thread c.buhtz
Hello, is there an equivalent in the subprocess module for "os.execvp()" to replace the current process with the new called one? Kind Christian -- https://mail.python.org/mailman/listinfo/python-list

No solution for "--verbose" (on stdout) output in Pythonds standard library?

2023-01-04 Thread c.buhtz
Hello, first I have to say that in my current and fresh humble opinion the often seen "--verbose" switch in command line applications should affect only the messages given to the users. This means messages on "stdout". That is what this question is about. The logging module is not an option becau

What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread c.buhtz
Hello, this posting isn't about asking for a technical solution. My intention is to understand the design decision Python's core developers made in context of that topic. The logging module write everything to stderr no matter which logging level is used. The argparse module does it more differe

pip/setuptools: Entry points not visible from pkexec-root-environment

2022-12-18 Thread c.buhtz
Hello, when I install a package on a GNU/Linux system via "sudo python3 -m pip install -e ." that defines entry points in its pyproject.toml the entry point starter scripts are located in /usr/locale/bin. That folder is in PATH for "regular" root users and by "sudo su" roots users. But I need to

Debugging automatic quotation in subprocess.Popen()

2022-10-07 Thread c.buhtz
Hello, I need to improve my understanding about how subprocess.Popen() does quote arguments. I have special case here. Simple example: Popen(['ls', '-l']) results on a shell in "ls -l" without quotation. Quotes are added if they are needed: Popen(['ls', 'folder with blank']) results on a shell i

Which architectures to support in a CI like Travis?

2022-09-18 Thread c.buhtz
Hello, I am using TravisCI for my project on GitHub. The project is packaged for Debian, Ubuntu, Arch and several other distros. All this distros support multiple architectures and they have their own test machines to take care that all packages working on all archs. On my side (upstream) I wond

[py-usr] flake8 gives me a W605 but Python don't

2022-09-10 Thread c.buhtz
Hello, My `flake8` gives me a "W605 invalid escape sequence" [1] warning for this piece of example code. import re def foobar(): rex = re.compile('Version: \d+.\d+.\d+.*', re.MULTILINE) for match in rex.findall(' Version: 1.2.3 '): print(match)

Re: PEP about recommended project folder layout

2022-07-30 Thread c.buhtz
Isn't there a PEP? On 2022-07-26 07:14 c.bu...@posteo.jp wrote: > Hello, > > I am not sure if I looked into the correct sources. I was looking in > "PEP 609 – Python Packaging Authority (PyPA) Governance" [1] and the > "PyPA specifications" [2]. > > My question in short: Is there an official d

Re: Python: asyncio and Tkinter

2017-12-20 Thread c.buhtz
X-Post: Dear Chris. On 2017-12-21 00:42 Chris Angelico wrote: > I would recommend threading. You can run your GUI event loop on one > thread, and your network I/O loop on another thread. Thank you very much for your

Python: asyncio and Tkinter

2017-12-20 Thread c.buhtz
I am looking for an "elegant" and "official" way to use asyncio in Tkinter applications. The goal is that the GUI is not freezing while doing some download-tasks (over 100 files from different locations). I am looking around on the web for solutions but couldn't find one. Only some workarounds wit

carry **arguments through different scopes/functions

2016-01-31 Thread c.buhtz
I am not sure what the problem is here, so I don't really know how I should call the subject for that question. Please offer a better subject. The code below is a extrem simplified example of the original one. But it reproduce the problem very nice. Please focus on the variable `return_code`. The

Re: filter a list of strings

2015-12-03 Thread c.buhtz
Thank you for your suggestion. This will help a lot. On 2015-12-03 08:32 Jussi Piitulainen wrote: > list = [ item for item in list > if ( 'Banana' not in item and > 'Car' not in item ) ] I often saw constructions like this x for x in y if ... But I don't understand that

filter a list of strings

2015-12-02 Thread c.buhtz
I would like to know how this could be done more elegant/pythonic. I have a big list (over 10.000 items) with strings (each 100 to 300 chars long) and want to filter them. list = . for item in list[:]: if 'Banana' in item: list.remove(item) if 'Car' in item: list.remove(item)

Re: import logging raise NotImplementedError

2015-11-25 Thread c.buhtz
On 2015-11-25 19:51 Chris Angelico wrote: > Ah! That would do it, yes. (Incidentally, 'pip install ebscopy' would > be how I'd do it.) Yes, I did first. But I had some problems with 'ebscopy' so I wanted to be sure to get the freshes version of it available. ;) -- GnuPGP-Key ID 0751A8EC -- http

Re: import logging raise NotImplementedError

2015-11-25 Thread c.buhtz
On 2015-11-25 09:00 Chris Angelico wrote: > You appear to have installed it into your Python 3.4's package No really me. I found out who. I installed "ebscopy" from its GitHub repository with "sudo pip3 ./setup.py install" And this (tried to) install(ed) "logging" from PyPi. Don't know why. I j

import logging raise NotImplementedError

2015-11-24 Thread c.buhtz
I using 'logging' for some month. But today I have strange problem. When importing it it fails. 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 logging Traceback (most recent call last): File "

[argparse] optional parameter without --switch

2015-11-23 Thread c.buhtz
I want to call (on bash) a Python script in this two ways without any error. ./arg.py ./arg.py TEST It means that the parameter (here with the value `TEST`) should be optional. With argparse I only know a way to create optional paramters when they have a switch (like `--name`). Is there

PubMed / Entrez

2015-11-19 Thread c.buhtz
I am looking for a way to use the PubMed (medical research search engine) API (aka Entrez) with Python3. Does anyone know packages for that? -- GnuPGP-Key ID 0751A8EC -- https://mail.python.org/mailman/listinfo/python-list

doc-generation tool

2015-10-06 Thread c.buhtz
I am confused about to much possible tools and conventions for doc-strings and the doc-generating tools using it. My code isn't about a package interface. It is just a simple application I want I readable documentation for. I have the following needs - in-code doc-string should be readable for h

Re: Most Pythonic way to store (small) configuration

2015-08-04 Thread c.buhtz
Dear Cecil, I subscribed to late to answer to your top-post in that thread. I had the same topic for myself in the last months and tried a lot of things. In your situation I would prefere the INI-file format, too. But doen't user 'configparser' for that. As other fellows described it's a bad sol

Optimal solution for coloring logging output

2015-08-03 Thread c.buhtz
I don't want to ask how to do this because there are so many "solutions" about it. There are so much different and part of unpythontic solutions I can not decide myself. What do you (as real pythontics) think about t

Re: [setuptools] install data-file in users home-dir

2015-07-10 Thread c.buhtz
On 2015-07-10 09:39 Chris Warrick wrote: > And you should not create the files in your install script. Instead, > install them to a different data dir (somewhere in 'share/appname', or > alongside your package). When someone runs your app, only then you > should copy this file to user’s config di

Re: [setuptools] install data-file in users home-dir

2015-07-10 Thread c.buhtz
Hi Chris, thank you for your answer. On 2015-07-10 09:39 Chris Warrick wrote: > You should NEVER use sudo with pip. Instead, use virtualenvs as a > regular user, or create your own .deb packages. I am not sure, but maybe this is an Ubuntu-specific "problem"? When I don't use sudo I got error

[setuptools] install data-file in users home-dir

2015-07-10 Thread c.buhtz
I am using setuptools to create a wheel file. There is a conf-file I want to install into the users config-diretory. e.g. /home/user/.config/appname/app.conf setup(..., data_files = [ ('~/.config/appname/', ['app.conf']) ] ) I see two problems here: 1. I don't know the users "name".

Re: understanding why there is no setup.py uninstall

2015-07-07 Thread c.buhtz
On 2015-07-06 18:34 Ben Finney wrote: > Part of the better system is that we have the Python Packaging > Authority http://pypa.io/> which didn't exist when Distutils was > designed. Read the documents there and I hope you'll be glad at the > improvement! > ... Thank you very much for that explana

understanding why there is no setup.py uninstall

2015-07-06 Thread c.buhtz
This question is not technical. I know that there is no 'uninstall' Option in a setup.py. I know this discussions and workarounds for that problem, too. I want to understand the design concept behind it. Why isn't there no uni

build a deb-package

2015-06-04 Thread c.buhtz
I am not sure where I am or where to go. ;) So before asking about technical details I first want to know if it is generally possible. On Ubuntu when I install python-based applications (from a repository) as deb-packages I can start them by just typing its name because the py-file or a link to it