Re: numpy problem (follow up)

2020-11-29 Thread Malcolm
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

Re: numpy problem (follow up)

2020-11-28 Thread Malcolm
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

Is there a difference between python

2020-04-05 Thread Malcolm Greene
Is there a difference between the following 2 ways to launch a console-less script under Windows? python

Simple Python github library to push/pull files?

2020-01-28 Thread Malcolm Greene
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

Recommendation on best cross-platform encryption package

2020-01-22 Thread Malcolm Greene
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

Re: Python 3.6 on Windows - does a python3 alias get created by installation?

2019-10-09 Thread Malcolm Greene
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

Python 3.6 on Windows - does a python3 alias get created by installation?

2019-10-09 Thread Malcolm Greene
hanks! Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Re: Application Preferences

2019-08-19 Thread Malcolm Greene
Folder | +-App INI file Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Re: Application Preferences

2019-08-19 Thread Malcolm Greene
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

Re: Books for Python 3.7

2019-07-15 Thread Malcolm Greene
Python Cookbook; highly recommended. Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Re: pyodbc -> MS-SQL Server Named Instance ?

2019-07-02 Thread Malcolm Greene
You may need to update your ODBC driver from version 13 to 17.x. Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Re: Looking for tips and gotchas for working with Python 3.5 zipapp feature

2019-07-01 Thread Malcolm Greene
> 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.

Re: change spacing to two instead of four with pep8 or flake8?

2019-06-29 Thread Malcolm Greene
> 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

Re: pip vs python -m pip?

2019-06-21 Thread Malcolm Greene
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

Re: How to force "python -m site" ENABLE_USER_SITE to false?

2019-06-21 Thread Malcolm Greene
> 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 "-

Re: pip vs python -m pip?

2019-06-21 Thread Malcolm Greene
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

How to force "python -m site" ENABLE_USER_SITE to false?

2019-06-21 Thread Malcolm Greene
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

pip vs python -m pip?

2019-06-21 Thread Malcolm Greene
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

What's the latest best practice on Python project directory layouts?

2019-06-14 Thread Malcolm Greene
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

Re: Block Ctrl+S while running Python script at Windows console?

2019-03-19 Thread Malcolm Greene
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

Re: Block Ctrl+S while running Python script at Windows console? (solved)

2019-03-18 Thread Malcolm Greene
y sure I'm not typing random Ctrl+S keystrokes while working. Thanks again Eryk! Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Block Ctrl+S while running Python script at Windows console?

2019-03-18 Thread Malcolm Greene
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

Multiprocessing vs subprocess to run Python scripts in parallel

2019-03-12 Thread Malcolm Greene
esses are launched independent of the parent (manager) process? Thank you, Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Convert Windows paths to Linux style paths

2019-03-12 Thread Malcolm Greene
k you, Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Re: Best way to remove unused pip installed modules/module dependencies from a virtual env?

2019-02-13 Thread Malcolm Greene
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 --

Best way to remove unused pip installed modules/module dependencies from a virtual env?

2019-02-13 Thread Malcolm Greene
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

Normalizing path strings and separators in cross-platform unit test scripts

2019-01-07 Thread Malcolm Greene
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

Best practice for upgrading SQLite C library (DLL, SO, etc) that ships with Python

2019-01-05 Thread Malcolm Greene
? 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

Logging - have logger use caller's function name and line number

2018-12-29 Thread Malcolm Greene
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

What Python related git pre-commit hooks are you using?

2018-11-18 Thread Malcolm Greene
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

Anyone running Python on MS Azure?

2018-11-09 Thread Malcolm Greene
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

Verify pip's requirements.txt file at runtime?

2018-09-11 Thread Malcolm Greene
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

logging module - how to include method's class name when using %(funcName)

2018-09-10 Thread Malcolm Greene
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

Cross platform mutex to prevent script running more than instance?

2018-09-05 Thread Malcolm Greene
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

Cross platform mutex to prevent script running more than instance?

2018-09-03 Thread Malcolm Greene
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

Re: Verifying the integrity/lineage of a file

2018-08-31 Thread Malcolm Greene
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:

bytes() or .encode() for encoding str's as bytes?

2018-08-31 Thread Malcolm Greene
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

Verifying the integrity/lineage of a file

2018-08-31 Thread Malcolm Greene
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

Re: regex pattern to extract repeating groups

2018-08-27 Thread Malcolm
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

regex pattern to extract repeating groups

