Re: How to achieve pyc only deployment for module in python3.6

2018-10-02 Thread Kirill Balunov
On Tue, Oct 2, 2018, 08:42 Chris Angelico  wrote:

> On Tue, Oct 2, 2018 at 12:01 PM Chandana Pattanayak
>  wrote:
> >
> > Hi,
> >
> > I have a requirement to provide basic code protection for a module in our
> > product suite. With python 3.6 the .pyc files are created under pycache ,
> > so if i remove the py file the module is not found anymore.
>
> If you want code protection, the ONLY reliable way to do it is to not
> provide the code *at all*, in any form.
>

I think Cython is a rather reliable way to do it. There is a nice post to
start with “Protecting Python Sources With Cython” @2parrots
https://medium.com/@xpl/protecting-python-sources-using-cython-dcd940bb188e

With kind regards,
-gdg

>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: This thread is closed [an actual new thread]

2018-10-02 Thread Rhodri James

On 02/10/18 01:02, Ethan Furman wrote:

On 10/01/2018 04:26 PM, Ben Finney wrote:
 > Ethan Furman writes:

 >> This thread is closed.
 >
 > Coming from a moderator of this forum, I don't know how that statement
 > is to be interpreted.

It should be interpreted as:

- No further discussion should take place on this thread.
- I've done what I can with the primitive tools at hand to block
   any further discussion.
- Continued considerate posts will be discarded.
- Continued flame-bait/inconsiderate posts will be met with warnings
   or stronger as warranted.


On what grounds are you suppressing debate?  It is exactly and precisely 
not irrelevant to Python, since it's discussing a Python-specific change 
to known and understood computing terminology, and frankly the statement 
"Continued considerate posts will be discarded" is outrageous.


I have been unimpressed with the moderation team for some weeks now, but 
this is just not acceptable.


--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


ANN: distlib 0.2.8 released on PyPI

2018-10-02 Thread Vinay Sajip via Python-list
I've recently released version 0.2.8 of distlib on PyPI [1]. For 
newcomers,distlib is a library of packaging functionality which is intended to 
beusable as the basis for third-party packaging tools.
The main changes in this release are as follows:
* Fixed #107: Updated documentation on testing to include information on  
setting PYTHONHASHSEED.
* Fixed #108: Updated metadata scan to look for the METADATA file as well as 
the  JSON formats.
* Fixed #109: Removed existing files (which might have been symlinks) before  
overwriting.
* Fixed #111: Avoided unnecessary newlines in script preambles, which caused  
problems with detecting encoding declarations. Thanks to Wim Glenn for the  
report and patch.
* Fixed #112: Handled wheel tags and platform-dependent downloads correctly in  
SimpleScrapingLocator.
A more detailed change log is available at [2].
Please try it out, and if you find any problems or have any suggestions for 
improvements,please give some feedback using the issue tracker! [3]
Regards,
Vinay Sajip
[1] https://pypi.org/project/distlib/0.2.8/[2] https://goo.gl/tVzKUc[3] 
https://bitbucket.org/pypa/distlib/issues/new
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: This thread is closed [an actual new thread]

2018-10-02 Thread Robin Becker

On 02/10/2018 11:46, Rhodri James wrote:

On 02/10/18 01:02, Ethan Furman wrote:

On 10/01/2018 04:26 PM, Ben Finney wrote:
 > Ethan Furman writes:

 >> This thread is closed.
 >
 > Coming from a moderator of this forum, I don't know how that statement
 > is to be interpreted.

It should be interpreted as:

- No further discussion should take place on this thread.
- I've done what I can with the primitive tools at hand to block
   any further discussion.
- Continued considerate posts will be discarded.
- Continued flame-bait/inconsiderate posts will be met with warnings
   or stronger as warranted.


On what grounds are you suppressing debate?  It is exactly and precisely not irrelevant to Python, since it's discussing a 
Python-specific change to known and understood computing terminology, and frankly the statement "Continued considerate posts will 
be discarded" is outrageous.


I have been unimpressed with the moderation team for some weeks now, but this 
is just not acceptable.


+1 from me

there seems to be a considerable humour deficit in some quarters. The language is called python and is named after Monty Python's 
Flying Circus (https://docs.python.org/2/faq/general.html#why-is-it-called-python). Apparently we now also have the Spanish 
Inquisition :)

--
Robin Becker

--
https://mail.python.org/mailman/listinfo/python-list


Replacing : with "${" at the beginning of the word and adding "}" at the end of the word

2018-10-02 Thread zljubisic
Hi,

if I have a string:

sql = """
where 1 = 1
and field = :value 
and field2 in (:list)
"""

I would like to replace every word that starts with ":" in the following way:
1. replace ":" with "${"
2. at the end of the word add "}"


An example should look like this:

where 1 = 1
and field = ${value}
and field2 in (${list})

How to do that?

Regards.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Replacing : with "${" at the beginning of the word and adding "}" at the end of the word

2018-10-02 Thread Chris Angelico
On Tue, Oct 2, 2018 at 10:36 PM  wrote:
>
> Hi,
>
> if I have a string:
>
> sql = """
> where 1 = 1
> and field = :value
> and field2 in (:list)
> """
>
> I would like to replace every word that starts with ":" in the following way:
> 1. replace ":" with "${"
> 2. at the end of the word add "}"
>
>
> An example should look like this:
>
> where 1 = 1
> and field = ${value}
> and field2 in (${list})
>
> How to do that?

First off: WHY? Are you then planning to do a naive interpolation?

Are you trying to recognize syntactic elements in SQL? If so, you'll
need an SQL parser. Or are you prepared to handle just a few basics,
like making sure the colon isn't inside quotes? And if so, which
basics? And what constitutes a word?

I strongly recommend *not doing this* unless you have an extremely
good reason to.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Replacing : with "${" at the beginning of the word and adding "}" at the end of the word

2018-10-02 Thread zljubisic
I have to execute the same sql in two different programs.
Each of them marks parameters differently.

Anyway, I have found the solution.

