I am trying to understand why regex is not extracting all of the
characters between two delimiters.
The complete string is the xmp IFD data extracted from a .CR2 image file.
I do have a work around, but it's messy and possibly not future proof.
Any insight greatly appreciated.
Malcol
On 28/08/2018 7:09 AM, John Pote wrote:
On 26/08/2018 00:55, Malcolm wrote:
I am trying to understand why regex is not extracting all of the
characters between two delimiters.
The complete string is the xmp IFD data extracted from a .CR2 image
file.
I do have a work around, but it's
HI
Just had the same problem.
The solution that worked for me was (
pip uninstall numpy
then
pip install numpy==1.19.3
The latest update to windows has an error in the BLAS libray causing the
error. its a known problem.
hope this helps
Malcolm
On 29/11/2020 10:28 am, Larry Burford
Hi
https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy also has a numpy wheel
1.19.4+vanilla‑cp39‑cp39‑win_amd64.whl
"Vanilla is a minimal distribution, which does not include any optimized
BLAS libray or C runtime DLLs."
Have not tried this.
cheers
Malcolm
On 30/11/2020 7:1
"John Bokma" <[EMAIL PROTECTED]> wrote
> A typical Xah Lee posting... wake me up when he is able to write a single
> post that makes and sense, and doesn't contain fuck or similar words.
>
Obscene language isn't acceptable on comp.lang.c.
It is an international group, and what might be acceptable
My company recently hosted a programming competition for schools across the
country. One team made it to the finals using the Python client, one of the
four default clients provided (I wrote it). Most of the other teams were using
Java or C#. Guess which team won?
http://www.windward.net/cod
and I know they have some ongoing issues with Firefox that prevent their
videos from displaying or playing back.
On Tuesday, January 29, 2013 3:31:05 AM UTC-7, Michael Poeltl wrote:
> hi Stefan,
>
>
>
> * Stefan Behnel [2013-01-29 08:00]:
>
> > Michael Torrie, 29.01.201
Peter,
> I think it doesn't matter whether you type in text, or insert it with Ctrl+V
> or the middle mouse button. The validatecommand handler is always triggered.
> I suspect achieving the same effect with Button/KeyPress handlers would
> require significantly more work.
T
ith(match):
value = value.replace(match, '', 1).strip()
while value.endswith(match):
value = value[0:len(value) - len(match)].strip()
# BOILERPLATE: update the value we just transformed
self.data[self.rule.target_column] = value
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Python 3.5: Is there a way to dynamically import specific names from a
module vs importing the full module?
By dynamic I mean via some form of importlib machinery, eg. I'm looking
for the dynamic "from import " equivalent of "import
"'s importlib.import_module.
Ned and Random832,
Ned: Thank you - your example answered my question.
Random832: Thank you for the reminder about "from import
" still importing the module. Yes, I had forgotten that behavior.
Best,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
quot; and "from import ...". I know I could write a
script to do this, but certainly there must be such a capability in the
standard library?
Use case: Discovering list of modules to use for building a Python 3.5
zipapp distributable.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
also be run as a script, giving the filename of a Python script as its
argument, after which a report of the imported modules will be printed.
https://docs.python.org/3.5/library/modulefinder.html
Note there's a similar module for Python 2.7.
--
Malcolm
--
https://mail.python.org/ma
these embedded files (by opening up the zipapp as a zip
archive and navigating from there?).
Thank you,
Malcolm
[1] The zipapp feature of Python 3.5 is pretty cool: It allows you to
package your Python scripts in a single executable zip file. This
isn't a replacement for
Hi Paul,
WOW!:)
I really appreciate the detailed response. You answered all my
questions. I'm looking forward to testing out your pylaunch wrapper.
Thank you very much!
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
urned by this object. I would like to log
the actual line read by the CSVDictReader, not the processed data
returned in the dict.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Oscar/MRAB,
> You could put something between the file and the reader ...
Thank you both for your suggestions ... brilliant! You guys helped me
solve my problem and gave me an excellent strategy for future scenarios.
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
been
obvious to me :)
Packaging and distributing Python scripts as zipped archives is such a
powerful feature I'm surprised that there hasn't been more written on
this topic.
Thank you for sharing these tips with me and the rest of the Python list
community !!
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Looking for a quick way to calculate lines of code/comments in a
collection of Python scripts. This isn't a LOC per day per developer
type analysis - I'm looking for a metric to quickly judge the complexity
of a set of scripts I'm inheriting.
Thank you,
Malcolm
--
https://mail.pyt
Looking for advice on how to expand f-string literal strings whose
values I'm reading from a configuration file vs hard coding into
my script as statements. I'm using f-strings as a very simple
template language.
I'm currently using the following technique to expand these f-strings.
Is there a bett
My original post reformatted for text mode:
Looking for advice on how to expand f-string literal strings whose values I'm
reading from a configuration file vs hard coding into
my script as statements. I'm using f-strings as a very simple template language.
I'm currently using the following tech
Looking for your suggestions on best practice techniques for managing
secrets used by Python daemon scripts. Use case is Windows scripts
running as NT Services, but interested in Linux options as well.
Here's what we're considering
1. Storing secrets in environment vars
2. Storing secrets in confi
> Perhaps it doesn't need to be said, but just to be sure: don't use eval if
> you don't trust the people writing the configuration file. They can do nearly
> unlimited damage to your environment. They are writing code that you are
> running.
Of course! Script and config file are running in a
We're using virtual environments with Python 3.6. Since all our pip
installed modules are in our environment's local site-packages folder,
is the distribution of a virtual environment as simple as recursively
zipping the environment's root folder and distributing that archive to
another machine run
pros, cons,
recommendations, etc.
Thanks!
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
having these
options confused with command line arguments?
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
alues
via a single environment variable (something like PYTHONOPTIONS) vs individual
environment variables.
Thank you
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
> You might try:
> from getopt import getopt
> or the (apparently newer):
> from optparse import OptionParser
Thanks Mike. My question was trying to make a distinction between Python
options (flags that precede the script or module name) and arguments (the
script specific values passed on the co
Thanks to everyone who contributed to this thread. Great feedback and
suggestions! - Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
public/private SSH keys for verification
Any suggestions on techniques and/or libraries appreciated.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Is there a benefit to using one of these techniques over the other?
Is one approach more Pythonic and preferred over the other for
style reasons?
message = message.encode('UTF-8')
message = bytes(message, 'UTF-8')
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Thanks for the replies! I'm going to investigate the use of python-gnupg [1]
which is a Python wrapper for the GPG command line utility. This library is
based on gpg.py written by Andrew Kuchling. I'm all ears if f anyone has any
alternative recommendations or python-gnupg tips to share. BTW:
ies, named temporary files, named sockets/pipes, etc. Is there
any consensus on best practice here?
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
ies, named temporary files,
named sockets/pipes, etc. Is there any consensus on best practice here? Thank
you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
cuted.
I'm outputting module name and line number so I can always go back and
double check a caller's location in source, but that seems like an
archaic way to find this type of information.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Is there a technique that would allow a script to verify its
requirements.txt file before it runs? Use case: To detect unexpected
changes to a script's runtime environment. Does the pip module expose
any methods for this type of task?
Thank you,
Malcolm
--
https://mail.python.org/mailman/lis
Curious to hear if any of you are running Python scripts/apps on MS
Azure cloud services? What services are you using and what has your
experience been? Advice?
Background: Customer migrating to Azure. I'm trying to get ahead of the curve
regarding how Python-friendly the Azure platform is.
Thanks
lib.reload( custom_code )
# run the main code in generated module
custom_code.go()
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
The Python documentation also warns: "Be aware that the return and yield
statements may not be used outside of function definitions even within
the context of code passed to the exec() function. The return value is
None."
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
at
covers max Python source (*.py) and compiled file (*.pyc) sizes without
success. Any tips on where to look for this information?
Background: Python 3.5.1 on Linux.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
> Heh, great question, and I'm curious too! But one place to get a bit more
> info is the standard library.
>
> rosuav@sikorsky:~/cpython/Lib$ find -name \*.py|xargs ls -lS|head
> -rw-r--r-- 1 rosuav rosuav 624122 Jul 17 17:38 ./pydoc_data/topics.py
Brilliant! :)
Th
form of graph?)
to support the above goals?
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Hi Tim,
> I think that what you're looking for is a topological sort
BINGO! That's *exactly* what I was searching for.
Thank you very much,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
upper_method with string s to execute the method
and return 'LOWER'?
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Hi Michael,
> Out[3]: 'HELLO'
> In [4]: g = str.upper
> In [5]: g(s)
> Out[5]: 'HELLO'
That's perfect! My mistake was trying to use the method returned by
''.upper vs. str.upper.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
the caller, not the current function. TD;LR: I want to peek 1 level up
the call stack for this information. A bonus would be a way to have my
logger use info vs the current %(module)s, %(funcName)s, and
%(lineno)d values.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
k 2 levels up.
Perfect! That's exactly what I was looking for.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Hi Peter,
> Fine! Then you can avoid the evil hack I came up with many moons ago:
> https://mail.python.org/pipermail/python-list/2010-March/570941.html
Evil? Damn evil! Love it!
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
I can get cgitb output is to let an exception propagate to the point of
terminating my script ... at which point cgitb grabs the exception and
does its magic.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
ntioned
above.
Thank you both for your help!
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
.glob() to recognize files and
folders that begin with a period, eg. ".profile"? The documentation
states: "If the directory contains files starting with . they won’t
be matched by default.". Any suggestions on what the non-default
approach is to match these type of
Hi Jussi,
You answered my questions - thank you!
Malcolm
> 1. The signature for glob.glob() is "glob.glob(pathname, *,
>recursive=False)". What is the meaning of the 2nd parameter listed
>with an asterisk?
It's not a parameter. It's special syntax t
er?
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
s automatically
deleted in all of the above scenarios?
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Hi Eryk,
Awesome! Thank you very much for your detailed answer!!
Malcolm
Linux has the O_TMPFILE open() flag [1]. This creates an anonymous file
that gets automatically deleted when the last open file descriptor is
closed. If the file isn't opened O_EXCL, then you can make it permane
Thank you Laurent!
- Original message -
From: Laurent Pointal
With __name__ you will have one logger per source file (module), with
corresponding filtering possibilities, and organized hierarchically as
are
packages (logging use . to built its loggers hierarchy).
Without __name__, y
a
specific way?
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
k you both.
Malcolm
[1] PYTHONIOENCODING=ascii:backslashreplace
--
https://mail.python.org/mailman/listinfo/python-list
Chris,
> Don't forget that the print function can simply be shadowed.
I did forget! Another excellent option. Thank you!
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
> You could use win_unicode_console enabled in sitecustomize or usercustomize.
> https://pypi.python.org/pypi/win_unicode_console
The pypi link you shared has an excellent summary of the issues
associated when working Unicode from the Windows terminal.
Thank you Eryk.
Malcolm
--
been
fully decoded so I can pass this line on to the CSV reader. At a high
level it seems that I need to wrap the decoding of a line until it
passes with out any errors. Any suggestions appreciated.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
al is to count the total number of UnicodeExceptions within a file
(as a data quality metric) and track the frequency of specific bad
code's (via a collections.counter dict) to see if there's a pattern that
can be traced to bad upstream process.
Malcolm
Remove them? Not sure what yo
error handler
import codecs
def custom_unicode_error_handler(e):
bad_bytes = e.object[e.start:e.end]
print( 'Bad bytes: ' + bad_bytes.hex())
return ('', e.end)
codecs.register_error('custom_unicode_error_handler',
custom_unicode_error_handler)
Malcol
Curious to learn what Python related git pre-commit hooks people are
using? What hooks have you found useful and which hooks have you tried
and abandoned? Appreciate any suggestions for those new to this process.
Background: Window, macOS, and Linux dev environments, PyCharm professional
edition I
I have a class method that adds additional context to many of the
class's log messages. Rather than calling, for example, logger.info(
'message ...' ) I would like to call my_object.log( 'message ...' ) so
that this additional context is managed in a single place. I'm actually
doing that and its w
?
Are there OS specific issues to be concerned with or is there a general
pattern here? I work across Windows, Linux, and macOS.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Any recommendations on normalizing path strings in cross platform
(Windows, Linux, macOS) for unit tests?
Our goal is to normalize path strings to use forward slash separators so
that we can consistently reference path strings in our unit tests in a
cross platform way.
Example: Under Windows we hav
with a fresh env6. reinstall each directly imported
module (from list in used-
modules.txt); this will pull in dependencies again7. pip freeze >
requirements.txt <--- this should be the exact modules
used by our code
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
my virtual env and recreate it again to start with a fresh env
6. reinstall each directly imported module (from list in used-modules.txt);
this will pull in dependencies again
7. pip freeze > requirements.txt <--- this should be the exact modules used by
our code
Thank you,
Malcolm
--
k you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
esses are launched independent of the
parent (manager) process?
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
behavior is outside of my Python script's control. If
there's a way to disable this behavior under Windows 10/Windows Server 2016,
I'm open to that as well.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
y sure I'm not
typing random Ctrl+S keystrokes while working.
Thanks again Eryk!
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
dows was inadvertently selecting text pausing the running process.
Unchecking the Windows console's Quick Edit mode stops this behavior.
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
sts folder or under each package?
4. Use a src folder or not? If so, where to put above files relative to the src
folder?
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
64-bit Python 3.6.8 running on Windows with a virtual environment activated.
"pip -v" reports 19.0.3
"python -m pip" reports 19.1.1
Is this behavior by design or a bug?
My takeaway is that its better to run "python -m pip ..." vs "pip ..." when
runnin
tion: When ENABLE_USER_SITE is true, packages can get accidentally
installed in user specific Python\Python3XX\site-packages folder, overriding
system packages and ... apparently (at least under Windows) ... virtual
environment packages as well.
Thank you,
Malcolm
--
https://mail.python.org/mailma
f
python*.exe found via Explorer.
This behavior observed across multiple Windows 2016 Enterprise servers and
Windows 10 Professional desktops.
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
> From: Ed Leafe
> StackOverflow:
> https://stackoverflow.com/questions/25584276/how-to-disable-site-enable-user-site-for-an-environment
Thanks Ed! My takeaway from the above article and our path going forward is to
explictly force ENABLE_USER_SITE to false via Python's "-
use "pip" to mean the right
> thing just as "python" does, but maybe something's cached?
I think you're on to something. Running pip as a package (python -m pip) will
force the use of the virtual env copy of pip. Running pip as an application vs
packag
> I've also taken to having my files auto-formatted with yapf on save ...
@Cameron: Have you considered black at all and if so, what are your thoughts?
Thanks,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
> I am exactly in the "pretty advanced usage": I want to create a zip that
> embed numpy. In this case, I have to bundle the C extension. How can I do
> that?
1. PyInstaller
2. PyOxide (new technology, may or may not support Numpy)
Let us know how you make out.
You may need to update your ODBC driver from version 13 to 17.x.
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Python Cookbook; highly recommended.
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
override that behavior by setting a script specific environment
variable or by using a command line switch to point to a different location or
config file.
We store our preferences in an INI style config file which we've found easier
to support when there's problems.
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Folder
|
+-App INI file
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
hanks!
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Thanks Paul and Dan.
@Paul: Yes, it *IS* a bit confusing . Your pip explanation hit the spot.
@Dan: Yes, symlinks would be a good work around.
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
pt data in memory before saving
to disk and to read files into memory and decrypt from there using io.BytesIO
streams.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
esn't appear to
provide support to push/pull files to/from a repo.
Thank you,
Malcolm
--
https://mail.python.org/mailman/listinfo/python-list
Is there a difference between the following 2 ways to launch a console-less
script under Windows?
python
I have written a piece of code that will be part of a larger repository of
related programs. Within this repository, it is standard to issue a 'make'
command to compile any desired program. Is it possible to create a Makefile to
compile a simple Python program? Based on what I have come across s
a(-1) as string
Dim i as integer
s = "This is a sentence of words"
For i = 1 to CountFields(s," ")
a.append NthField(s," ",i)
next
That's it an array a() containing the words of the sentence.
Now can I see how this is done in Python? - nope!
UGH!
M
Sorry John but that don't do it for me. Just get errors comming back
"John Machin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Malcolm Wooden wrote:
>> I'm trying to get my head around Python but seem to be failing miserably.
>>
\lib\string.py", line 122, in split
return s.split(sep, maxsplit)
AttributeError: 'list' object has no attribute 'split'
"John Machin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Malcolm Wooden wrote:
>> Sorry John but that don&
Yes Sergei, as 3 of the lines are Dim statements, the real code is just 4
lines, a totally logical. It's not the amout of code thats a probelm, it's
following the logic and structure thats important. As I said Python.. UGH!
Malcolm
"Sergei Organov" <[EMAIL PROTECTED]&
ay(???) be supported in Python 2.6 and ads for a commercial Windows
(only) zip component from chilkat.com.
Any suggestions?
Thank you,
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
ss:
{{invoice.address}}
This order was generated at {{some date/time expression}}
"""
Any suggestions appreciated.
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
le assumptions regarding locale properties like thousands
separators, decimal points, etc) - either via a locale attribute or by
examining the locale of the thread its running under.
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
was planning on
using wxPython until I saw your comment above.
Any suggestions on an alternative Python client-side GUI library (pyQT
?) or tips on where I can find out more about wxPython/wxWidget
problems?
Thank you,
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 126 matches
Mail list logo