Re: Video file to subtitles file

2020-08-28 Thread Barry
> On 28 Aug 2020, at 17:37, Muskan Sanghai wrote: > > On Friday, August 28, 2020 at 12:27:25 AM UTC+5:30, Barry Scott wrote: >>>> On 27 Aug 2020, at 18:00, Muskan Sanghai wrote: >>> >>> I would be really thankful if someone can suggest me how can I g

Re: Threading plus multiprocessing plus cv2 error

2020-08-30 Thread Barry
ddress space of the parent is replicated in the child, including the states of mutexes, condition variables, and other pthreads objects; the use of pthread_atfork(3) may be helpful for dealing with problems that this can cause.” Barry > > Unless t

Re: stackless python 2.7.9 and openssl-1.1.1g

2020-09-25 Thread Barry
>> On 25 Sep 2020, at 03:28, bhashkar prakash Singh >> wrote: >  > Hi Barry, > > Thanks for your response. > > I am not an expert in python code. Could you please elaborate a bit more on > this. Which cpython code are you referring to? > did yo

Re: Python extension module with callbacks into Python

2020-10-28 Thread Barry
.sourceforge.net/PyCXX-Python3.html and the PythonAllowThreads PythonDisallowThreads classes that to the hard workin a type safe way. Barry > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Error

2020-11-24 Thread Barry
Two observations. Python.exe is not on your PATH. But that does not matter as you can use the py command instead And nymph may not be available for python 3.9 yet. Check on pypi to see if there is a build for 3.9. Maybe use 3.8 for the time being. Barry > On 24 Nov 2020, at 11:18, May

Re: problem in installation of python 3.9.0

2020-12-02 Thread Barry
mmon question and answer. > > Perhaps the installer could be named better, or Python could provide a > shortcut for itself? You mean like including the word setup or installer in the file name? That’s what everybody else does isn’t it? Barry > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: Regarding Regex timeout behavior to minimize CPU consumption

2020-12-06 Thread Barry
that is not going to happen. Killing threads is not safe and if your OS allows it then you end up with the internal state of python messed up. To implement this I think requires the re code to implement the timeout. Better is for the OP to fix the re to

Re: Lambda in parameters

2020-12-18 Thread Barry
register and cdr is content of data register. Apparently an artefact of a early implementation of lisp. Barry > # --- > > Kind Regards, > > > Abdur-Rahmaan Janhangeer > > https://www.github.com/Abdur-RahmaanJ > > Mauritius > > sent from gmail client o

Re: Learning why module will not load

2020-12-29 Thread Barry
med 'python3_six' > > How do I diagnose why neither module is found? I do this to to debug odd import issues: $ python3.9 -v ... >>> import six The output will show the attempts python makes to find the six module. Barry > > TIA, > > Rich > > > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

bsddb environment lock failure

2005-07-09 Thread Barry
up the build. I much appreciate any insight in how to fix this. Barry Here are some details: When trying to open (or create) a db, I get this error File "/opt/Python-2.4.1/Lib/bsddb/__init__.py", line 285, in hashopen e = _openDBEnv() File "/opt/Python-2.4.1/Lib/bs

Re: bsddb environment lock failure -- resolved

2005-07-10 Thread Barry
Upgrading db4 to db4-4.1.25-14.rpm seems to have take care of this. On 7/10/05, Barry <[EMAIL PROTECTED]> wrote: > I have python2.4.1 installed on two machines: > -- one is Fedora core 1, where the bsddb module works fine > -- one is Redhat ES 3.0, and I installed mysql 4

[no subject]

2005-08-09 Thread barry
The original message was received at Wed, 10 Aug 2005 09:14:22 +0300 from python.org [82.194.226.158] - The following addresses had permanent fatal errors - - Transcript of session follows - ... while talking to python.org.: >>> DATA <<< 400-aturner; -RMS-E-CRE, ACP file create

Re: Regular Expression problem