cnv_sel = re.sub(r"(:(.+?)\b)", r"${\2}", sel)


Reagards.
-- 
https://mail.python.org/mailman/listinfo/python-list


python not working on RHEL6

2018-10-02 Thread mchathuranga4
Hi All,

I'm a beginner on this. I was trying to install a new python version which is 
2.7.5. My OS(RHEL6) had already installed version 2.6. so I downloaded the tar 
and unzipped it then executed
 
./configure --prefix=/usr   \
--enable-shared \
--with-system-expat \
--with-system-ffi   \
--enable-unicode=ucs4 &&
make 

afterwards 
sudo make install &&
sudo chmod -v 755 /usr/lib/libpython2.7.so.1.0

http://www.linuxfromscratch.org/blfs/view/7.4/general/python2.html This is what 
I followed and which got me here.

everything was successfully finished.

afterwards when I type python in the terminal I get below error: 

python: error while loading shared libraries: libpython2.7.so.1.0: cannot open 
shared object file: No such file or directory

I guess from the little knowledge I have I should have executed altinstall 
instead of install. Anyone know how to resolve this?

Thanks.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python not working on RHEL6

2018-10-02 Thread Chris Angelico
On Wed, Oct 3, 2018 at 12:01 AM  wrote:
>
> Hi All,
>
> I'm a beginner on this. I was trying to install a new python version which is 
> 2.7.5. My OS(RHEL6) had already installed version 2.6. so I downloaded the 
> tar and unzipped it then executed
>
> ./configure --prefix=/usr   \
> --enable-shared \
> --with-system-expat \
> --with-system-ffi   \
> --enable-unicode=ucs4 &&
> make
>
> afterwards
> sudo make install &&
> sudo chmod -v 755 /usr/lib/libpython2.7.so.1.0

Not sure what the point of the chmod is, but whatever. I don't think
it's breaking anything.

> http://www.linuxfromscratch.org/blfs/view/7.4/general/python2.html This is 
> what I followed and which got me here.
>
> everything was successfully finished.
>
> afterwards when I type python in the terminal I get below error:
>
> python: error while loading shared libraries: libpython2.7.so.1.0: cannot 
> open shared object file: No such file or directory

What happens if you type "python2.6" or "python2.7"?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to change '\\' to '\'

2018-10-02 Thread Chris Angelico
On Wed, Oct 3, 2018 at 12:05 AM Dennis Lee Bieber  wrote:
>
> On Tue, 2 Oct 2018 10:17:27 +0800, Jach Fong 
> declaimed the following:
>
>
> >It was supposed that most discussant want to see the reply message
> >instantly when they open the mail. They already know what is going on
> >and no need to pass through all those previous message. "top posting"
> >seems more reasonable to me:-)
> >
>
> Such behavior reflects
> 1) personal (1 to 1) replies, where the recipient should already know the
> subject of the matter (having written it in the first place);

Which assumes that the recipient of your message has sent few enough
messages that s/he remembers the content of all of them. I don't know
about you, but that certainly isn't true of me. If you're replying to
anything more than a week old, I'm going to be looking at the quoted
context to see what I said.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: This thread is closed [an actual new thread]

2018-10-02 Thread Grant Edwards
On 2018-10-02, Rhodri James  wrote:
> On 02/10/18 01:02, Ethan Furman wrote:

> On what grounds are you suppressing debate?  It is exactly and precisely 
> not irrelevant to Python, since it's discussing a Python-specific change 
> to known and understood computing terminology, and frankly the statement

Agreed.

> "Continued considerate posts will be discarded" is outrageous.

Agreed.

> I have been unimpressed with the moderation team for some weeks now, but 
> this is just not acceptable.

Agreed.

-- 
Grant Edwards   grant.b.edwardsYow! The SAME WAVE keeps
  at   coming in and COLLAPSING
  gmail.comlike a rayon MUU-MUU ...

-- 
https://mail.python.org/mailman/listinfo/python-list


Error after installing python 2.7.5 on rhel6

2018-10-02 Thread Madushan Chathuranga
Hi All,

I'm a beginner on this. I tried to install python 2.7.5 on my rhel6 os. It 
already had installed 2.6.6. 

I downloaded the tar and unzipped it the executed below command.
./configure --prefix=/usr   \
--enable-shared \
--with-system-expat \
--with-system-ffi   \
--enable-unicode=ucs4 &&
make

afterwards,

sudo make install &&
sudo chmod -v 755 /usr/lib/libpython2.7.so.1.0

everything executed successfully. but after the installation I'm getting an 
error when I type python or python --version in the terminal.Below is the error 
I get. Does Anyone here know how to solve this? 

python: error while loading shared libraries: libpython2.7.so.1.0: cannot open 
shared object file: No such file or directory

>From my little knowledge I know instead of executing make install I should 
>have executed make altinstall 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python not working on RHEL6

2018-10-02 Thread Madushan Chathuranga
Hi,

when I type python2.6 terminal opens for python. So no issue on that. but when 
I type python2.7, python or any yum command It gives the error,
python: error while loading shared libraries: libpython2.7.so.1.0: cannot open 
shared object file: No such file or directory 

Thanks
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python not working on RHEL6

2018-10-02 Thread Chris Angelico
On Wed, Oct 3, 2018 at 12:20 AM Madushan Chathuranga
 wrote:
>
> Hi,
>
> when I type python2.6 terminal opens for python. So no issue on that. but 
> when I type python2.7, python or any yum command It gives the error,
> python: error while loading shared libraries: libpython2.7.so.1.0: cannot 
> open shared object file: No such file or directory

Okay. Check what "which python" and "which python2.6" do, and if
"which python2.7" is different. You may be able to manually recreate
your original /usr/bin/python (or whatever it is) from python2.6. That
would effectively undo the non-alt part of your install, and then you
can proceed to fix the actual installation. Hopefully.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: This thread is closed [an actual new thread]

