Extract the “Matrix form” dataset from BCS website.

2022-12-22 Thread hongy...@gmail.com
I want to extract / scrape the “Matrix form” dataset from the BCS website [1], a.k.a., the data appeared in the 3rd column. I tried with the following python code snippet, but still failed to figure out the trick: import requests from bs4 import BeautifulSoup import re proxies = { 'http':

Re: Obtain the query interface url of BCS server.

2022-09-14 Thread hongy...@gmail.com
On Wednesday, September 14, 2022 at 10:41:32 AM UTC+8, DFS wrote: > On 9/13/2022 7:29 PM, hongy...@gmail.com wrote: > > On Tuesday, September 13, 2022 at 9:33:20 PM UTC+8, DFS wrote: > >> On 9/13/2022 3:46 AM, hongy...@gmail.com wrote: > >>> On Tuesday, Septembe

Re: Obtain the query interface url of BCS server.

2022-09-13 Thread hongy...@gmail.com
On Tuesday, September 13, 2022 at 9:33:20 PM UTC+8, DFS wrote: > On 9/13/2022 3:46 AM, hongy...@gmail.com wrote: > > On Tuesday, September 13, 2022 at 4:20:12 AM UTC+8, DFS wrote: > >> On 9/12/2022 5:00 AM, hongy...@gmail.com wrote: > >>> I want to do the q

Re: Obtain the query interface url of BCS server.

2022-09-13 Thread hongy...@gmail.com
On Tuesday, September 13, 2022 at 4:20:12 AM UTC+8, DFS wrote: > On 9/12/2022 5:00 AM, hongy...@gmail.com wrote: > > I want to do the query from with in script based on the interface here [1]. > > For this purpose, the underlying posting URL must be obtained, say, the URL &g

Re: Extract the space group generators from Bilbao Crystallographic Server.

2022-07-15 Thread hongy...@gmail.com
tack and numpy.hstack with proper care with > multiple dimensions to specify what axis they will combine on. > > But doing the full (home)work for you is ... Thank you for your analysis and comments. Best, Zhao > -Original Message- > From: Python-list On > Behalf

Extract the space group generators from Bilbao Crystallographic Server.

2022-07-14 Thread hongy...@gmail.com
I'm trying to extract the matrix data of "ITA-Setting F d -3 m [origin 1]" listed here [1], and then building an augmented matrix for each of them by adding the last row as "[0, 0, 0, 1]". In short, the following form is the ultimate-desired result: [[[1, 0, 0, 0], [0, 1, 0, 0], [0, 0,1, 0],

Re: Convert the decimal numbers expressed in a `numpy.ndarray` into a matrix representing elements in fractional form

2022-05-22 Thread hongy...@gmail.com
On Thursday, May 19, 2022 at 5:26:25 AM UTC+8, Cousin Stanley wrote: > #!/usr/bin/env python3 > > ''' > NewsGroup comp.lang.python > > Subject .. Convert the decimal numbers > expressed in a numpy.ndarray > into a matrix representing elements > in fractiona > Date .

Re: Convert the decimal numbers expressed in a `numpy.ndarray` into a matrix representing elements in fractional form

2022-05-16 Thread hongy...@gmail.com
On Monday, May 16, 2022 at 11:27:58 PM UTC+8, Dennis Lee Bieber wrote: > On Mon, 16 May 2022 02:03:26 -0700 (PDT), "hongy...@gmail.com" > declaimed the following: > > > >print(lst) > > Printing higher level structures uses the repr() of the structure an

Re: Convert the decimal numbers expressed in a `numpy.ndarray` into a matrix representing elements in fractional form

2022-05-16 Thread hongy...@gmail.com
On Tuesday, May 17, 2022 at 7:11:24 AM UTC+8, hongy...@gmail.com wrote: > On Monday, May 16, 2022 at 11:27:58 PM UTC+8, Dennis Lee Bieber wrote: > > On Mon, 16 May 2022 02:03:26 -0700 (PDT), "hongy...@gmail.com" > > declaimed the following: > > > > >

Re: Convert the decimal numbers expressed in a `numpy.ndarray` into a matrix representing elements in fractional form

2022-05-16 Thread hongy...@gmail.com
On Monday, May 16, 2022 at 11:27:58 PM UTC+8, Dennis Lee Bieber wrote: > On Mon, 16 May 2022 02:03:26 -0700 (PDT), "hongy...@gmail.com" > declaimed the following: > > > >print(lst) > > Printing higher level structures uses the repr() of the structure an

Re: Convert the decimal numbers expressed in a `numpy.ndarray` into a matrix representing elements in fractional form

2022-05-16 Thread hongy...@gmail.com
On Tuesday, May 17, 2022 at 8:48:27 AM UTC+8, Dennis Lee Bieber wrote: > On Mon, 16 May 2022 17:22:17 -0700 (PDT), "hongy...@gmail.com" > declaimed the following: > > > > > >I tried with the repr() method as follows, but it doesn't give any output: > I hav

Re: ModuleNotFoundError: No module named 'DistUtilsExtra'

2022-01-02 Thread hongy...@gmail.com
On Monday, January 3, 2022 at 6:15:53 AM UTC+8, Marco Sulla wrote: > https://askubuntu.com/questions/584857/distutilsextra-problem I found its Git repository using the following method: $ for i in python-distutils-extra python3-distutils-extra; do apt showsrc $i |& grep git; done | sort -u

ModuleNotFoundError: No module named 'DistUtilsExtra'

2022-01-02 Thread hongy...@gmail.com
On Ubuntu 20.04.3 LTS, I try to install pdfarranger [1] as follows but failed: $ sudo apt-get install python3-pip python3-distutils-extra \ python3-wheel python3-gi python3-gi-cairo \ gir1.2-gtk-3.0 gir1.2-poppler-0.18

Re: builtins.TypeError: catching classes that do not inherit from BaseException is not allowed

2021-12-31 Thread hongy...@gmail.com
On Friday, December 31, 2021 at 4:18:28 PM UTC+8, Marco Sulla wrote: > It was already done: https://pypi.org/project/tail-recursive/ A few days ago, I also noticed another similar project: https://github.com/baruchel/tco It seems that they are very similar, even identical. But I'm not sure, so I

Re: builtins.TypeError: catching classes that do not inherit from BaseException is not allowed

2021-12-31 Thread hongy...@gmail.com
On Friday, December 31, 2021 at 7:17:18 PM UTC+8, hongy...@gmail.com wrote: > On Friday, December 31, 2021 at 4:18:28 PM UTC+8, Marco Sulla wrote: > > It was already done: https://pypi.org/project/tail-recursive/ > A few days ago, I also noticed another similar project: > htt

Re: builtins.TypeError: catching classes that do not inherit from BaseException is not allowed

2021-12-30 Thread hongy...@gmail.com
On Friday, December 31, 2021 at 7:50:48 AM UTC+8, MRAB wrote: > On 2021-12-30 23:27, hongy...@gmail.com wrote: > > On Friday, December 31, 2021 at 7:04:24 AM UTC+8, Chris Angelico wrote: > >> Neither of these wants to be recursive, and writing them recursively > >

Re: builtins.TypeError: catching classes that do not inherit from BaseException is not allowed

2021-12-30 Thread hongy...@gmail.com
On Friday, December 31, 2021 at 7:04:24 AM UTC+8, Chris Angelico wrote: > Neither of these wants to be recursive, and writing them recursively > pollutes the function signature with parameters that really exist just > to be local variables. Passing an accumulator down is a terrible way > to

Re: builtins.TypeError: catching classes that do not inherit from BaseException is not allowed

2021-12-30 Thread hongy...@gmail.com
On Thursday, December 30, 2021 at 11:23:35 PM UTC+8, Chris Angelico wrote: > If it's an exception, it needs to subclass Exception or BaseException. I see. That is, the following: class TailRecurseException(Exception): def __init__(self, args, kwargs): self.args = args self.kwargs =

Re: builtins.TypeError: catching classes that do not inherit from BaseException is not allowed

2021-12-30 Thread hongy...@gmail.com
On Thursday, December 30, 2021 at 11:24:20 PM UTC+8, Chris Angelico wrote: > On Fri, Dec 31, 2021 at 2:03 AM hongy...@gmail.com > wrote: > > See here [1] for the related discussion. > > > > [1] > > https://discuss.python.org/t/typeerror-catching-classes-that-do-

Re: builtins.TypeError: catching classes that do not inherit from BaseException is not allowed

2021-12-30 Thread hongy...@gmail.com
On Thursday, December 30, 2021 at 9:04:36 PM UTC+8, hongy...@gmail.com wrote: > I try to compute the factorial of a large number with tail-recursion > optimization decorator in Python3. The following code snippet is converted > from the code snippet given here [1] by the follow

builtins.TypeError: catching classes that do not inherit from BaseException is not allowed

2021-12-30 Thread hongy...@gmail.com
I try to compute the factorial of a large number with tail-recursion optimization decorator in Python3. The following code snippet is converted from the code snippet given here [1] by the following steps: $ pyenv shell datasci $ python --version Python 3.9.1 $ pip install 2to3 $ 2to3 -w

Re: Get a function definition/implementation hint similar to the one shown in pycharm.

2021-10-19 Thread hongy...@gmail.com
On Tuesday, October 19, 2021 at 5:22:25 AM UTC+8, cameron...@gmail.com wrote: > On 18Oct2021 01:43, Hongyi Zhao wrote: > >I've written the following python code snippet in pycharm: > >```python > >import numpy as np > >from numpy import pi, sin > > > >a = np.array([1], dtype=bool) > >if

Re: Get a function definition/implementation hint similar to the one shown in pycharm.

2021-10-18 Thread hongy...@gmail.com
On Tuesday, October 19, 2021 at 5:22:25 AM UTC+8, cameron...@gmail.com wrote: > On 18Oct2021 01:43, Hongyi Zhao wrote: > >I've written the following python code snippet in pycharm: > >```python > >import numpy as np > >from numpy import pi, sin > > > >a = np.array([1], dtype=bool) > >if

Get a function definition/implementation hint similar to the one shown in pycharm.

2021-10-18 Thread hongy...@gmail.com
I've written the following python code snippet in pycharm: ```python import numpy as np from numpy import pi, sin a = np.array([1], dtype=bool) if np.in|vert(a) == ~a: print('ok') ``` When putting the point/cursor in the above code snippet at the position denoted by `|`, I would like to see

Re: Understanding the working mechanis of python unary arithmetic operators.

2021-10-05 Thread hongy...@gmail.com
On Sunday, October 3, 2021 at 9:55:15 PM UTC+8, hongy...@gmail.com wrote: > On Sunday, October 3, 2021 at 8:38:16 PM UTC+8, ju...@diegidio.name wrote: > > On Sunday, 3 October 2021 at 14:21:13 UTC+2, hongy...@gmail.com wrote: > > > On Sunday, October 3, 2021 at 6:

Re: Understanding the working mechanis of python unary arithmetic operators.

2021-10-05 Thread hongy...@gmail.com
On Sunday, October 3, 2021 at 8:38:16 PM UTC+8, ju...@diegidio.name wrote: > On Sunday, 3 October 2021 at 14:21:13 UTC+2, hongy...@gmail.com wrote: > > On Sunday, October 3, 2021 at 6:31:05 PM UTC+8, ju...@diegidio.name wrote: > > > > Then you can guess that numpy overr

Re: Understanding the working mechanis of python unary arithmetic operators.

2021-10-05 Thread hongy...@gmail.com
On Sunday, October 3, 2021 at 6:31:05 PM UTC+8, ju...@diegidio.name wrote: > On Sunday, 3 October 2021 at 11:24:58 UTC+2, hongy...@gmail.com wrote: > > On Sunday, October 3, 2021 at 2:18:17 PM UTC+8, hongy...@gmail.com wrote: > > > On Saturday, October 2, 2021 at 4:

Re: Understanding the working mechanis of python unary arithmetic operators.

2021-10-05 Thread hongy...@gmail.com
On Saturday, October 2, 2021 at 4:59:54 PM UTC+8, ju...@diegidio.name wrote: > On Saturday, 2 October 2021 at 10:34:27 UTC+2, hongy...@gmail.com wrote: > > See the following testings: > > > > In [24]: a=3.1415926535897932384626433832795028841971 > > In [27]: -a >

Re: Understanding the working mechanis of python unary arithmetic operators.

2021-10-05 Thread hongy...@gmail.com
On Sunday, October 3, 2021 at 2:18:17 PM UTC+8, hongy...@gmail.com wrote: > On Saturday, October 2, 2021 at 4:59:54 PM UTC+8, ju...@diegidio.name wrote: > > On Saturday, 2 October 2021 at 10:34:27 UTC+2, hongy...@gmail.com wrote: > > > See the following testings: &

Re: Understanding the working mechanis of python unary arithmetic operators.

2021-10-05 Thread hongy...@gmail.com
On Sunday, October 3, 2021 at 3:05:23 AM UTC+8, ju...@diegidio.name wrote: > On Saturday, 2 October 2021 at 14:48:39 UTC+2, hongy...@gmail.com wrote: > > On Saturday, October 2, 2021 at 4:59:54 PM UTC+8, ju...@diegidio.name > > wrote: > > > On Saturday, 2 October 2021

Re: Understanding the working mechanis of python unary arithmetic operators.

2021-10-02 Thread hongy...@gmail.com
On Saturday, October 2, 2021 at 4:59:54 PM UTC+8, ju...@diegidio.name wrote: > On Saturday, 2 October 2021 at 10:34:27 UTC+2, hongy...@gmail.com wrote: > > See the following testings: > > > > In [24]: a=3.1415926535897932384626433832795028841971 > > In [27]: -a >

Understanding the working mechanis of python unary arithmetic operators.

2021-10-02 Thread hongy...@gmail.com
See the following testings: In [24]: a=3.1415926535897932384626433832795028841971 In [27]: -a Out[27]: -3.141592653589793 In [28]: +a Out[28]: 3.141592653589793 In [17]: ~-+1 Out[17]: 0 In [18]: -~+1 Out[18]: 2 In [19]: -+~1 Out[19]: 2 In [20]: +~-1 Out[20]: 0 I'm very puzzled by these

Re: XLRDError: Unsupported format, or corrupt file: Expected BOF record; found b'\r\n\r\n\r\n\r\n'

2021-09-30 Thread hongy...@gmail.com
On Thursday, September 30, 2021 at 9:20:37 AM UTC+8, hongy...@gmail.com wrote: > On Thursday, September 30, 2021 at 5:20:04 AM UTC+8, Peter J. Holzer wrote: > > On 2021-09-29 01:22:03 -0700, hongy...@gmail.com wrote: > > > I tried to convert a xls file into csv with the

Re: XLRDError: Unsupported format, or corrupt file: Expected BOF record; found b'\r\n\r\n\r\n\r\n'

2021-09-29 Thread hongy...@gmail.com
On Thursday, September 30, 2021 at 5:20:04 AM UTC+8, Peter J. Holzer wrote: > On 2021-09-29 01:22:03 -0700, hongy...@gmail.com wrote: > > I tried to convert a xls file into csv with the following command, but > > failed: > > > > $ in2csv --sheet 'Sheet1' 202

Re: XLRDError: Unsupported format, or corrupt file: Expected BOF record; found b'\r\n\r\n\r\n\r\n'

2021-09-29 Thread hongy...@gmail.com
On Wednesday, September 29, 2021 at 8:12:08 PM UTC+8, J.O. Aho wrote: > On 29/09/2021 13.10, hongy...@gmail.com wrote: > > On Wednesday, September 29, 2021 at 5:40:58 PM UTC+8, J.O. Aho wrote: > >> On 29/09/2021 10.22, hongy...@gmail.com wrote: > >>> I tried

Re: XLRDError: Unsupported format, or corrupt file: Expected BOF record; found b'\r\n\r\n\r\n\r\n'

2021-09-29 Thread hongy...@gmail.com
On Wednesday, September 29, 2021 at 5:40:58 PM UTC+8, J.O. Aho wrote: > On 29/09/2021 10.22, hongy...@gmail.com wrote: > > I tried to convert a xls file into csv with the following command, but > > failed: > > > > $ in2csv --sheet 'Sheet1' 2021-2022-1.xls > &

XLRDError: Unsupported format, or corrupt file: Expected BOF record; found b'\r\n\r\n\r\n\r\n'

2021-09-29 Thread hongy...@gmail.com
I tried to convert a xls file into csv with the following command, but failed: $ in2csv --sheet 'Sheet1' 2021-2022-1.xls XLRDError: Unsupported format, or corrupt file: Expected BOF record; found b'\r\n\r\n\r\n\r\n' The above testing file is located at here [1]. [1]

Re: Change the display style of the text on the STACKLINE.

2021-09-10 Thread hongy...@gmail.com
On Saturday, September 11, 2021 at 7:43:44 AM UTC+8, hongy...@gmail.com wrote: > On Friday, September 10, 2021 at 2:12:31 PM UTC+8, Roland Mueller wrote: > > pe 10. syysk. 2021 klo 8.53 hongy...@gmail.com (hongy...@gmail.com) > > kirjoitti: > > > On Thursday, September 9

Re: Change the display style of the text on the STACKLINE.

2021-09-10 Thread hongy...@gmail.com
On Friday, September 10, 2021 at 2:12:31 PM UTC+8, Roland Mueller wrote: > pe 10. syysk. 2021 klo 8.53 hongy...@gmail.com (hongy...@gmail.com) > kirjoitti: > > On Thursday, September 9, 2021 at 8:57:37 PM UTC+8, Roland Mueller wrote: > > > Hello > > > > >

Re: Change the display style of the text on the STACKLINE.

2021-09-09 Thread hongy...@gmail.com
On Thursday, September 9, 2021 at 8:57:37 PM UTC+8, Roland Mueller wrote: > Hello > > to 9. syysk. 2021 klo 6.53 hongy...@gmail.com (hongy...@gmail.com) > kirjoitti: > > I'm using the following code in my forked project [1]: > > > > percol.view.STACKLINE = '

Change the display style of the text on the STACKLINE.

2021-09-08 Thread hongy...@gmail.com
I'm using the following code in my forked project [1]: percol.view.STACKLINE = 'Fold:F1,F2,F3 Push:C-p Pop:M-p Script:M-s Dir:M-d Dircmd:M-b' I would like to change the display style of the text mentioned above, for example, to underline some characters in it, as shown below: _D_ir:M-d How

Re: combine multiple xlsx files which include dropdown columns in them.

2021-09-08 Thread hongy...@gmail.com
On Thursday, September 9, 2021 at 9:15:23 AM UTC+8, Kushal Kumaran wrote: > On Tue, Sep 07 2021 at 10:05:58 PM, "hongy...@gmail.com" > wrote: > > I've some xlsx files which include dropdown columns in them. I want to > > know whether I can combine all the lines i

combine multiple xlsx files which include dropdown columns in them.

2021-09-08 Thread hongy...@gmail.com
I've some xlsx files which include dropdown columns in them. I want to know whether I can combine all the lines into one xlsx file. Any hints for doing this job with python programmatically will be highly appreciated. Regards, HY -- https://mail.python.org/mailman/listinfo/python-list

Re-design the position of the RPROMPT string.

2021-09-06 Thread hongy...@gmail.com
I forked and made some improvements to the ariadne package [1]. I noticed that the current RPROMPT line is composed by percol.view.PROMPT [2] and percol.view.__class__.RPROMPT [3], as shown below: X10DAi-00 (M-h/M-n)> M-m:string Path:C-d Local:C-l Unique:M-r Exit0:M-t Fold:F1,F2,F3

Re: Mutually exclusive options with argparse.

2021-09-02 Thread hongy...@gmail.com
On Thursday, September 2, 2021 at 10:16:09 AM UTC+8, hongy...@gmail.com wrote: > On Wednesday, September 1, 2021 at 11:20:21 PM UTC+8, Lee Congdon wrote: > > Does a mutually exclusive group, as described in "Mutual exclusion" at > > https://docs.python.org/3/library/argp

Re: Mutually exclusive options with argparse.

2021-09-02 Thread hongy...@gmail.com
ry. > > On Wed, Sep 1, 2021 at 9:48 AM hongy...@gmail.com > wrote: > > See the following code snippets [1] for implementation of the exclusive > > options with argparse: > > > > def query_builder(args): > > if args.r and args.s: > >

Mutually exclusive options with argparse.

2021-09-01 Thread hongy...@gmail.com
See the following code snippets [1] for implementation of the exclusive options with argparse: def query_builder(args): if args.r and args.s: sys.exit(Term.FAIL + 'Only one of -re and -sql should be set' + Term.ENDC) sum_status = sum(1 for x in [args.failure, args.code != -1] if

Re: Create a real-time interactive TUI using Python.

2021-08-31 Thread hongy...@gmail.com
On Wednesday, September 1, 2021 at 12:49:51 AM UTC+8, Chris Angelico wrote: > On Wed, Sep 1, 2021 at 1:59 AM hongy...@gmail.com wrote: > > > > I want to know whether python can be used to create real-time interactive > > TUI, as hstr [1] does. > > > > [

Create a real-time interactive TUI using Python.

2021-08-31 Thread hongy...@gmail.com
I want to know whether python can be used to create real-time interactive TUI, as hstr [1] does. [1] https://github.com/dvorka/hstr Regards, HY -- https://mail.python.org/mailman/listinfo/python-list

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread hongy...@gmail.com
On Tuesday, August 31, 2021 at 7:55:51 AM UTC+8, Dennis Lee Bieber wrote: > On Sun, 29 Aug 2021 19:49:19 -0700 (PDT), "hongy...@gmail.com" > declaimed the following: > >On Ubuntu 20.04.2 LTS, I use the > >[recent2](https://github.com/dotslash/recent2/blob/master/rece

The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-30 Thread hongy...@gmail.com
On Ubuntu 20.04.2 LTS, I use the [recent2](https://github.com/dotslash/recent2/blob/master/recent2.py) to log and query my bash history, which uses a sqlite3 database to store the history information. The `datetime` of running a command is inserted in the sqlite3 database with [a `unixepoch`

Re: Generate a Google Translate API token through the Socks5 proxy using gtoken.py

2021-07-28 Thread hongy...@gmail.com
On Wednesday, July 28, 2021 at 3:05:11 PM UTC+8, Peter Otten wrote: > On 28/07/2021 07:32, Cameron Simpson wrote: > > On 27Jul2021 19:24, Hongyi Zhao wrote: > >> On Wednesday, July 28, 2021 at 7:25:27 AM UTC+8, cameron...@gmail.com > >> wrote: > >>> Just to follow on a bit to Dennis: > >> >

Re: Generate a Google Translate API token through the Socks5 proxy using gtoken.py

2021-07-27 Thread hongy...@gmail.com
On Wednesday, July 28, 2021 at 7:25:27 AM UTC+8, cameron...@gmail.com wrote: > Just to follow on a bit to Dennis: But I can't any reply from Dennis in this issue. > C:\Users\Wulfraed\Documents\_Hg-Repositories\Python Progs>python > googletrans_test.py > Traceback (most recent call last): >

Generate a Google Translate API token through the Socks5 proxy using gtoken.py

2021-07-27 Thread hongy...@gmail.com
I want to use [gtoken.py](https://github.com/ssut/py-googletrans/blob/master/googletrans/gtoken.py) through a socks5 proxy. Based on the comment [here](https://github.com/encode/httpx/issues/203#issuecomment-611914974) and the example usage in