2006-07-16 Thread Barry
On 13 Jul 2006 23:12:05 -0700, Paul McGuire <[EMAIL PROTECTED]> wrote: Pyparsing is also good for recognizing basic HTML tags and theirattributes, regardless of the order of the attributes.-- PaultestText = """sldkjflsa;fajhere it would be 'mystylesheet.css'. I used the following regex to getthis v

Re: problem with regex

2006-07-28 Thread Barry
On 28 Jul 2006 05:45:05 -0700, abcd <[EMAIL PROTECTED]> wrote: > I have a regex: '[A-Za-z]:\\([^/:\*\?"<>\|])*' > > when I do, re.compile('[A-Za-z]:\\([^/:\*\?"<>\|])*') ...I get > > sre_constants.error: unbalanced parenthesis > > do i need to escape something else? i see that i have matching > pa

Re: summarize text

2006-05-29 Thread Barry
On 29 May 2006 07:52:33 -0700, gene tani <[EMAIL PROTECTED]> wrote: robin wrote:> hello list,>> does anyone know of a library which permits to summarise text? i've> been looking at nltk but haven't found anything yet. any help would beunclear what you're asking, maybe look at: http://www.cs.waikato

Logging output from python

2006-12-07 Thread Barry
Hi, guys Basiclly, it is automated testing system. There is a main python script that handles the testing campagin. This main script will call another script that will in turn runs a few hundered individual python scripts. Here is my problem. I want to log everything displayed in the screen afte

Problem with cPickle and cElementTree

2008-10-09 Thread Barry
, which is not helpful. Doing exactly the same thing with ElementTree works fine. It appears that the objects returned by cElementTree do not pickle correctly. Is this a know issue? I was unable to find any reports of this problem. Any info would be appreciated! Barry -- http://mail.python.org

UnicodeDecodeError having fetch web page

2010-05-25 Thread Barry
Hi, The code below is giving me the error: Traceback (most recent call last): File "C:\Users\Administratör\Desktop\test.py", line 4, in UnicodeDecodeError: 'utf8' codec can't decode byte 0x8b in position 1: unexpected code byte What am i doing wrong?

Re: UnicodeDecodeError having fetch web page

2010-05-25 Thread Barry
On 25 Maj, 21:39, Philip Semanchuk wrote: > On May 25, 2010, at 3:13 PM, Barry wrote: > > > > > Hi, > > > The code below is giving me the error: > > > Traceback (most recent call last): > >  File "C:\Users\Administratör\Desktop\test.py", li

Fetching a gzipped webpage

2010-05-26 Thread Barry
gzipper.read() print(data) However it gives the error: Traceback (most recent call last): File "test.py", line 9, in TypeError: initial_value must be str or None, not bytes How should I be doing this for Python 3? Thanks Barry -- http://mail.python.org/mailman/listinfo/python-list

urllib2, https and gzipped files

2009-09-19 Thread Barry
the difference is that they are http connections, not https. Any ideas? Barry -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP Idea: Extended import syntax for aliasing module attributes

2025-06-17 Thread Barry
On 17 Jun 2025, at 15:17, Neal Becker wrote: On Tue, Jun 17, 2025 at 8:19 AM Barry Scott <[1][email protected]> wrote: > On 17 Jun 2025, at 00:19, Omar Ahmed via Python-list <[2][email protected]> wrote: > > Hi all, > I

Re: Linux shell to python

2012-07-30 Thread Barry Scott
. Barry On 30 Jul 2012, at 17:55, Paul van der Linden wrote: > You can do this with one subprocess.Popen and some python commands. > The alternative is to pipe some subprocess.Popen commands together. > Or for the quick way out (but I think you better stick with bash scripting >

Re: Linux shell to python

2012-07-31 Thread Barry Scott
On 30 Jul 2012, at 23:56, Dan Stromberg wrote: > > On Mon, Jul 30, 2012 at 9:26 PM, Barry Scott wrote: > lspci gets all its information from the files in /sys/bus/pci/devices. > > You can use os.listdir() to list all the files in the folder and then open > the files y

Re: Python does not take up available physical memory

2012-10-22 Thread Barry Scott
memory for other languages like for > instance Ruby? > Python 3.3 has changes to make string storage more efficient. See the whats new page. http://docs.python.org/py3k/whatsnew/3.3.html "more compact unicode strings". Barry -- http://mail.python.org/mailman/listinfo/python-list

python\bluetooth / wsgi / apache 2.2

2012-12-13 Thread Barry Dick
I'm wanting to read from my bluetooth device (it just sends data/header with a checksum at the end, in a continuous mode "a biofeedback device") and I'm getting a weird error in my logs not allowing me to use multiple sockets. I guess with wsgi, I'm creating a link/module between the two apis (a

Python parsing Bluetooth RFCOMM for 9 bytes

2012-12-13 Thread Barry Dick
My data looks like this when it comes from the device (biofeedback device). There are 9 bytes in total, and I need to buffer so much, and then poll it for new/recent packets. The start packet unfortunately starts with 0x00 So far the only thing I've found that looks like what I want to do is thi

Re: Python parsing Bluetooth RFCOMM for 9 bytes

2012-12-13 Thread Barry Dick
> Is the following more like how you want it? > > > > data = "" > > try: > > while True: > > try: > > more = client_socket.recv(9) > > except bluetooth.BluetoothError, b: > > print "Bluetooth Error: ", b > > else: > >

Re: Missing something obvious with python-requests

2013-01-03 Thread Barry Scott
The shipped python library code does not work. See http://bugs.python.org/issue7291 for patches. Barry On 3 Jan 2013, at 18:53, Ray Cote wrote: > Hello List: > > I seem to be missing something obvious in terms of using proxies with the > requests module. > I'm using req

Re: Using mktime to convert date to seconds since epoch - omitting elements from the tuple?

2013-01-03 Thread Barry Scott
vn Client Example? Its a rather over the top date and time parser I wrote a long long time ago. (Which is missing some imports, hmm I cannot have tested this for a long time). It can parse things like "yesterday 10:34". Barry -- http://mail.python.org/mailman/listinfo/python-list

Re: Forcing Python to detect DocumentRoot

2013-01-19 Thread Barry Scott
by forcing Python to detect > DocumentRoot by itself? In the general case it is not possible. There is no single convention you can use to detect the top of a web site. If you always use apache httpd then read the value of DocumentRoot from httpd.conf Barry -- http://mail.python.org/mailman/listinfo/python-list

Re: python: HTTP connections through a proxy server requiring authentication

2013-01-28 Thread Barry Scott
The shipped python library code does not work. See http://bugs.python.org/issue7291 for patches. Barry -- http://mail.python.org/mailman/listinfo/python-list

Python 3 porting

2012-04-25 Thread Barry Warsaw
ing, and can help you find packages that need resources in getting to Python 3. At the Ubuntu Developer Summit in Oakland, California, May 7-11, 2012, we'll also be holding some sessions on Python 3, so if you're in the area, please come by. http://uds.ubuntu.com/ Cheers, -Barry sign

Re: How to call and execute C code in Python?

2012-05-16 Thread Barry Scott
There are many choices rather then raw python C API calls. Boost, PyCXX and ctypes are worth investigating. PyCXX requires you code in C++ but hides lots of the issues of using the Python API from you. It also supports python 2 and 3. Barry - PyCXX maintainer -- http://mail.python.org

Re: How to import Webkit and object in Official Python (not MacPorts python) without X11.

2012-05-26 Thread Barry Scott
an/listinfo/python-list The PyWebKit binding are not maintained and have problems. You will find yourself getting very frustrated trying to get anything but the trivia working. We ended up writing C++ code to use WebKit on Linux rather then our preferred Python. Barry -- http://mail.python.or

Released: Python 2.6.7

2011-06-03 Thread Barry Warsaw
2.6.7/NEWS.txt Many thanks go out to the entire Python community for their contributions and help in making Python 2.6.7 available. Enjoy, -Barry (on behalf of the Python development community) signature.asc Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Python 2.6.7 release candidate 2 now available

2011-05-20 Thread Barry Warsaw
n.org/download/releases/2.6.7/NEWS.txt Many thanks go out to the entire Python community for their contributions great and small. Enjoy, -Barry (on behalf of the Python development community) signature.asc Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

New [email protected] mailing list

2017-09-21 Thread Barry Warsaw
will use this low traffic, high value forum as the primary way the PSRT will communicate security issues of high importance back to the wider Python community. All follow-ups to postings to this list are redirected to the security-sig mailing list. Cheers, -Barry (on behalf of the PSRT

PEP Post-History

2017-10-27 Thread Barry Warsaw
and/or python-dev. In the effort to keep the forums of record to a manageable number, python-list is dropped. If you have been watching for new PEPs to be posted to python-list, you are invited to follow either python-dev or python-ideas. Cheers, -Barry (on behalf of the Python development

Welcome the 3.8 and 3.9 Release Manager - Łukasz Langa!

2018-01-27 Thread Barry Warsaw
that Python’s best days are ahead of us. Enjoy, -Barry [1] https://groups.google.com/forum/?hl=en#!original/comp.lang.misc/_QUzdEGFwCo/KIFdu0-Dv7sJ signature.asc Description: Message signed with OpenPGP -- https://mail.python.org/mailman/listinfo/python-list

Re: tail

2022-05-08 Thread Barry Scott
now its the posix API that C Python uses and it does not suffer from issues with binary files. Barry > > |Setting the file position indicator to end-of-file, as with > |fseek(file, 0, SEEK_END), has undefined behavior for a binary > |stream (because of possible trailing null characte

Re: tail

2022-05-08 Thread Barry Scott
de as Latin-1" dance. Sure, it's not > perfectly ideal, but it's about as good as you'll get with a lot of > US-based servers. (Depending on context, you might use CP-1252 instead > of Latin-1, but you might need errors="replace" there, since > Windows-

Re: tail

2022-05-08 Thread Barry Scott
untested). > > Furthermore, a newline parameter can be specified, as in open(). If it's > equal to the empty string, the things are a little more complicated, anyway > I suppose the code is clear. It's untested too. I only tested with an utf8 > linux file. > > Do you

Re: How to test characters of a string

2022-06-08 Thread Barry Scott
('abc', 'adc'))) --- +++ @@ -1,3 +1,3 @@ a -b +d c :>>> The docs talk about lines, but difflib works on sequence. I use it a lot to find differences within lines. Barry > > All the Bes

Re: How to replace characters in a string?

2022-06-08 Thread Barry Scott
e is something to fix? All modern OS allow unicode filenames. Barry > > If find others I’ll add them. > > I’m using MusicBrainz to do a fuzzy match and get the correct name. > > it’s not perfect, but works for 99% of files which is good enough for me! > > Cheers > D

Re: Logging into single file from multiple modules in python when TimedRotatingFileHandler is used

2022-06-22 Thread Barry Scott
ell the process the log file needs reopening. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Subtract n months from datetime [Why?]

2022-06-22 Thread Barry Scott
28. The advantage of 30 days, 90 days etc is that a contract or law does not need to tell you how to deal with the problems of calendar months. As you say in peoples thoughts that 1 month or 3 months etc. But an accounts department will know how to to the number of days till they have to pay up.

Re: Building on Windows

2022-07-02 Thread Barry Scott
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" I use that to get at the command line tools. If that does not work then search the disk for msbuild.exe and add its folder to your PATH. Barry > 6. Re-run `PCbuild\build.bat -d -e` and see the s

Re: Python 3.9 pidfd_open

2022-07-08 Thread Barry Scott
to proved this to python. This is what I see with Fedora 36: $ python3.9 Python 3.9.13 (main, Jun 9 2022, 00:00:00) [GCC 12.1.1 20220507 (Red Hat 12.1.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. :>>&g

Re: Simple TCP proxy

2022-07-30 Thread Barry Scott
Set the backlog to 1,000,000 does that fix your issue? You will need on Linux to change kernel limits to allow that size. See man listen for info on what you need to change. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: why I cannot to install packages?

2022-09-15 Thread Barry Scott
> On 15 Sep 2022, at 12:31, ⁨נתי שטרן⁩ <⁨[email protected]⁩> wrote: > > [image: image.png] Images are stripped; please copy the text of the error you are seeing and post that. Barry > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.pyt

Re: Python 3.9.14

2022-09-15 Thread Barry Scott
installers are no longer provided for it. Python > 3.9.13 was the last full bugfix release of Python 3.9 with binary > installers. > > > Is there a safe way to install a 64-bit version of Python 3.9.14 on Windows? What is stopping you using 3.10? If 3.9 is important then I

Re: Changing 'Scripts/*.exe'

2022-10-03 Thread Barry Scott
uld have backed up the files, uninstall and reinstall then put back from backup any files that are not installable anymore. Why did you move the files from where they where installed and working? Barry > > -- > --gv > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: Ref-strings in logging messages (was: Performance issue with CPython 3.10 + Cython)

2022-10-24 Thread Barry Scott
""" msg = str(self.msg) if self.args: msg = msg % self.args return msg ``` Barry > > > From: Python-list <mailto:[email protected]>> on behalf of > Barry mailto:[email protected]>&g

Re: Any PyQt developers here?

2022-10-25 Thread Barry Scott
There is an active PyQt mailing list that has lots of helpful and knowledgeable people on it. https://www.riverbankcomputing.com/mailman/listinfo/pyqt Barry > On 25 Oct 2022, at 18:03, DFS wrote: > > Having problems with removeRow() on a QTableView object. > > After ca

Re: UTF-8 and latin1

2022-10-25 Thread Barry Scott
t; and decode them > accordingly. However, today I found that here it does > accept bytes but it always guesses "ISO 8859-1". The best you can do is assume that if the text cannot decode as utf-8 it may be 8859-1. Barry > > main.py > > import tkinter > >

Re: Information about slow execution notebook

2022-11-01 Thread Barry Scott
Reminder do not attach screen shots, they are striped in this mailing list. Cut-n-paste full error message information. Barry > -- > https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list

Re: How to manage python shebang on mixed systems?

2022-11-07 Thread Barry Scott
in posix that way. The only reason that things are in /bin are for systems that need a subset of programs to boot the system to point it can mount /usr. env is not going to be needed for that use case. > > Wouldn't '#! env python3' be better? Barry > > -- > Chris Green > · > -- > https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.11.0 installation and Tkinter does not work

2022-11-23 Thread Barry Scott
ch directory it should be. I think the depends.exe tool from sysintenals will do this as well. There is a mode where you run a program and it collects the data for all the DLLs that are used either statically linked or dynamicall loaded, that is the case for _tkinter. I have not used in in a very

Re: NEO6 GPS with Py PICO with micropython

2022-11-30 Thread Barry Scott
I would do then is read the code that raised the "GPS data not found" error and find out why it reports that error. Barry p.s. Please reply in line, do not top post. > > Krishane > > On Wed, Nov 30, 2022 at 3:58 AM rbowman wrote: > >> On Tue, 29 Nov 2022 17:23:3

Re: Does one have to use curses to read single characters from keyboard?

2022-12-11 Thread Barry Scott
pected end of data You would need to have a loop that collected all the utf-8 bytes of a single code point. You can to look at the first byte of know if the utf-8 is 1, 2, 3 or 4 bytes for a code point. Barry >termios.tcsetattr(fdInput, termios.TCSAFLUSH, termAttr) >s

Re: Possible re bug

2022-12-29 Thread Barry Scott
Please please fix you email client so that your replies stay with the emails you are replying to. Barry On 28/12/2022 19:09, Stefan Ram wrote: Alexander Richert writes: |print(re.findall(".*","pattern")) |yields ['pattern',''] which is not what I wa

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

2023-01-04 Thread Barry Scott
On 04/01/2023 02:26, Chris Angelico wrote: Reading/writing the FD is the same as using stdout (technically you'd write to fd 1 and read from fd 0), but yes, can use /dev/tty to reach for the console directly. I think the logic is more like checking that stdin is a tty then using the tty it to

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

2023-01-04 Thread Barry Scott
sh() if any characters are pending for output." Barry -- https://mail.python.org/mailman/listinfo/python-list

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

2023-01-04 Thread Barry Scott
logging module is a generally useful default, but its only a default. You are free to setup logging to meet your needs. Barry -- https://mail.python.org/mailman/listinfo/python-list

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

2023-01-04 Thread Barry Scott
: write an app that prints the contents of a file. The application output is the contents of the file. The logging might be this when all is working: INFO About to open INFO Wrote bytes from The logging might be this when there is a problem: INFO About to open ERROR Failed to open - Do

Re: file.read Method Documentation (Python 2.7.10)

2023-01-09 Thread Barry Scott
byte *sequences*. Has this error been corrected in the Python 3.x documentation? Please read the python 3 docs and let us know if you think its correct now. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a more efficient threading lock?

2023-02-26 Thread Barry Scott
e there are 4 byte code ops executed. Python's eval loop can switch to another thread between any of them. Its is not true that the GIL provides atomic operations in python. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: PyGILState_Release called twice in embedded application

2023-03-23 Thread Barry Scott
simplefilter("ignore", ResourceWarning) > > to my python code. But I'd rather prevent this from happening in the first > place. > > Any suggestion very welcomed cause I'm puzzled. What 3rd party C extension are you running with? I'd be surprised

Re: built-in pow() vs. math.pow()

2023-03-30 Thread Barry Scott
that the built-in version can not do, and > if not, why is it even there? Maybe math.pow() aways using IEEE 754(?) float point via the C runtime math routines. pow() will give int answer if called with int args. Barry > Thanks in advance for any enlightening comment on

Re: Python not showing correct version

2023-03-30 Thread Barry Scott
not installed. >> WARNING: Skipping 3.10.10 as it is not installed. PIP is for installing python modules not the python program. The python program is installed by running the .exe that you get from python.org <http://python.org/>, for example. Use the standard Windows method to uninstall

Re: built-in pow() vs. math.pow()

2023-03-30 Thread Barry Scott
> On 30 Mar 2023, at 18:11, Barry Scott wrote: > > > >> On 30 Mar 2023, at 10:15, Andreas Eisele wrote: >> >> I sometimes make use of the fact that the built-in pow() function has an >> optional third argument for modulo calculation, which is handy whe

Re: Python not showing correct version

2023-03-31 Thread Barry Scott
> On 31 Mar 2023, at 09:33, Sumeet Firodia wrote: > > Thanks Barry. > > One more thing is that pip --version also refers to python 3.10 > > C:\Users\admin>pip --version > pip 23.0.1 from > C:\Users\admin\AppData\Local\Packages\PythonSoftwareFoundation.Python

Re: Python not showing correct version

2023-04-01 Thread Barry Scott
be less flexible to work with then adding a py.ini. On my Windows 11 I added %userprofile%\AppData\Local\py.ini. To make python 3.8 the default that py.exe uses put this in py.ini: [defaults] python=3.8-64 python3=3.8-64 Barry > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: Windows Gui Frontend

2023-04-01 Thread Barry Scott
macOS and Windows. I found that PyQt was easier to get working. Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] Small lament...

2023-04-03 Thread Barry Warsaw
I heard it on reasonably believable authority that the FLUFL took the year off. Lamentable. -Barry > On Apr 1, 2023, at 11:19, Skip Montanaro wrote: > > Just wanted to throw this out there... I lament the loss of waking up on > April 1st to see a creative April Fool's D

Re: Silly (maybe) question re imported module(s)

2023-05-19 Thread Barry Scott
simple cases it will work, but as your code gets more complex it can break. I rarely use reimport. Usually just exit python and start again. If you are working on scripts then just run them from the Terminal will work well with any need to use reimport. Barry > > > > > --

Re: Exploring terminfo

2021-01-14 Thread Barry Scott
s like bold and clear I'd just use the ANSI escape sequences directly. Are there any terminals that do not understand ANSI escape sequences these days? Barry > > The parts marked with ** use terminfo, or they should. > My problem is that while the clear-screen part works the > bol

Re: Question - problem downloading Python

2021-01-14 Thread Barry Scott
alled and its on your PATH. To run python 3.9.1 do this in cmd.exe py -3.9 It is also likely that just typing "py" will run python 3.9.1. Typing "py -2" will run python 2. Run this to find all the versions of python that you have available: py -0 Barry > > Thank

Re: sqlite3 cannot detect the version of compiled sqlite version at some point in runtime.

2021-01-20 Thread Barry Scott
ead0 0x7fffea149d8c Yes (*) /usr/lib64/python3.9/lib-dynload/_datetime.cpython-39-x86_64-linux-gnu.so 0x77fb2170 0x77fb318b Yes (*) /usr/lib64/python3.9/lib-dynload/_heapq.cpython-39-x86_64-linux-gnu.so 0x7fffea128510 0x7fffea1308ee Yes (*) /us

Re: c bindings with non-python thread callback while python exits

2021-01-26 Thread Barry Scott
; event pthread to join, but that thread is stuck in a callback waiting for the > GIL. > > What is the right way to prevent this problem from happening? As you say you have dead locked. My guess is that you have to shutdown your extension before you quit python. You might find pycx

Re: imalib cant get From: adresses

2021-01-27 Thread Barry Scott
True ) msg_ids = self.server.search( ['ALL'] ) print( msg_ids ) all_msg_info = self.server.fetch( msg_ids, ['FLAGS','ENVELOPE'] ) for msg_id in all_msg_info: msg_info = all_msg_info[ msg_id ] print( '%-4

Re: _Py_FatalErrorFunc not found

2021-01-28 Thread Barry Scott
hon-3.9.1? > If yes what is its name now? Is this code you compiled? If so when you compile against pyton 3.9 dev files you will see errors. > > hplip version is the latest, hplip-3.20.11, but they have not taken notice of > the problem as far as i know. > > Any help is much

Re: Best practice for handling exceptions raised at lower levels?

2021-02-02 Thread Barry Scott
other people will use I'll also do a code inspection to spot sources of exceptions. In your case its a network usage that may need a catch of socket.error. Clearly we cannot impose a requirement to design packages with a specific set of rules implemented. This is open source after all. Barry

Re: Best practice for handling exceptions raised at lower levels?

2021-02-02 Thread Barry Scott
> On 2 Feb 2021, at 20:24, Dan Stromberg wrote: > > > > On Tue, Feb 2, 2021 at 12:00 PM Barry Scott <mailto:[email protected]>> wrote: > When I write packages I aim to trap the exceptions from the lower levels > and convert into a package specific exc

Re: Venv behaviour change py3.9

2021-02-14 Thread Barry Scott
on why the behaviour changes? I did this on wndows 10 and no error seen: py -3.9 -m venv venv Are you running the version of python that you expect? What does python -V tell you? Can you cut-n-paste The command and its output? Barry > -- > https://mail.python.org/mailman/list

Re: Why assert is not a function?

2021-03-03 Thread Barry Scott
if a HTTP request returns unexpected content we will include all the headers and body of the that the request returners. assert http_status == '200', 'Request failed status %r Body:\n%s' % (http_status, http_header_and_body) Barry > > - DLD > -- >

Re: Why assert is not a function?

2021-03-03 Thread Barry Scott
> On 3 Mar 2021, at 18:41, Chris Angelico wrote: > > On Thu, Mar 4, 2021 at 5:25 AM Barry Scott <mailto:[email protected]>> wrote: >> >> >> >>> On 3 Mar 2021, at 17:35, David Lowry-Duda wrote: >>> >>>> asser

Re: Determine what the calling program is

2021-04-19 Thread Barry Scott
raise Only the first time the code runs will the lock be granted. You can then do the possible long running task. When a second copy of the program runs from cron it will get the EWOULDBLOCK error and you can just exit. Barry > > support.py contains: >

Re: "py.ini" question

2021-04-24 Thread Barry Scott
can find out what py.exe is using for its config by running: py -0 The entry with an * at the end is the default. On windows 10 your personal py.ini is in %localappdata%\py.ini do you have one? type %localappdata%\py.ini If not you might want to create one that sets things up as y

Re: "py.ini" question

2021-04-26 Thread Barry Scott
you are running c:\windows\py.exe? What happens if you try running c:\windows\py.exe -0? Barry -- https://mail.python.org/mailman/listinfo/python-list

Re: "py.ini" question

2021-04-26 Thread Barry Scott
;python3=3.6-32 You can prove that py.ini is ignored by using PYLAUNCH_DEBUG but I think its that you do not have the config in the py.ini that does what you want. As an example is here is the output I see: C:\Users\barry>set PYLAUNCH_DEBUG=1 C:\Users\barry>py.exe -3 launche

Re: async watch directory for new files

2021-04-26 Thread Barry Scott
ows 10 > machine, so it would be nice if I have something that works on both. In this case trying to develop the code on Windows will make your life very hard. Are you using Windows because you do not have easy access to Centos 7? If so why not run Centos 7 in a VM on your Windows machine as yo

Re: Standarize TOML?

2021-05-17 Thread Barry Scott
nguage summit, but, ah, might as well put the community two-cents in > now, hey? > > I, for one, feel like this is obvious. I think the python ideas list is a better place to have this discussion. Barry > > -- > Jason C. McDonald (CodeMouse92) > Author | Speaker |

Re: f-strings and internationalisation.

2021-05-24 Thread Barry Scott
ee https://docs.python.org/3/library/gettext.html for more details. And https://www.mattlayman.com/blog/2015/i18n/ looks useful as well. Then you can use use the I18N gettext tools to make a .pot and .po files. Barry > > -- > Antoon Pardon. > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: Definition of "property"

2021-05-30 Thread Barry Scott
perties hold the state. The use of getter functions allows a property's value to be calculated. The use of setting functions allows a property change to update the state an object. The python property mechanism allows the getting and setter to be hidden from the API as that the us

Re: 3.7.6 struggles a bit

2021-06-02 Thread Barry Scott
> On 2 Jun 2021, at 18:18, Luke wrote: > > When i wrote a program, i tried to open it but it struggles to open. I'm guessing you are a Windows user. Does this help? https://docs.python.org/3/faq/windows.html <https://docs.python.org/3/faq/windows.html> Barry -- htt

Re: Interpreter Bug

2021-06-02 Thread Barry Scott
provement. > I have the latest version (3.9.5) and there definitely seems to be > something going on at your end. Details please: Which OS which version of Python etc. What does crashes mean exactly? Was it PyCharm that crashes or python that crashes? Barry > > Any ideas? &

Re: Optimizing Small Python Code

2021-06-24 Thread Barry Scott
9\t\x00\xdc\x87\x14\xb7' > > So the shorter cheat program might now be: The data is smaller, but at the cost of the code that knows how to decompress it. I'd expect that by using compression you have increased memory use as this amount of data is far smaller than code to decompress

Re: Cyclic imports

2021-08-17 Thread Barry Scott
On Monday, 16 August 2021 16:13:47 BST Dan Stromberg wrote: > Hi folks. > > I'm working on a large codebase that has at least one cyclic import. > > In case I end up needing to eliminate the cyclic imports, is there any sort > of tool that will generate an import graph and output Just the cycles?

<    1   2   3   4   5   6   7   >