2018-10-02 Thread Ian Kelly
On Tue, Oct 2, 2018 at 4:50 AM Rhodri James  wrote:
>
> On what grounds are you suppressing debate?  It is exactly and precisely
> not irrelevant to Python, since it's discussing a Python-specific change
> to known and understood computing terminology, and frankly the statement
> "Continued considerate posts will be discarded" is outrageous.

To be fair, it went four days without any posts before being closed,
so I'd say it was already dead at that point anyway.

> I have been unimpressed with the moderation team for some weeks now, but
> this is just not acceptable.

Note I'm not expressing an opinion on any specific decision by the
moderators, but I for one would like to welcome the more proactive
moderation being employed recently. This group, which was originally
unmoderated, at one time had a reputation for having a respectful and
welcoming community. To my experience, that has not been the case for
years now. Self-policing is no longer working when the self-appointed
police are among the greatest offenders, at the ready to declare
somebody a troll and therefore fair game at the slightest
disagreement. The archives contain piles upon pile of centithreads of
inane bickering on topics like "what is a variable, precisely" that
are no different than arguing about the number of angels that can
dance on the head of a pin. And while I haven't actually done it yet,
I can't count on one hand the number of times I've been disgusted by
the toxic tone so prevalent here and nearly unsubscribed.

Whether or not you think the moderators are doing a good job, there's
no doubt in my mind that moderation is sorely needed here and long
overdue.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python not working on RHEL6

2018-10-02 Thread Thomas Jollans
On 2018-10-02 15:59, mchathuran...@gmail.com wrote:
> Hi All,
> 
> I'm a beginner on this. I was trying to install a new python version which is 
> 2.7.5. My OS(RHEL6) had already installed version 2.6. so I downloaded the 
> tar and unzipped it then executed
>  
> ./configure --prefix=/usr   \
> --enable-shared \
> --with-system-expat \
> --with-system-ffi   \
> --enable-unicode=ucs4 &&
> make 
> 
> afterwards 
> sudo make install &&
> sudo chmod -v 755 /usr/lib/libpython2.7.so.1.0
> 
> http://www.linuxfromscratch.org/blfs/view/7.4/general/python2.html This is 
> what I followed and which got me here.
> 
> everything was successfully finished.
> 
> afterwards when I type python in the terminal I get below error: 
> 
> python: error while loading shared libraries: libpython2.7.so.1.0: cannot 
> open shared object file: No such file or directory

I have no idea what's going on, but in any case you should make sure
your /usr/bin/python works and points to the system python2.6.  Maybe
"sudo yum reinstall python" is the way to go. Then perhaps you should
delete all Python2.7 files and try again (preferably, not in /usr -
that's for OS-installed files only. /usr/local is a nice place to put
things you installed from source)

The in some sense "official" way to get Python 2.7 on an EL6 system is
to install it through the software collections mechanism:
https://www.softwarecollections.org/en/scls/rhscl/python27/

Better yet, forget about Python 2.7 and use Python 3.7 (or 3.6, which is
available as an SCL)


> 
> I guess from the little knowledge I have I should have executed altinstall 
> instead of install. Anyone know how to resolve this?
> 
> Thanks.
> 


-- 
Thomas Jollans

m ☎ +31 (6) 42630259
e ✉ t...@tjol.eu
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to achieve pyc only deployment for module in python3.6

2018-10-02 Thread Michael F. Stemper
On 2018-10-02 00:41, Chris Angelico wrote:
> On Tue, Oct 2, 2018 at 12:01 PM Chandana Pattanayak
>  wrote:

>> I have a requirement to provide basic code protection for a module in our
>> product suite. With python 3.6 the .pyc files are created under pycache ,
>> so if i remove the py file the module is not found anymore.
> 
> If you want code protection, the ONLY reliable way to do it is to not
> provide the code *at all*, in any form. That generally means hosting
> your application on some sort of server and granting access that way
> (eg through a web browser interface). Shipping only .pyc files does
> not protect your code - it merely obscures it a little.

I can support that.

Before retiring, I worked for a vendor of SCADA/EMS for large
electric utilities. Since our systems were responsible for
operating their critical infrastructure, NERC CIP[1] standards
required them to only obtain systems that underwent regular
security audits.

We sent one of our systems to the NSTB[2] for such an audit.
It included only executables, no source code. Yet, when the
NSTB sent us their report, they were able to say things like
"Lines x-y of .c have the following vulnerability."

Those guys were (are) *sharp*.


[1] 
[2]


-- 
Michael F. Stemper
Outside of a dog, a book is man's best friend.
Inside of a dog, it's too dark to read.
-- 
https://mail.python.org/mailman/listinfo/python-list


Querying MariaDB from python

2018-10-02 Thread Tony van der Hoff
I'm writing a database application, in python 3,5 under Debian9.

My code:

    def get_albums(self, parent_id = 0 ):
    cursor = self.cnx.cursor()
    sql =(  "select"
    "    id"
    ",   parent_id"
    ",   title"
    ",   ifnull( description, '' )"
    ",   path"
    ",   date( from_unixtime( date_created ) ) as date"
    " from album"
    " where parent_id = %(parent_id)s"
    " order by date_created"
 )
    cursor.execute( sql, {'parent_id': parent_id } )   
    rows = cursor.fetchall()

    # return result as a list of dicts
    result = []

    for row in rows:
    result.append({ 'id':row[0],
    'parent_id':row[1],
    'title':row[2],
    'description':row[3],
    'path':row[4],
    'date':row[5],
    }
    )
    return result

This works OK, but looks inelegant. Having to iterate through the
returned data to get it into a dictionary is error-prone if the query
changes. I would have expected the connector to be able to return a
dictionary.

Can anyone suggest a better way of doing this?
 

-- 
Tony van der Hoff| mailto:t...@vanderhoff.org
Buckinghamshire, England |

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Querying MariaDB from python

