Re: How to run a module before install?

2019-01-14 Thread Peter Otten
[email protected] wrote: > I had download a module which has the following directory structure: > > [XL-Sudoku-Solver_master] > |__[tests] > |__[xl_sudoku_solver] > |__setup.py |__ __init__.py > |__problem1.txt |__ __main__.py > |__README.md |__ ... > |__ ... > > The s

Re: How to run a module before install?

2019-01-14 Thread jfong
Peter Otten於 2019年1月14日星期一 UTC+8下午4時04分33秒寫道: > [email protected] wrote: > > > I had download a module which has the following directory structure: > > > > [XL-Sudoku-Solver_master] > > |__[tests] > > |__[xl_sudoku_solver] > > |__setup.py |__ __init__.py > > |__problem1.txt |__

Re: Email blast management?

2019-01-14 Thread Hartmut Goebel
Am 09.01.19 um 18:59 schrieb Chris Angelico: > TBH, I'd recommend using a service like MailChimp, avoiding the entire > Python question at all. But for this you need to hand over the addresses to a third-party (the service provider). This does not respect the privacy of the customers. -- Schönen

Re: Email blast management?

2019-01-14 Thread Chris Angelico
On Mon, Jan 14, 2019 at 10:39 PM Hartmut Goebel wrote: > > Am 09.01.19 um 18:59 schrieb Chris Angelico: > > TBH, I'd recommend using a service like MailChimp, avoiding the entire > > Python question at all. > > But for this you need to hand over the addresses to a third-party (the > service provid

get the terminal's size

2019-01-14 Thread Alex Ternaute
Hi there, I want to know the number of columns of the terminal where python2 writes it's outputs. In a terminal, I type $ echo $COLUMNS 100 But in Python, os.getenv("COLUMNS") gets nothing. It gets nothing as well if I try to read the output of "echo $COLUMNS" from a subprocess. I feel that I

Re: How to run a module before install?

2019-01-14 Thread Peter Otten
[email protected] wrote: >> h:\Temp\XL-Sudoku-Solver-master>py -m xl_sudoku_solver > > Great! it works. Thank you, peter. > > By the way, can you explain what these two command difference means? with > or without a "-m". Or pointing where the document is. Thanks ahead:-) > https://docs.pytho

Re: get the terminal's size

2019-01-14 Thread Peter Otten
Alex Ternaute wrote: > Hi there, > > I want to know the number of columns of the terminal where python2 writes > it's outputs. > > In a terminal, I type > $ echo $COLUMNS > 100 > > But in Python, os.getenv("COLUMNS") gets nothing. > It gets nothing as well if I try to read the output of "echo $

Re: get the terminal's size

2019-01-14 Thread Alex Ternaute
Hi, Peter Otten : >> In a terminal, I type $ echo $COLUMNS 100 >> But in Python, os.getenv("COLUMNS") gets nothing. >> I feel that I'm missing something but what ? > $ export COLUMNS Thank you very much ! -- Aelx -- https://mail.python.org/mailman/listinfo/python-list

Re: get the terminal's size

2019-01-14 Thread Thomas Jollans
On 14/01/2019 12.57, Alex Ternaute wrote: > Hi there, > > I want to know the number of columns of the terminal where python2 writes > it's outputs. > > In a terminal, I type > $ echo $COLUMNS > 100 > > But in Python, os.getenv("COLUMNS") gets nothing. > It gets nothing as well if I try to read

Re: Email blast management?

2019-01-14 Thread Hartmut Goebel
Am 14.01.19 um 12:47 schrieb Chris Angelico: > It's a whole lot more respectful than keeping your own database of > email addresses and then having it compromised some day. This assumes that one would not *keep* a list of customers in in company. -- Schönen Gruß Hartmut Goebel Dipl.-Informatiker

python package management confusion

2019-01-14 Thread dcs3spp via Python-list
Hi, I am a newbie completely confused with python package management. I have a setup.py file (listed below) and have setup pip and setup.cfg to install my own dependencies from a local devpi repository. Can setup.py reference a git repository so that I can install from that url? Is this possi

Re: get the terminal's size

2019-01-14 Thread Grant Edwards
On 2019-01-14, Peter Otten <[email protected]> wrote: > >> I want to know the number of columns of the terminal where python2 writes >> it's outputs. >> >> In a terminal, I type >> $ echo $COLUMNS >> 100 >> >> But in Python, os.getenv("COLUMNS") gets nothing. >> It gets nothing as well if I try to

ANN: Wing Python IDE 6.1.3 released

2019-01-14 Thread Wingware
Hi, We've just released Wing 6.1.3 , which improves management of the Python Shell when the project environment changes, adds 2FA card selector capability in remote host configuration , improves support for virt

RE: Python read text file columnwise