2018-08-27 Thread Malcolm
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

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-15 Thread Malcolm Greene
Thanks to everyone who contributed to this thread. Great feedback and suggestions! - Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-14 Thread Malcolm Greene
> 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

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-14 Thread Malcolm Greene
alues via a single environment variable (something like PYTHONOPTIONS) vs individual environment variables. Thank you Malcolm -- https://mail.python.org/mailman/listinfo/python-list

How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-14 Thread Malcolm Greene
having these options confused with command line arguments? Thank you, Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Anyone using cloud based monitoring/logging services with Python logging module?

2018-07-26 Thread Malcolm Greene
pros, cons, recommendations, etc. Thanks! Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Distributing Python virtual environments

2018-03-29 Thread Malcolm Greene
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

Re: Python 3.6: How to expand f-string literals read from a file vs inline statement

2018-03-23 Thread Malcolm Greene
> 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

Best practice for managing secrets (passwords, private keys) used by Python scripts running as daemons

2018-03-23 Thread Malcolm Greene
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

Re: Python 3.6: How to expand f-string literals read from a file vs inline statement

2018-03-23 Thread Malcolm Greene
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

Python 3.6: How to expand f-string literals read from a file vs inline statement

2018-03-23 Thread Malcolm Greene
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

Re: Standard lib version of something like enumerate() that takes a max count iteration parameter?

2017-06-14 Thread Malcolm Greene
Thank you Peter and Jussi - both your solutions were very helpful! Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Standard lib version of something like enumerate() that takes a max count iteration parameter?

2017-06-14 Thread Malcolm Greene
ey in enumerate( some_iterable, max_count=10 ): Thank you, Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Best practice tips for sizing thread/process pools and concurrent futures max_workers?

2017-05-04 Thread Malcolm Greene
there any 3rd party libraries that monitor CPU/core and memory utilization to dynamically tune these values based on system capacity? Thank you, Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Elegant way to merge dicts without overwriting keys?

2017-05-04 Thread Malcolm Greene
keys to sets and compare these sets to determine which keys are unique and can be merged and which keys are dupes and should be tracked in that manner. At a high level, does this sound like a reasonable approach? Thank you, Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Re: Who still supports recent Python on shared hosting

2017-03-06 Thread Malcolm Greene
Another endorsement for Webfaction. -- https://mail.python.org/mailman/listinfo/python-list

Quick way to calculate lines of code/comments in a collection of Python scripts?

2016-10-05 Thread Malcolm Greene
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

Re: Looking for tips and gotchas for working with Python 3.5 zipapp feature

2016-09-24 Thread Malcolm Greene
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

Re: Obtain the raw line of text read by CSVDictReader when reporting errors?

2016-09-22 Thread Malcolm Greene
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

Obtain the raw line of text read by CSVDictReader when reporting errors?

2016-09-21 Thread Malcolm Greene
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

Re: Looking for tips and gotchas for working with Python 3.5 zipapp feature

2016-09-19 Thread Malcolm Greene
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

Looking for tips and gotchas for working with Python 3.5 zipapp feature

2016-09-16 Thread Malcolm Greene
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

Re: Discover all non-standard library modules imported by a script

2016-09-16 Thread Malcolm Greene
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

Discover all non-standard library modules imported by a script

2016-09-16 Thread Malcolm Greene
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

Re: Dynamically import specific names from a module vs importing full module

2016-08-23 Thread Malcolm Greene
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

Dynamically import specific names from a module vs importing full module

2016-08-22 Thread Malcolm Greene
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.

Advice on optimizing a Python data driven rules engine

2016-08-11 Thread Malcolm Greene
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

Re: Capturing the bad codes that raise UnicodeError exceptions during decoding

2016-08-04 Thread Malcolm Greene
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

Re: Capturing the bad codes that raise UnicodeError exceptions during decoding

2016-08-04 Thread Malcolm Greene
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

Capturing the bad codes that raise UnicodeError exceptions during decoding

2016-08-04 Thread Malcolm Greene
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

Re: print() function with encoding= and errors= parameters?

2016-08-03 Thread Malcolm Greene
> 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 --

Re: print() function with encoding= and errors= parameters?

2016-08-03 Thread Malcolm Greene
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

Re: print() function with encoding= and errors= parameters?

2016-08-03 Thread Malcolm Greene
k you both. Malcolm [1] PYTHONIOENCODING=ascii:backslashreplace -- https://mail.python.org/mailman/listinfo/python-list