2018-10-02 Thread Larry Martell
On Tue, Oct 2, 2018 at 11:34 AM Tony van der Hoff  wrote:
>
> I'm writing a database application, in python 3,5 under Debian9.
>
> My code:
>
> def get_albums(self, parent_id = 0 ):
> cursor = self.cnx.cursor()
> sql =(  "select"
> "id"
> ",   parent_id"
> ",   title"
> ",   ifnull( description, '' )"
> ",   path"
> ",   date( from_unixtime( date_created ) ) as date"
> " from album"
> " where parent_id = %(parent_id)s"
> " order by date_created"
>  )
> cursor.execute( sql, {'parent_id': parent_id } )
> rows = cursor.fetchall()
>
> # return result as a list of dicts
> result = []
>
> for row in rows:
> result.append({ 'id':row[0],
> 'parent_id':row[1],
> 'title':row[2],
> 'description':row[3],
> 'path':row[4],
> 'date':row[5],
> }
> )
> return result
>
> This works OK, but looks inelegant. Having to iterate through the
> returned data to get it into a dictionary is error-prone if the query
> changes. I would have expected the connector to be able to return a
> dictionary.
>
> Can anyone suggest a better way of doing this?

https://pymysql.readthedocs.io/en/latest/modules/cursors.html#pymysql.cursors.DictCursor
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Querying MariaDB from python

2018-10-02 Thread Ervin Hegedüs
hi,

On Tue, Oct 02, 2018 at 04:14:45PM +0100, Tony van der Hoff wrote:
> I'm writing a database application, in python 3,5 under Debian9.
> 
> My code:
> 
>     def get_albums(self, parent_id = 0 ):
>     cursor = self.cnx.cursor()

  cursor = self.cnx.cursor(pymysql.cursors.DictCursor)

>     sql =(  "select"
>     "    id"
>     ",   parent_id"
>     ",   title"
>     ",   ifnull( description, '' )"
>     ",   path"
>     ",   date( from_unixtime( date_created ) ) as date"
>     " from album"
>     " where parent_id = %(parent_id)s"
>     " order by date_created"
>  )

  sql = ("""SELECT
  id,
  parent_id,
  ...
 """)

>     cursor.execute( sql, {'parent_id': parent_id } )   
>     rows = cursor.fetchall()

now rows will looks like this:
({'id':...,...},{'id':...,}...)


a.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to change '\\' to '\'

2018-10-02 Thread Michael Torrie
On 10/02/2018 12:48 AM, Ethan Furman wrote:
> Even for two-person, private email discussions I prefer the interleaved 
> replies -- in a week when I have to remind myself what was discussed it 
> is much easier to comprehend.

Absolutely. I've been saved from embarrassment countless times because
while editing the quote so I could respond to it point by point, I
realized I had misread the the original poster.

Top posting usually indicates that the person replying to my email never
really read it, and is just replying to what he thought I said or asked.
 Frustrating to no end.  This problem is endemic in corporate
communication.  Corporate email is completely nonfunctional as a means
of communication, largely because of the top posting culture.  Well
communication is a problem in general in corporations because of the
personalities that tend to gravitate towards the management end of
things. Top posting just makes the communication that much worse!

> Yes.  It is extremely annoying when someone top posts and leaves the 
> entire rest of the discussion still attached at the bottom.

Or when they bottom post without trimming, or even when they interleave
their responses without trimming.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Querying MariaDB from python

2018-10-02 Thread Tony van der Hoff
On 02/10/18 16:37, Larry Martell wrote:
> On Tue, Oct 2, 2018 at 11:34 AM Tony van der Hoff  
> wrote:
>>I would have expected the connector to be able to return a
>> dictionary.
>>
>> Can anyone suggest a better way of doing this?
> 
> https://pymysql.readthedocs.io/en/latest/modules/cursors.html#pymysql.cursors.DictCursor
> 
Well, thanks, Larry, for taking the trouble to reply, but I can't see
how that solves the issue.

-- 
Tony van der Hoff| mailto:t...@vanderhoff.org
Buckinghamshire, England |
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Querying MariaDB from python

2018-10-02 Thread Tony van der Hoff
On 02/10/18 16:47, Ervin Hegedüs wrote:
> hi,
> 
> now rows will looks like this:
> ({'id':...,...},{'id':...,}...)

Thanks Ervin, but:

   cursor = cnx.cursor(pymysql.cursors.DictCursor)
NameError: name 'pymysql' is not defined

I have been using the mysql.connector module, which seems to be the
"official" python interface. I hadn't spotted the pymysql module. Is the
consensus here that pymysql is the preferred connector?

Cheers,

-- 
Tony van der Hoff| mailto:t...@vanderhoff.org
Buckinghamshire, England |
-- 
https://mail.python.org/mailman/listinfo/python-list


Question about Multi-processing

2018-10-02 Thread Anthony Flury via Python-list
I decided to spend this morning to get my head around multi-processing, 
and decided to try to experiment initially in the command line 
interpreter, using the Python 3 documentation 