2019-01-14 Thread Schachner, Joseph
About the original question: If I were you, I would put the 3 numbers into a list (or a tuple, if you don't need to modify them) and put this into a dictionary. The key would be the date & time string. Then, if you need to find a particular entry you can look it up by date and time. But I s

Re: get the terminal's size

2019-01-14 Thread Peter Otten
Grant Edwards wrote: os.environ["COLUMNS"] > [...] will tell you the terminal size at the time Python was started. I admit that none of my scripts is ambitious enough to try and track changes in terminal size. But still, Grant's post prompted me to reread the doc and source of shutil.get_ter

Re: get the terminal's size

2019-01-14 Thread Grant Edwards
On 2019-01-14, Peter Otten <[email protected]> wrote: > Grant Edwards wrote: > > os.environ["COLUMNS"] > >> [...] will tell you the terminal size at the time Python was started. > > I admit that none of my scripts is ambitious enough to try and track > changes in terminal size. > > But still, Grant'

Re: get the terminal's size

2019-01-14 Thread Alex Ternaute
Hi Thomas >> Looking on the internet for a hint, I see that python3 has an >> os.get_terminal_size(). > Use that then. Up to now I wanted to keep compatibility with a big bunch of code in Python2 that I do no maintain by myself. Well, I saw that get_terminal_size() follows the windows resizings

Re: get the terminal's size

2019-01-14 Thread Alex Ternaute
Hi, Grant Edwards : >>export COLUMNS LINES > That will tell you the terminal size at the time Python was started. Ok, I think tracking these changes in real time is not worth the work to be done using Python2. I think at last I'll rewrite this (little) programe in Python3 in order to use get_

RE: get the terminal's size

2019-01-14 Thread Schachner, Joseph
Note sure why you couldn't capture $ echo $COLUMNS from a subprocess call. But, how about this (found on the web): from win32api import GetSystemMetrics print "Width =", GetSystemMetrics(0) print "Height =", GetSystemMetrics(1) -Original Message- From: Alex Ternaute Sent: Monday, Ja

Re: get the terminal's size

2019-01-14 Thread Grant Edwards
On 2019-01-14, Schachner, Joseph wrote: > Note sure why you couldn't capture $ echo $COLUMNS from a subprocess > call. You can. But, the subprocess is going to inherit the value from the Python program's environment, so it's just pointless complexity. -- Grant Edwards grant.b.edw

RE: get the terminal's size

2019-01-14 Thread Schachner, Joseph
I just tested the fix I proposed, in Python 2.7.13 Code: from win32api import GetSystemMetrics def main(): print "Width =", GetSystemMetrics(0) print "Height =", GetSystemMetrics(1) if __name__ == '__main__': main() Result: Width = 1536 Height = 864 -Original Message- From:

Re: get the terminal's size

2019-01-14 Thread Bob van der Poel
On Mon, Jan 14, 2019 at 4:57 AM Alex Ternaute wrote: > Hi there, > > I want to know the number of columns of the terminal where python2 writes > it's outputs. > > In a terminal, I type > $ echo $COLUMNS > 100 > > But in Python, os.getenv("COLUMNS") gets nothing. > It gets nothing as well if I try

Tracemalloc overhead when profiling

2019-01-14 Thread Juris __
Hi, I was looking for a way to profile memory usage for some script which deals with log message parsing. Looking through Python's stdlib I stumbled upon tracemalloc module. So I tried my hand on profiling my script. A few things I noticed that I am not 100% sure I can explain. Tracemalloc mem

Re: Email blast management?

2019-01-14 Thread Chris Angelico
On Tue, Jan 15, 2019 at 12:53 AM Hartmut Goebel wrote: > > Am 14.01.19 um 12:47 schrieb Chris Angelico: > > It's a whole lot more respectful than keeping your own database of > > email addresses and then having it compromised some day. > > This assumes that one would not *keep* a list of customers

ANN: Creating GUI Applications with wxPython

2019-01-14 Thread Mike Driscoll
Hi, I just thought I would let you all know that I am working on my 2nd wxPython book, "Creating GUI Applications with wxPython". This one will be about actually creating small runnable applications instead of just recipes like my Cookbook did. I hope to have 8-10 working applications included

AssertionError without traceback?

2019-01-14 Thread Israel Brewster
I have a flask application deployed on CentOS 7 using Python 3.6.7 and uwsgi 2.0.17.1, proxied behind nginx. uwsgi is configured to listed on a socket in /tmp. The app uses gevent and the flask_uwsgi_websockets plugin as well as various other third-party modules, all installed via pip in a virtu

sampling from frequency distribution / histogram without replacement

2019-01-14 Thread duncan smith
Hello, Just checking to see if anyone has attacked this problem before for cases where the population size is unfeasibly large. i.e. The number of categories is manageable, but the sum of the frequencies, N, precludes simple solutions such as creating a list, shuffling it and using the first

Re: get the terminal's size

2019-01-14 Thread Cameron Simpson
On 14Jan2019 17:16, Alex Ternaute wrote: Looking on the internet for a hint, I see that python3 has an os.get_terminal_size(). Use that then. Up to now I wanted to keep compatibility with a big bunch of code in Python2 that I do no maintain by myself. Well, I saw that get_terminal_size() fol

Re: sampling from frequency distribution / histogram without replacement

2019-01-14 Thread Gregory Ewing
duncan smith wrote: Hello, Just checking to see if anyone has attacked this problem before for cases where the population size is unfeasibly large. The fastest way I know of is to create a list of cumulative frequencies, then generate uniformly distributed numbers and use a binary search

Re: get the terminal's size

2019-01-14 Thread John Doe
On 2019-01-14, Bob van der Poel wrote: > try this: > > > http://stackoverflow.com/questions/566746/how-to-get-console-window-width-in-python > and have a look at this one too: https://stackoverflow.com/questions/1396820/apt-like-column-output-python-library/1446973#1446973 > -- https://mail.pyth

RE: Email blast management?

2019-01-14 Thread Avi Gross
There is an old saying about getting what you paid for. Python can be free but applications have costs. Chris makes some valid points when saying there are existing solutions that may be worth considering. If someone wants to know about commercial products that do approximately what they need and

Re: sampling from frequency distribution / histogram without replacement

2019-01-14 Thread duncan smith
On 14/01/2019 22:59, Gregory Ewing wrote: > duncan smith wrote: >> Hello, >>   Just checking to see if anyone has attacked this problem before >> for cases where the population size is unfeasibly large. > > The fastest way I know of is to create a list of cumulative > frequencies, then generat

Re: get the terminal's size

2019-01-14 Thread eryk sun
On 1/14/19, Schachner, Joseph wrote: > I just tested the fix I proposed, in Python 2.7.13 > > Code: > from win32api import GetSystemMetrics > > def main(): > print "Width =", GetSystemMetrics(0) > print "Height =", GetSystemMetrics(1) That gets the monitor size, i.e: SM_CXSCREEN (0)

Re: sampling from frequency distribution / histogram without replacement

2019-01-14 Thread Spencer Graves
On 2019-01-14 18:40, duncan smith wrote: On 14/01/2019 22:59, Gregory Ewing wrote: duncan smith wrote: Hello,   Just checking to see if anyone has attacked this problem before for cases where the population size is unfeasibly large. The fastest way I know of is to create a list of cumul

3 random numbers

2019-01-14 Thread caigy84
So I was given this question to be solved in Python 3 : Pick any 3 random ascending numbers and write out a loop function that prints out all 3 numbers. This was the code and solution presented to me. Can anyone understand it and explain it to me please ? I have looked at it but cannot see how i

Re: 3 random numbers

2019-01-14 Thread Spencer Graves
On 2019-01-14 23:29, [email protected] wrote: So I was given this question to be solved in Python 3 : Pick any 3 random ascending numbers and write out a loop function that prints out all 3 numbers. This was the code and solution presented to me. Can anyone understand it and explain it to me

Re: 3 random numbers

2019-01-14 Thread Cameron Simpson
On 14Jan2019 21:29, [email protected] wrote: So I was given this question to be solved in Python 3 : Pick any 3 random ascending numbers and write out a loop function that prints out all 3 numbers. This was the code and solution presented to me. Can anyone understand it and explain it to me plea

Re: python package management confusion

2019-01-14 Thread dieter
dcs3spp via Python-list writes: > I am a newbie completely confused with python package management. > > I have a setup.py file (listed below) and have setup pip and setup.cfg to > install my own dependencies from a local devpi repository. > > Can setup.py reference a git repository so that I can

Re: Tracemalloc overhead when profiling

2019-01-14 Thread dieter
Juris __ writes: > I was looking for a way to profile memory usage for some script which > deals with log message parsing. Looking through Python's stdlib I > stumbled upon tracemalloc module. So I tried my hand on profiling my > script. A few things I noticed that I am not 100% sure I can expl

Re: AssertionError without traceback?

2019-01-14 Thread dieter
Israel Brewster writes: > I have a flask application deployed on CentOS 7 using Python 3.6.7 and uwsgi > 2.0.17.1, proxied behind nginx. uwsgi is configured to listed on a socket in > /tmp. The app uses gevent and the flask_uwsgi_websockets plugin as well as > various other third-party modules,

Re: python package management confusion

2019-01-14 Thread Chris Angelico
On Tue, Jan 15, 2019 at 6:18 PM dieter wrote: > > dcs3spp via Python-list writes: > > I am a newbie completely confused with python package management. > > > > I have a setup.py file (listed below) and have setup pip and setup.cfg to > > install my own dependencies from a local devpi repository