print() function with encoding= and errors= parameters?

2016-08-03 Thread Malcolm Greene
a specific way? Thank you, Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Re: logging: getLogger() or getLogger(__name__)?

2016-07-28 Thread Malcolm Greene
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

Re: Behavior of tempfile temp files when scripts killed, interpreter crashes, server crashes?

2016-07-28 Thread Malcolm Greene
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

Behavior of tempfile temp files when scripts killed, interpreter crashes, server crashes?

2016-07-27 Thread Malcolm Greene
s automatically deleted in all of the above scenarios? Thank you, Malcolm -- https://mail.python.org/mailman/listinfo/python-list

logging: getLogger() or getLogger(__name__)?

2016-07-27 Thread Malcolm Greene
er? Thank you, Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.5 glob.glob() 2nd param (*) and how to detect files/folders beginning with "."?

2016-07-26 Thread Malcolm Greene
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

Python 3.5 glob.glob() 2nd param (*) and how to detect files/folders beginning with "."?

2016-07-26 Thread Malcolm Greene
.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

Re: Possible to capture cgitb style output in a try/except section?

2016-07-26 Thread Malcolm Greene
ntioned above. Thank you both for your help! Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Possible to capture cgitb style output in a try/except section?

2016-07-26 Thread Malcolm Greene
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

Re: Caller's module name, function/method name and line number for output to logging

2016-07-26 Thread Malcolm Greene
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

Re: Caller's module name, function/method name and line number for output to logging

2016-07-25 Thread Malcolm Greene
k 2 levels up. Perfect! That's exactly what I was looking for. Thank you, Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Caller's module name, function/method name and line number for output to logging

2016-07-25 Thread Malcolm Greene
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

Re: Dynamically call methods where method is known by address vs name

2016-07-22 Thread Malcolm Greene
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

Dynamically call methods where method is known by address vs name

2016-07-22 Thread Malcolm Greene
upper_method with string s to execute the method and return 'LOWER'? Thank you, Malcolm   -- https://mail.python.org/mailman/listinfo/python-list

Re: Algorithm for sequencing a collection of dependent equations

2016-07-22 Thread Malcolm Greene
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

Algorithm for sequencing a collection of dependent equations

2016-07-22 Thread Malcolm Greene
form of graph?) to support the above goals? Thank you, Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Re: Max size of Python source code and compiled equivalent

2016-07-21 Thread Malcolm Greene
> 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

Max size of Python source code and compiled equivalent

2016-07-21 Thread Malcolm Greene
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

Re: Technique for safely reloading dynamically generated module

2016-07-21 Thread Malcolm Greene
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

Technique for safely reloading dynamically generated module

2016-07-21 Thread Malcolm Greene
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

Python Makefiles... are they possible?

2013-02-12 Thread Malcolm White
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

Re: Further evidence that Python may be the best language forever

2013-01-29 Thread Malcolm McCrimmon
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

Further evidence that Python may be the best language forever

2013-01-28 Thread Malcolm McCrimmon
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

Re: Validating Entry in tkinter

2011-07-25 Thread Malcolm Greene
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

Re: IMAP4_SSL, libgmail, GMail and corporate firewall/proxy

2011-02-16 Thread Malcolm Greene
Andrea, What type of result do you get trying port 993 ? Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: "Strong typing vs. strong testing"

2010-09-28 Thread Malcolm McLean
On Sep 28, 12:19 pm, Tim Bradshaw wrote: > > There are several existing systems which do this.  The HP48 (and > descendants I expect) support "units" which are essentially dimensions. >  I don't remember if it signals errors for incoherent dimensions.   > Mathematica also has some units support, a

Re: "Strong typing vs. strong testing"

2010-09-28 Thread Malcolm McLean
On Sep 27, 9:29 pm, p...@informatimago.com (Pascal J. Bourguignon) wrote: > > On the other hand, with the dynamic typing mindset, you might even wrap > your values (of whatever numerical type) in a symbolic expression > mentionning the unit and perhaps other meta data, so that when the other > modu

Re: "Strong typing vs. strong testing"

2010-09-28 Thread Malcolm McLean
On Sep 27, 7:46 pm, namekuseijin wrote: > On 27 set, 05:46, TheFlyingDutchman wrote: > > Fact is: almost all user data from the external words comes into > programs as strings. No typesystem or compiler handles this fact all > that graceful...- Hide quoted text - > You're right. C should have a

  1   2   >