I fired up Python 3.6 and ran this :

   Python 3.6.6 (default, Sep 12 2018, 18:26:19)
   [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
   Type "help", "copyright", "credits" or "license" for more information.
>>> from multiprocessing import Pool
>>> def f(x):
   ... return x*2 + 1
   ...
>>> with Pool(10) as p:
   ...  print(p.map(f, range(1,100)))
   ...
   [3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
   39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71,
   73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103,
   105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129,
   131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155,
   157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181,
   183, 185, 187, 189, 191, 193, 195, 197, 199]

As you can see - it clearly worked as expected - queue a happy dance.

I continued to read the documentation and came to this quote :

   /Functionality within this package requires that the
   //|__main__|//module be importable by the children. This is covered
   in //Programming guidelines
   
//however
   it is worth pointing out here. This means that some examples, such
   as the //|multiprocessing.pool.Pool|
   
//examples
   will not work in the interactive interpreter./

The Documentation then gives a clear example very similar to mine :

   >>> from multiprocessing import Pool >>> p = Pool(5) >>> def f(x): ...
   return x*x ... >>> p.map(f, [1,2,3]) Process PoolWorker-1: Process
   PoolWorker-2: Process PoolWorker-3: Traceback (most recent call
   last): AttributeError: 'module' object has no attribute 'f'
   AttributeError: 'module' object has no attribute 'f' AttributeError:
   'module' object has no attribute 'f'

But when I run this exact example in the command line interpreter it 
works fine :


>>> p = Pool(5)
>>> def f(x):
   ... return x*x
   ...
>>> p.map(f,[1,2,3])
   [3, 5, 7]

Is the documentation wrong ? is something weird going on ?

--

Anthony Flury
*Email* : anthony.fl...@btinternet.com 
*Twitter* : @TonyFlury 
--
https://mail.python.org/mailman/listinfo/python-list


Re: Querying MariaDB from python

2018-10-02 Thread Larry Martell
On Tue, Oct 2, 2018 at 12:09 PM Tony van der Hoff  wrote:
>
> On 02/10/18 16:47, Ervin Hegedüs wrote:
> > hi,
> >
> > now rows will looks like this:
> > ({'id':...,...},{'id':...,}...)
>
> Thanks Ervin, but:
>
>cursor = cnx.cursor(pymysql.cursors.DictCursor)
> NameError: name 'pymysql' is not defined
>
> I have been using the mysql.connector module, which seems to be the
> "official" python interface.

That also supports the cursordict:

https://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlcursordict.html
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Querying MariaDB from python

2018-10-02 Thread Ervin Hegedüs
Hi Tony,

On Tue, Oct 02, 2018 at 05:07:38PM +0100, Tony van der Hoff wrote:
> On 02/10/18 16:47, Ervin Hegedüs wrote:
> > hi,
> > 
> > now rows will looks like this:
> > ({'id':...,...},{'id':...,}...)
> 
> Thanks Ervin, but:
> 
>cursor = cnx.cursor(pymysql.cursors.DictCursor)
> NameError: name 'pymysql' is not defined
> 
> I have been using the mysql.connector module, which seems to be the
> "official" python interface. I hadn't spotted the pymysql module. Is the
> consensus here that pymysql is the preferred connector?

well, since I'm using Python3, I didn't use "old" MySQLdb python
module, I switched to pymysql - but as I know they are
compatible, so you can use:

cnx.cursor(MySQLdb.cursors.DictCursor)

I don't know about "mysql.connector" module yet - but it doesn't
mean that it doesn't existst :)

hth,


a.

-- 
https://mail.python.org/mailman/listinfo/python-list


[SOLVED] Re: Querying MariaDB from python

2018-10-02 Thread Tony van der Hoff
On 02/10/18 17:13, Larry Martell wrote:
> On Tue, Oct 2, 2018 at 12:09 PM Tony van der Hoff  
> wrote:
>>
>> On 02/10/18 16:47, Ervin Hegedüs wrote:
>>> hi,
>>>
>>> now rows will looks like this:
>>> ({'id':...,...},{'id':...,}...)
>>
>> Thanks Ervin, but:
>>
>>cursor = cnx.cursor(pymysql.cursors.DictCursor)
>> NameError: name 'pymysql' is not defined
>>
>> I have been using the mysql.connector module, which seems to be the
>> "official" python interface.
> 
> That also supports the cursordict:
> 
> https://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlcursordict.html
> 

Great, thanks Larry, that sorts it.

-- 
Tony van der Hoff| mailto:t...@vanderhoff.org
Buckinghamshire, England |
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question about Multi-processing

2018-10-02 Thread Chris Angelico
On Wed, Oct 3, 2018 at 2:13 AM Anthony Flury via Python-list
 wrote:
> I continued to read the documentation and came to this quote :
>
> /Functionality within this package requires that the
> //|__main__|//module be importable by the children. This is covered
> in //Programming guidelines
> 
> //however
> it is worth pointing out here. This means that some examples, such
> as the //|multiprocessing.pool.Pool|
> 
> //examples
> will not work in the interactive interpreter./
>
> The Documentation then gives a clear example very similar to mine :
>
> But when I run this exact example in the command line interpreter it
> works fine :
>
> Is the documentation wrong ? is something weird going on ?
>

You're running it on Linux, and it can fork to create child processes.
If you were to run that on Windows, where forking isn't an option[1],
the creation of child processes would involve spinning up a new Python
process, importing main, and invoking the appropriate function from
there.

ChrisA
[1] AIUI, forking technically is possible on Windows, but it's not the
way things are done
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: This thread is closed [an actual new thread]

2018-10-02 Thread Ethan Furman

On 10/02/2018 03:46 AM, Rhodri James wrote:

On 02/10/18 01:02, Ethan Furman wrote:



It should be interpreted as:

- No further discussion should take place on this thread.
- I've done what I can with the primitive tools at hand to block
   any further discussion.
- Continued considerate posts will be discarded.
- Continued flame-bait/inconsiderate posts will be met with warnings
   or stronger as warranted.


On what grounds are you suppressing debate?  It is exactly and precisely 
not irrelevant to Python, since it's discussing a Python-specific change 
to known and understood computing terminology, and frankly the statement 
"Continued considerate posts will be discarded" is outrageous.


As soon as personal or group attacks start taking place (at least, as 
soon as such posts are noticed), that thread will be shut down.  As I 
said, the tools are primitive and more precise actions are not available.


I have been unimpressed with the moderation team for some weeks now, but 
this is just not acceptable.


I'm sorry you feel that way.  The goal is to have an environment where 
we can all help/be helped by others, primarily with Python.  Attacks on 
others do not help that [1].


--
~Ethan~
Python List Moderator
--
https://mail.python.org/mailman/listinfo/python-list


Re: python not working on RHEL6

2018-10-02 Thread Dan Purgert
Thomas Jollans wrote:
> [...] (preferably, not in /usr - that's for OS-installed files only.
> /usr/local is a nice place to put things you installed from source).

While I agree that /usr(/bin) is incorrect, I believe that "for
OS-installed files only" is taking it a bit far.

My (admittedly, dim) recollection of the FHS is that the /usr hierarchy
is for static[1] "user" binaries, libraries, and so on; while being
OS-agnostic (so long as that OS followed the FHS).  

[1] "Static" in terms of the relevant filesystem being able to be
mounted RO and not cause any undue headaches.  I don't believe that the
FHS writers ever meant to imply that executables and symlinks thereto
were to be immutable such that installation of new / upgrading of
existing software is rendered impossible.


-- 
|_|O|_| Registered Linux user #585947
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: 05CA 9A50 3F2E 1335 4DC5  4AEE 8E11 DDF3 1279 A281
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Replacing : with "${" at the beginning of the word and adding "}" at the end of the word

2018-10-02 Thread MRAB

On 2018-10-02 14:04, zljubi...@gmail.com wrote:

I have to execute the same sql in two different programs.
Each of them marks parameters differently.

Anyway, I have found the solution.

cnv_sel = re.sub(r"(:(.+?)\b)", r"${\2}", sel)


A slightly better solution would be:

cnv_sel = re.sub(r":(\w+)", r"${\1}", sel)
--
https://mail.python.org/mailman/listinfo/python-list


Re: Querying MariaDB from python

2018-10-02 Thread Thomas Jollans
On 2018-10-02 18:07, Tony van der Hoff wrote:
> On 02/10/18 16:47, Ervin Hegedüs wrote:
>> hi,
>>
>> now rows will looks like this:
>> ({'id':...,...},{'id':...,}...)
> 
> Thanks Ervin, but:
> 
>cursor = cnx.cursor(pymysql.cursors.DictCursor)
> NameError: name 'pymysql' is not defined
> 
> I have been using the mysql.connector module, which seems to be the
> "official" python interface. I hadn't spotted the pymysql module. Is the
> consensus here that pymysql is the preferred connector?

I don't know, but it appears to be (the?) one that solves your problem.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: So apparently I've been banned from this list

2018-10-02 Thread Roel Schroeven

Jon Ribbens schreef op 2/10/2018 om 1:20:

On 2018-10-01, Roel Schroeven  wrote:

I'm not very active here, but I've been lurking for years. In my eyes
Steven has always been active and helpful. Now he has *once* been a
*tiny bit* rude, and he's banned for that?


It's not "once", it's a long-standing pattern of behaviour.


Are we talking about the same Steven D'Aprano? I must have somehow 
selectively missed a lot of posts, because from the posts I have seen, I 
can see nothing wrong with Steven's behaviour.



--
"Honest criticism is hard to take, particularly from a relative, a
friend, an acquaintance, or a stranger."
-- Franklin P. Jones

Roel Schroeven

--
https://mail.python.org/mailman/listinfo/python-list


Re: python not working on RHEL6

2018-10-02 Thread Thomas Jollans

On 02/10/2018 19:22, Dan Purgert wrote:

Thomas Jollans wrote:

[...] (preferably, not in /usr - that's for OS-installed files only.
/usr/local is a nice place to put things you installed from source).


While I agree that /usr(/bin) is incorrect, I believe that "for
OS-installed files only" is taking it a bit far.

My (admittedly, dim) recollection of the FHS is that the /usr hierarchy
is for static[1] "user" binaries, libraries, and so on; while being
OS-agnostic (so long as that OS followed the FHS).

[1] "Static" in terms of the relevant filesystem being able to be
mounted RO and not cause any undue headaches.  I don't believe that the
FHS writers ever meant to imply that executables and symlinks thereto
were to be immutable such that installation of new / upgrading of
existing software is rendered impossible.



You're not wrong, but there's still a fairly strong convention that 
/usr/{bin,lib*,share,include} are only populated by (in some sense) 
non-essential components of the OS only, with varying definitions of 
"the OS". On Linux, this tends to mean "everything managed by the 
package manager", while on *BSD, it tends to exclude extra packages and 
ports collection.


Whether we agree on the terminology here or not, of course we can agree 
that you have to be bloody careful if you *do* decide to put things in 
/usr/bin yourself :-)



-- Thomas
--
https://mail.python.org/mailman/listinfo/python-list


Re: python not working on RHEL6

2018-10-02 Thread Chris Angelico
On Wed, Oct 3, 2018 at 5:17 AM Thomas Jollans  wrote:
>
> On 02/10/2018 19:22, Dan Purgert wrote:
> > Thomas Jollans wrote:
> >> [...] (preferably, not in /usr - that's for OS-installed files only.
> >> /usr/local is a nice place to put things you installed from source).
> >
> > While I agree that /usr(/bin) is incorrect, I believe that "for
> > OS-installed files only" is taking it a bit far.
> >
> > My (admittedly, dim) recollection of the FHS is that the /usr hierarchy
> > is for static[1] "user" binaries, libraries, and so on; while being
> > OS-agnostic (so long as that OS followed the FHS).
> >
> > [1] "Static" in terms of the relevant filesystem being able to be
> > mounted RO and not cause any undue headaches.  I don't believe that the
> > FHS writers ever meant to imply that executables and symlinks thereto
> > were to be immutable such that installation of new / upgrading of
> > existing software is rendered impossible.
> >
>
> You're not wrong, but there's still a fairly strong convention that
> /usr/{bin,lib*,share,include} are only populated by (in some sense)
> non-essential components of the OS only, with varying definitions of
> "the OS". On Linux, this tends to mean "everything managed by the
> package manager", while on *BSD, it tends to exclude extra packages and
> ports collection.
>
> Whether we agree on the terminology here or not, of course we can agree
> that you have to be bloody careful if you *do* decide to put things in
> /usr/bin yourself :-)

As a general rule, it's safe to get a *different* version of Python
and do a "make altinstall" (which the OP agrees was the original
intention). Whether that lands in /usr/bin or /usr/local/bin doesn't
actually make a difference - what matters is the $PATH and which
command you get when you type "python" or "python2" or "python3". On
my system (Debian GNU/Linux), /usr/local/bin is ahead of /usr/bin in
$PATH, so even installing into local isn't going to protect you. It
will quite probably protect system tools (since they should be
explicitly calling on /usr/bin/python2.6 or similar), but could well
mess up manual usage from the shell.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Creating Win .exe file from *.py on Linux

2018-10-02 Thread John Doe
Hello World

Is it possible to create on Linux win .exe file from *.py file?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Creating Win .exe file from *.py on Linux

2018-10-02 Thread Grant Edwards
On 2018-10-02, John Doe  wrote:
> Hello World
>
> Is it possible to create on Linux win .exe file from *.py file?

Yes... if you run on Linux a VM instance that's running Windows?

-- 
Grant Edwards   grant.b.edwardsYow! Do you guys know we
  at   just passed thru a BLACK
  gmail.comHOLE in space?

-- 
https://mail.python.org/mailman/listinfo/python-list


Program to find Primes of the form prime(n+2) * prime(n+1) - prime(n) +- 1.

2018-10-02 Thread Musatov
 Primes of the form prime(n+2) * prime(n+1) - prime(n) +- 1.
DATA

31, 71, 73, 137, 211, 311, 419, 421, 647, 877, 1117, 1487, 1979, 2447, 3079, 
3547, 4027, 7307, 7309, 12211, 14243, 18911, 18913, 23557, 25439, 28729, 36683, 
37831, 46853, 50411, 53129, 55457, 57367, 60251, 67339, 70489, 74797, 89669, 
98909, 98911

EXAMPLE 

7*5 - 3 - 1 = 31

11*7 - 5 - 1 = 71

11*7 - 5 + 1 = 73

13*11 - 7 + 1 = 137 

Can someone put this in a Python program and post?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: So apparently I've been banned from this list

2018-10-02 Thread Mark Lawrence

On 02/10/18 19:11, Roel Schroeven wrote:

Jon Ribbens schreef op 2/10/2018 om 1:20:

On 2018-10-01, Roel Schroeven  wrote:

I'm not very active here, but I've been lurking for years. In my eyes
Steven has always been active and helpful. Now he has *once* been a
*tiny bit* rude, and he's banned for that?


It's not "once", it's a long-standing pattern of behaviour.


Are we talking about the same Steven D'Aprano? I must have somehow 
selectively missed a lot of posts, because from the posts I have seen, I 
can see nothing wrong with Steven's behaviour.





I fully support Steven D'Aprano.  This disgraceful behaviour by the 
moderators has been perpetuated by Ethan Thurman who doesn't have the 
guts to say things online but has instead sent me a message to my 
personal inbox.  Please can we get rid of this useless moron?


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: So apparently I've been banned from this list

2018-10-02 Thread Ethan Furman

On 10/02/2018 02:24 PM, Mark Lawrence wrote:

I fully support Steven D'Aprano.  This disgraceful behaviour by the 
moderators has been perpetuated by Ethan Thurman who doesn't have the 
guts to say things online but has instead sent me a message to my 
personal inbox.  Please can we get rid of this useless moron?


Personal attacks will not be tolerated against anybody, myself included.

Your posts will be barred from Python List for the rest of the year. 
After that you may petition the moderators to regain access.


--
~Ethan~
Python List Moderator
--
https://mail.python.org/mailman/listinfo/python-list


Re: Program to find Primes of the form prime(n+2) * prime(n+1) - prime(n) +- 1.

2018-10-02 Thread Bob Gailer
On Oct 2, 2018 4:59 PM, "Musatov"  wrote:
>
>  Primes of the form prime(n+2) * prime(n+1) - prime(n) +- 1.
> DATA
>
> 31, 71, 73, 137, 211, 311, 419, 421, 647, 877, 1117, 1487, 1979, 2447,
3079, 3547, 4027, 7307, 7309, 12211, 14243, 18911, 18913, 23557, 25439,
28729, 36683, 37831, 46853, 50411, 53129, 55457, 57367, 60251, 67339,
70489, 74797, 89669, 98909, 98911
>
> EXAMPLE
>
> 7*5 - 3 - 1 = 31
>
> 11*7 - 5 - 1 = 71
>
> 11*7 - 5 + 1 = 73
>
> 13*11 - 7 + 1 = 137
>
> Can someone put this in a Python program and post?

It is our policy to not write code at others requests. We are glad to help
if you've started writing a program and are stuck.

Out of curiosity where does this request come from?

If you want to hire one of us to write the program, in other words pay us
for our time and expertise, that's a different matter. We would be happy to
comply.
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Program to find Primes of the form prime(n+2) * prime(n+1) - prime(n) +- 1.

2018-10-02 Thread Max Zettlmeißl via Python-list
On Tue, Oct 2, 2018 at 10:23 PM, Musatov  wrote:
>  Primes of the form prime(n+2) * prime(n+1) - prime(n) +- 1.
> DATA
>
> 31, 71, 73, 137, 211, 311, 419, 421, 647, 877, 1117, 1487, 1979, 2447, 3079, 
> 3547, 4027, 7307, 7309, 12211, 14243, 18911, 18913, 23557, 25439, 28729, 
> 36683, 37831, 46853, 50411, 53129, 55457, 57367, 60251, 67339, 70489, 74797, 
> 89669, 98909, 98911
>
> EXAMPLE
>
> 7*5 - 3 - 1 = 31
>
> 11*7 - 5 - 1 = 71
>
> 11*7 - 5 + 1 = 73
>
> 13*11 - 7 + 1 = 137
>
> Can someone put this in a Python program and post?
>

Here you go, my friend:

#!/usr/bin/env python3

primes = """Primes of the form prime(n+2) * prime(n+1) - prime(n) +- 1.
DATA

31, 71, 73, 137, 211, 311, 419, 421, 647, 877, 1117, 1487, 1979, 2447, 3079, 35\
47, 4027, 7307, 7309, 12211, 14243, 18911, 18913, 23557, 25439, 28729, 36683, 3\
7831, 46853, 50411, 53129, 55457, 57367, 60251, 67339, 70489, 74797, 89669, 989\
09, 98911

EXAMPLE

7*5 - 3 - 1 = 31

11*7 - 5 - 1 = 71

11*7 - 5 + 1 = 73

13*11 - 7 + 1 = 137 """

if __name__ == "__main__":
print(primes)


As soon as you start showing more effort yourself in the form of your
honest attempts to create a program or at least in the form of some
serious ideas, you might get replies which better fit what you
attempted to receive.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Program to find Primes of the form prime(n+2) * prime(n+1) - prime(n) +- 1.

2018-10-02 Thread Martin Musatov
I am drafting a sequence for OEIS.

I was told Python was most accesible for beginners.

On Tue, Oct 2, 2018, 4:48 PM Bob Gailer  wrote:

> On Oct 2, 2018 4:59 PM, "Musatov"  wrote:
> >
> >  Primes of the form prime(n+2) * prime(n+1) - prime(n) +- 1.
> > DATA
> >
> > 31, 71, 73, 137, 211, 311, 419, 421, 647, 877, 1117, 1487, 1979, 2447,
> 3079, 3547, 4027, 7307, 7309, 12211, 14243, 18911, 18913, 23557, 25439,
> 28729, 36683, 37831, 46853, 50411, 53129, 55457, 57367, 60251, 67339,
> 70489, 74797, 89669, 98909, 98911
> >
> > EXAMPLE
> >
> > 7*5 - 3 - 1 = 31
> >
> > 11*7 - 5 - 1 = 71
> >
> > 11*7 - 5 + 1 = 73
> >
> > 13*11 - 7 + 1 = 137
> >
> > Can someone put this in a Python program and post?
>
> It is our policy to not write code at others requests. We are glad to help
> if you've started writing a program and are stuck.
>
> Out of curiosity where does this request come from?
>
> If you want to hire one of us to write the program, in other words pay us
> for our time and expertise, that's a different matter. We would be happy to
> comply.
> > --
> > https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Replacing : with "${" at the beginning of the word and adding "}" at the end of the word

2018-10-02 Thread Cameron Simpson

On 02Oct2018 06:04, zljubi...@gmail.com  wrote:

I have to execute the same sql in two different programs.
Each of them marks parameters differently.


Then you are MUCH better off assembling the SQL using come kind of query 
constructor, which correctly inserts parameter placeholders is the correct 
dialogue.



Anyway, I have found the solution.
cnv_sel = re.sub(r"(:(.+?)\b)", r"${\2}", sel)


That is a recipe for making unsafe SQL. It does not honour quotes. It does not 
ensure parameter names are identifiers (which may be vital).


Please look into a library for constructing SQL. My favourite general purpose 
one is SQLAlchemy, which lets you write very nice Python expressions which get 
turned safely into dialect specific SQL.


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: Program to find Primes of the form prime(n+2) * prime(n+1) - prime(n) +- 1.

2018-10-02 Thread Gary Herron

On 10/02/2018 01:23 PM, tomusa...@gmail.com wrote:

  Primes of the form prime(n+2) * prime(n+1) - prime(n) +- 1.
DATA

31, 71, 73, 137, 211, 311, 419, 421, 647, 877, 1117, 1487, 1979, 2447, 3079, 
3547, 4027, 7307, 7309, 12211, 14243, 18911, 18913, 23557, 25439, 28729, 36683, 
37831, 46853, 50411, 53129, 55457, 57367, 60251, 67339, 70489, 74797, 89669, 
98909, 98911

EXAMPLE 

7*5 - 3 - 1 = 31

11*7 - 5 - 1 = 71

11*7 - 5 + 1 = 73

13*11 - 7 + 1 = 137

Can someone put this in a Python program and post?



No, sorry, but that's not how this works.  We're not here to do your 
homework for you, and you won't learn anything if we do.  You make an 
attempt at solving this, asking any specific Python related questions 
you need help with, and you'll find this to be prompt, friendly, and 
helpful group.



Gary Herron


--
Dr. Gary Herron
Professor of Computer Science
DigiPen Institute of Technology
(425) 895-4418


--
https://mail.python.org/mailman/listinfo/python-list


Re: Re : So apparently I've been banned from this list

2018-10-02 Thread Ethan Furman

On 10/02/2018 03:40 PM, armand.fouca...@telecom-bretagne.eu wrote:


Hello there, I'm quite new here.


Welcome!


I'm sorry to interfere, but this thread is only creating noise on this list.


You are correct.  This thread is now closed.


Is there a place where such topics can be debated, other than the common ML?
On StackOverflow, we would take this to Meta; do we have our Meta?


Sadly, there is not, and we do not.

--
~Ethan~
Python List Moderator
--
https://mail.python.org/mailman/listinfo/python-list


Re: This thread is closed [an actual new thread]

2018-10-02 Thread Ben Finney
Ethan Furman  writes:

> On 10/01/2018 04:26 PM, Ben Finney wrote:
> > If there is some specific formal meaning to the above statement, I
> > don't know where it's documented. If it's not a specific formal
> > statement, that is itself troubling, because it's not clear what
> > would constitute a violation nor what the consequences are.
>
> Consider it now documented, at least on Python List. I imagine Python
> Ideas may also implement this framework (assuming we stay on Mail Man
> and don't migrate to some web-based forum).

Thank you.

I don't want to imply an obligation for others, but I suggest it will be
(beyond the short term) less painful for future thread-closing actions
if that is documented in an official document at a known web page URL.
So every time a moderator closes a thread, the message announcing that
action can simply say "see  for what this means".

-- 
 \   “Drop your trousers here for best results.” —dry cleaner, |
  `\   Bangkok |
_o__)  |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Creating Win .exe file from *.py on Linux

2018-10-02 Thread William Ray Wing via Python-list


> On Oct 2, 2018, at 3:03 PM, John Doe  wrote:
> 
> Hello World
> 
> Is it possible to create on Linux win .exe file from *.py file?
> -- 
> https://mail.python.org/mailman/listinfo/python-list

As was pointed out here a day or so ago, the answer is yes, but it is a two 
step process.  First step is to use Cython to compile the python file to C 
source, then compile that to a binary executable.  The link given was:


https://medium.com/@xpl/protecting-python-sources-using-cython-dcd940bb188e 

Where the focus is keeping the python source away from prying eyes, but it 
generates exactly what you want.

Bill
-- 
https://mail.python.org/mailman/listinfo/python-list