Re: Is there a Windows Python SIG?

2015-10-08 Thread Laura Creighton
In a message of Thu, 08 Oct 2015 00:15:26 -0500, Anthony Papillion writes:
>-BEGIN PGP SIGNED MESSAGE-
>Hash: SHA512
>
>Over the next few months,  I'll be working on a project using Python on 
>Microsoft Windows.  While I'm doing this project, I'd also like to contribute 
>in any way I can to making Python in Windows better.
>
>Does anyone know if there is a Windows SIG? I went to the Python website where 
>I thought I'd seen one but it doesn't seem to be there now. Any thoughts?
>
>Anthony

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

Speaking as (a) webmaster, a page that tells windows users how to 
have more than one Python version on your machine; how to use
virtualenv after you have multiple Python versions, and how
to find out which versions of Python you already have would have
significant value.

Laura



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


Re: python3.5 + reportlab + windows again

2015-10-08 Thread Robin Becker

On 06/10/2015 16:31, Robin Becker wrote:
.


well it seems someone can build these extensions properly. I used Christoph
Gohlke's reportlab build and although there are 3 failures in the latest tests I
don't see any crashes etc etc and all the failures are explainable. Last thing I
saw from him in respect of pyRXPU was to use extra_compile_args=['/Od']. I will
try that in the reportlab extension builds and see if the problems go away.


I figured out the problem I was having with windows vs python3.5. It seems that 
something has changed in the way extensions are loaded when using imp to 
override the normal import mechanism.


The following code works OK for python 2.7, 3.3 & 3.4, but fails fairly 
catastrophically when used in a complex way (ie running reportlab's tests). 
Simple usage appears to work ie when I run one test.



My extension loading code looks like this

##
def __hack__():
import sys, os, importlib, imp
if sys.modules['reportlab'].__path__[0].lower()!=r'c:\code\reportlab': 
return
from distutils.util import get_platform

archname = get_platform()

_p0=r'c:\repos\reportlab\build\lib.%s-%d.%d' % 
(archname,sys.version_info[0],sys.version_info[1])
_p1=r'c:\repos\pyRXP\build\lib.%s-%d.%d' % 
(archname,sys.version_info[0],sys.version_info[1])

_overrides={
'reportlab.lib._rl_accel':os.path.join(_p0,r'reportlab\lib'),

'reportlab.graphics._renderPM':os.path.join(_p0,r'reportlab\graphics'),
'pyRXPU':_p1,
}
def find_override(name):
if name in _overrides and os.path.isdir(_overrides[name]):
fpd = imp.find_module(name.split('.')[-1],[_overrides[name]])
try:
try:
return imp.load_module(name,fpd[0],fpd[1],fpd[2])
except:
pass
finally:
if fpd[0]: fpd[0].close()

class RLImporter(object):
def __init__(self):
self.module = None

def find_module(self, name, path=None):
m = find_override(name)
if m:
m.__loader__ = self
self.module = m
return self

def load_module(self, name):
if not self.module:
raise ImportError("Unable to load module %s" % name)
sys.modules[name] = m = self.module
self.module = None
return m
sys.meta_path.insert(0, RLImporter())
__hack__()
del __hack__
##

My guess is that it's not cool any more to use imp.load_module repeatedly or 
that the hack of passing the found module about using a temporary attribute is 
not a good idea.



The intent of the above code is to allow me to build extensions for multiple 
pythons in a single area under c:\repos\reportlab\build and allow loading of 
those with different python versions. I don't want to pollute my repository with 
different extensions so prefer to keep them in the build area (and they change 
very slowly compared to the python code).


Is there some simple sample code that can be used as a model for this. I've 
tried looking at the importlib docs and my brain is bursting. I also looked at
http://chimera.labs.oreilly.com/books/123000393/ch10.html, but that seems 
all about normal python models/packages.


I think importlib has split the loading of extensions into a different method, 
and there seem to be assertions about re-using an existing loader.

--
Robin Becker

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


libevent-python

2015-10-08 Thread [email protected]

hi:
   I use libevent-python package currently. I read the file 
eventmodule.c, but I can not understand the function:


  static EventObject *EventBase_CreateEvent(EventBaseObject *self, 
PyObject *args, PyObject *kwargs)

 {
   EventObject *newEvent = NULL;

   newEvent = (EventObject *)Event_New(&Event_Type,NULL,NULL);

   if (Event_Init(newEvent, args, kwargs) < 0){
 return NULL;
   }

   if (PyObject_CallMethod((PyObject *)newEvent, "setEventBase", "O", 
self) == NULL){

 return NULL;
   }

   return newEvent;
 }

 So, I can not know the param "EventBaseObject *self" is what?  And I 
read the examples/echo_server.py file, I read the follow source:

   class BaseConnection(object):
bufferSize = 2**16
def __init__(self, sock, addr, server):
self.sock = sock
self.addr = addr
self.server = server
self.sock.setblocking(False)
self.buf = []
self.readEvent = libevent.createEvent(
self.sock,libevent.EV_READ|libevent.EV_PERSIST, self._doRead)
self.writeEvent = libevent.createEvent(
self.sock,libevent.EV_WRITE, self._doWrite)
self.startReading()
 So, I can not see pass the self parameter. Is anybody know this?

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


Re: change data in large excel file(more than 240 000 rows on sheet)

2015-10-08 Thread gall . pavgal . gall
thanks Guys!
xlrd it's cool, but i need change existing file, which contains some sheets 
with large data...)
So, if i use xlwt(i.e. create new excel document), i will lose data from other 
sheets.
I tried use openpyxl, but got error :

Traceback (most recent call last):
  File "D:/WebPython/oneMoreTest.py", line 15, in 
wb = load_workbook(filename='D:\WebPython\COX.DSG.Offering Product Catalog 
VANE.xlsx')
  File "C:\Python27\lib\site-packages\openpyxl\reader\excel.py", line 149, in 
load_workbook
_load_workbook(wb, archive, filename, read_only, keep_vba)
  File "C:\Python27\lib\site-packages\openpyxl\reader\excel.py", line 236, in 
_load_workbook
color_index=wb._colors)
  File "C:\Python27\lib\site-packages\openpyxl\reader\worksheet.py", line 327, 
in read_worksheet
fast_parse(ws, xml_source, shared_strings, style_table, color_index)
  File "C:\Python27\lib\site-packages\openpyxl\reader\worksheet.py", line 315, 
in fast_parse
parser.parse()
  File "C:\Python27\lib\site-packages\openpyxl\reader\worksheet.py", line 88, 
in parse
stream = _get_xml_iter(self.source)
  File "C:\Python27\lib\site-packages\openpyxl\reader\worksheet.py", line 36, 
in _get_xml_iter
xml_source = xml_source.encode("utf-8")
MemoryError
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: reg multiple login python

2015-10-08 Thread harirammanohar159
On Thursday, 1 October 2015 12:35:01 UTC+5:30, [email protected]  wrote:
> Hi All,
> 
> Is there anyway i can login to remote servers at once and do the activity, i 
> can do one by one using for loop..
> 
> Thanks in advance.

if its a command i can launch a detached process for each request, its a 
session..
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: change data in large excel file(more than 240 000 rows on sheet)

2015-10-08 Thread Laura Creighton
You need to use the optimised reader.
https://openpyxl.readthedocs.org/en/latest/optimized.html

Laura

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


Re: Hiding code from intruders, a different slant on an old question

2015-10-08 Thread cl
Dennis Lee Bieber  wrote:
> On Wed, 7 Oct 2015 13:05:07 + (UTC), alister
>  declaimed the following:
> 
> 
> >With a simple Cesar the method is "shift the alphabet by 'X' characters 
> >and X is the key
> >
> >if the key is unknown then the attacker still has to brute force the 
> >method (admittedly with only 25 options this is not difficult)
> 
> But who'd consider that with just one-case and alphabet only...
> 
> At the least include upper, lower, numbers, and basic punctuation --
> that will add a few more cycles of computation time to break 
> 
> 
> But the other point, yes... The most used encryption systems have
> publicly known/reviewed algorithms and rely on the secrecy of the key(s).

Which makes a nonsense of using a super-secure algorithm in many cases.

If you are doing in-place symmetric file encryption then it's the
security of the key hashing algorithm that matters much more than the
actual encryption used on the file.

Using ccrypt, enc, etc. for file encryption means the password that
encodes the encryption key is saved with the file so brute-force
attacks to get the key are quite straightforward.

-- 
Chris Green
·
-- 
https://mail.python.org/mailman/listinfo/python-list


Installation problem

2015-10-08 Thread MICHAEL
Hello, 

Please forgive a new user's ignorance. 

I am trying to install Python 3.5.0 on my laptop (Windows 10). The default 
installation directory is shown as c:\Users\(my user 
name)\AppData\Local\Programs\Python\Python35-32. However, if I select Custom 
Install then the default installation directory is c:\Program 
Files(x86)\Python3.5. 

In either case, after the installation is complete I cannot find a Python3.5 
directory under Program Files(x86) or the Users\... directory. The python.exe 
file can be located under c:\OpenOffice. Other python files are found scattered 
all over my hard drive in locations such as c:\ HamRadio\WSJT, or c:\Program 
Files(x86)\Cyberlink, or c:\CHIRP, or a variety of other directories, but never 
in the designated installation directory. 

Scattered files include: 
python.exe (in Open Office) 
python27.dll (in CHIRP) 
pythoncom27.dll (in CHIRP) 
python33.dll (in HamRadio\WSJT) 
python25.dll (in "Koan c:\Program Files(x86)\Cyberlink) 

I assume these various .dll files are used in the various other programs I have 
installed but I cannot understand, at the moment, why the main python program 
does not appear in the designated installation directory. 

Any ideas or suggestion you may have are most welcome and appreciated. 

Thanks very much, 
Mike Wolcott 

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


Planet Scipy blog

2015-10-08 Thread beliavsky--- via Python-list
There used to be a blog about SciPy at https://planet.scipy.org/ , discussing 
the applications of Python to scientific computing. Now there is a static page 
about "MPI for Python". What happened?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Installation problem

2015-10-08 Thread Tim Golden
On 08/10/2015 14:25, MICHAEL wrote:
> Hello,
> 
> Please forgive a new user's ignorance.
> 
> I am trying to install Python 3.5.0 on my laptop (Windows 10). The
> default installation directory is shown as c:\Users\(my user
> name)\AppData\Local\Programs\Python\Python35-32. However, if I select
> Custom Install then the default installation directory is c:\Program
> Files(x86)\Python3.5.
> 
> In either case, after the installation is complete I cannot find a
> Python3.5 directory under Program Files(x86) or the Users\... directory.

Mike,

What happens if you do [Windows] + R (ie Start > Run), enter "python"
and click OK?

If it comes up with a Python window, what happens if you type this:

import sys
print(sys.executable)

You can do all this in one step if you're feeling adventurous:

Start > Run > python -i -c "import sys; print(sys.executable)"

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


ANN: Wing IDE 5.1.8 released

2015-10-08 Thread Wingware

Hi,

Wingware has released version 5.1.8 of Wing IDE, our cross-platform 
integrated development environment for the Python programming language.


Wing IDE features a professional code editor with vi, emacs, visual 
studio, and other key bindings, auto-completion, call tips, 
context-sensitive auto-editing, goto-definition, find uses, refactoring, 
a powerful debugger, version control, unit testing, search, project 
management, and many other features.


This release includes the following improvements:

Support for Python 3.5 final release
New option to specify how to run test files in package directories
Improved performance of Open from Project for large projects
Several improvements in the pytest integration
Fix displaying multiple plots with the Mac OS X backend for matplotlib
Fix auto-spacing around - and + in exponents
Don't jump back to last stop position when restarting debugging
Don't expand folds on edited lines unless the fold point is removed
About 30 other improvements

For details see http://wingware.com/news/2015-10-05 and 
http://wingware.com/pub/wingide/5.1.8/CHANGELOG.txt


What's New in Wing 5.1:

Wing IDE 5.1 adds multi-process and child process debugging, syntax 
highlighting in the shells, support for pytest, Find Symbol in Project, 
persistent time-stamped unit test results, auto-conversion of indents on 
paste, an XCode keyboard personality, support for Flask, Django 1.7 and 
1.8, Python 3.5 and recent Google App Engine versions, improved 
auto-completion for PyQt, recursive snippet invocation, and many other 
minor features and improvements.


Free trial: http://wingware.com/wingide/trial
Downloads: http://wingware.com/downloads
Feature list: http://wingware.com/wingide/features
Sales: http://wingware.com/store/purchase
Upgrades: https://wingware.com/store/upgrade

Questions?  Don't hesitate to email us at [email protected].

Thanks,

--

Stephan Deibel
Wingware | Python IDE

The Intelligent Development Environment for Python Programmers

wingware.com


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


When tornado 4.3 will be available at pypi?

2015-10-08 Thread Nagy László Zsolt
I would like to use async/await. The tornado latest documentation says
it is possible with tornado 4.3 and later:

http://tornadokevinlee.readthedocs.org/en/latest/guide/coroutines.html

However, it is not available yet.

c:\Python\Projects>pip3 install tornado -U
Requirement already up-to-date: tornado in c:\python35\lib\site-packages

c:\Python\Projects>py -3
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tornado
>>> print(tornado.version)
4.2.1


Thanks,

   Laszlo

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


Re: Planet Scipy blog

2015-10-08 Thread Mark Lawrence

On 08/10/2015 14:39, beliavsky--- via Python-list wrote:

There used to be a blog about SciPy at https://planet.scipy.org/ , discussing the 
applications of Python to scientific computing. Now there is a static page about 
"MPI for Python". What happened?



Presumably http://www.scipy.org/

--
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: Planet Scipy blog

2015-10-08 Thread Laura Creighton
In a message of Thu, 08 Oct 2015 15:10:21 +0100, Mark Lawrence writes:
>On 08/10/2015 14:39, beliavsky--- via Python-list wrote:
>> There used to be a blog about SciPy at https://planet.scipy.org/ , 
>> discussing the applications of Python to scientific computing. Now there is 
>> a static page about "MPI for Python". What happened?
>>
>
>Presumably http://www.scipy.org/
>
>-- 
>My fellow Pythonistas, ask not what our language can do for you, ask
>what you can do for our language.
>
>Mark Lawrence

No, all the blog links there go to the MPI for Python link, too.

Laura

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


Re: Installation problem

2015-10-08 Thread paul.hermeneutic
On Oct 8, 2015 7:31 AM, "MICHAEL"  wrote:
>
> Hello,
>
> Please forgive a new user's ignorance.
>
> I am trying to install Python 3.5.0 on my laptop (Windows 10). The
default installation directory is shown as c:\Users\(my user
name)\AppData\Local\Programs\Python\Python35-32. However, if I select
Custom Install then the default installation directory is c:\Program
Files(x86)\Python3.5.
>

I would like to see Python in use as much as anyone. However, I am not sure
we are doing users or ourselves much of a favor encouraging pieces of the
language be distributed in so many kits.

I do not know, but it does not seem that Java has much of this problem.
Everyone seems to know that Java should be installed on the system. There
is a clear way to have multiple versions of Java on one system.

There would be benefits in having a well structured way to do it. I am not
suggesting that other ways should be prohibited.

This approach would fit well with the Python maxim to pick one really good
way to do it.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Hiding code from intruders, a different slant on an old question

2015-10-08 Thread Ian Kelly
On Wed, Oct 7, 2015 at 6:01 PM, Dennis Lee Bieber  wrote:
> On Wed, 7 Oct 2015 13:05:07 + (UTC), alister
>  declaimed the following:
>
>
>>With a simple Cesar the method is "shift the alphabet by 'X' characters
>>and X is the key
>>
>>if the key is unknown then the attacker still has to brute force the
>>method (admittedly with only 25 options this is not difficult)
>
> But who'd consider that with just one-case and alphabet only...
>
> At the least include upper, lower, numbers, and basic punctuation --
> that will add a few more cycles of computation time to break 

It doesn't really matter how much you add; any Caesar cipher is going
to fall easily to just a little bit of frequency analysis. Consider an
extreme case, where the range of X is the size of the entire Unicode
character set. If the message is written in a Latin-based character
set, chances are good that the majority of the characters will fall
within a range of <96, giving the attacker a great starting point to
brute-force from.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Installation problem

2015-10-08 Thread Tim Golden
On 08/10/2015 14:25, MICHAEL wrote:
> Hello,
> 
> Please forgive a new user's ignorance.
> 
> I am trying to install Python 3.5.0 on my laptop (Windows 10). The
> default installation directory is shown as c:\Users\(my user
> name)\AppData\Local\Programs\Python\Python35-32. However, if I select
> Custom Install then the default installation directory is c:\Program
> Files(x86)\Python3.5.
> 
> In either case, after the installation is complete I cannot find a
> Python3.5 directory under Program Files(x86) or the Users\... directory.

OP reports off-list that the installation now appears to have been
successful. (I'm not clear whether as the result of a re-install or
simply finding the .exe)

TJG

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


Re: Installation problem

2015-10-08 Thread Chris Angelico
On Fri, Oct 9, 2015 at 12:25 AM, MICHAEL  wrote:
> Scattered files include:
> python.exe (in Open Office)
> python27.dll (in CHIRP)
> pythoncom27.dll (in CHIRP)
> python33.dll (in HamRadio\WSJT)
> python25.dll (in "Koan c:\Program Files(x86)\Cyberlink)
>
> I assume these various .dll files are used in the various other programs I
> have installed but I cannot understand, at the moment, why the main python
> program does not appear in the designated installation directory.

Those would all be different programs that have packaged up (part of)
Python with them - and in some cases, a very old version. You can
ignore those.

Did the installation give any complaints? It's possible that you'd
need to elevate privileges for the global installation, though you
should be able to install to your own user directory without
elevation.

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


Re: Installation problem

2015-10-08 Thread Laura Creighton
In a message of Thu, 08 Oct 2015 15:49:56 +0100, Tim Golden writes:
>On 08/10/2015 14:25, MICHAEL wrote:
>> Hello,
>> 
>> Please forgive a new user's ignorance.
>> 
>> I am trying to install Python 3.5.0 on my laptop (Windows 10). The
>> default installation directory is shown as c:\Users\(my user
>> name)\AppData\Local\Programs\Python\Python35-32. However, if I select
>> Custom Install then the default installation directory is c:\Program
>> Files(x86)\Python3.5.
>> 
>> In either case, after the installation is complete I cannot find a
>> Python3.5 directory under Program Files(x86) or the Users\... directory.
>
>OP reports off-list that the installation now appears to have been
>successful. (I'm not clear whether as the result of a re-install or
>simply finding the .exe)
>
>TJG

Well, his Python shouldn't have been scattered all over his filesystem
in any case.  Did it all show up in one place like it was supposed to?

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


Re: Installation problem

2015-10-08 Thread Tim Golden
On 08/10/2015 16:27, Laura Creighton wrote:
> In a message of Thu, 08 Oct 2015 15:49:56 +0100, Tim Golden writes:
>> On 08/10/2015 14:25, MICHAEL wrote:
>>> Hello,
>>>
>>> Please forgive a new user's ignorance.
>>>
>>> I am trying to install Python 3.5.0 on my laptop (Windows 10). The
>>> default installation directory is shown as c:\Users\(my user
>>> name)\AppData\Local\Programs\Python\Python35-32. However, if I select
>>> Custom Install then the default installation directory is c:\Program
>>> Files(x86)\Python3.5.
>>>
>>> In either case, after the installation is complete I cannot find a
>>> Python3.5 directory under Program Files(x86) or the Users\... directory.
>>
>> OP reports off-list that the installation now appears to have been
>> successful. (I'm not clear whether as the result of a re-install or
>> simply finding the .exe)
>>
>> TJG
> 
> Well, his Python shouldn't have been scattered all over his filesystem
> in any case.  Did it all show up in one place like it was supposed to?

(Not entirely sure if you're serious...)

Those were elements of the other programs he mentioned which ship Python
as, eg, a scripting or even because they're partly or wholly implemented
in Python. Apart from the file locations, none of the DLL versions are
35: python27.dll, python33.dll etc.

TJG

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


Re: Hiding code from intruders, a different slant on an old question

2015-10-08 Thread alister
On Thu, 08 Oct 2015 08:44:43 -0600, Ian Kelly wrote:

> On Wed, Oct 7, 2015 at 6:01 PM, Dennis Lee Bieber
>  wrote:
>> On Wed, 7 Oct 2015 13:05:07 + (UTC), alister
>>  declaimed the following:
>>
>>
>>>With a simple Cesar the method is "shift the alphabet by 'X' characters
>>>and X is the key
>>>
>>>if the key is unknown then the attacker still has to brute force the
>>>method (admittedly with only 25 options this is not difficult)
>>
>> But who'd consider that with just one-case and alphabet only...
>>
>> At the least include upper, lower, numbers, and basic
>> punctuation --
>> that will add a few more cycles of computation time to break 
> 
> It doesn't really matter how much you add; any Caesar cipher is going to
> fall easily to just a little bit of frequency analysis. Consider an
> extreme case, where the range of X is the size of the entire Unicode
> character set. If the message is written in a Latin-based character set,
> chances are good that the majority of the characters will fall within a
> range of <96, giving the attacker a great starting point to brute-force
> from.

Oh please
the Caesar cypher was mentioned as a simplification for the purpose of 
demonstration.
it was not intended to be even a remotely serious suggestion

which I am sure at least Denis understood when he posted his tongue in 
cheek reply.


-- 
Economists can certainly disappoint you.  One said that the economy would
turn up by the last quarter.  Well, I'm down to mine and it hasn't.
-- Robert Orben
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Installation problem

2015-10-08 Thread Laura Creighton
In a message of Thu, 08 Oct 2015 16:34:15 +0100, Tim Golden writes:
>On 08/10/2015 16:27, Laura Creighton wrote:
>> In a message of Thu, 08 Oct 2015 15:49:56 +0100, Tim Golden writes:
>>> On 08/10/2015 14:25, MICHAEL wrote:
 Hello,

 Please forgive a new user's ignorance.

 I am trying to install Python 3.5.0 on my laptop (Windows 10). The
 default installation directory is shown as c:\Users\(my user
 name)\AppData\Local\Programs\Python\Python35-32. However, if I select
 Custom Install then the default installation directory is c:\Program
 Files(x86)\Python3.5.

 In either case, after the installation is complete I cannot find a
 Python3.5 directory under Program Files(x86) or the Users\... directory.
>>>
>>> OP reports off-list that the installation now appears to have been
>>> successful. (I'm not clear whether as the result of a re-install or
>>> simply finding the .exe)
>>>
>>> TJG
>> 
>> Well, his Python shouldn't have been scattered all over his filesystem
>> in any case.  Did it all show up in one place like it was supposed to?
>
>(Not entirely sure if you're serious...)
>
>Those were elements of the other programs he mentioned which ship Python
>as, eg, a scripting or even because they're partly or wholly implemented
>in Python. Apart from the file locations, none of the DLL versions are
>35: python27.dll, python33.dll etc.
>
>TJG

I am serious, in that it wasn't clear to me what those things were.
What I don't know about Windows is very huge ...

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


Re: Hiding code from intruders, a different slant on an old question

2015-10-08 Thread Ian Kelly
On Thu, Oct 8, 2015 at 9:46 AM, alister
 wrote:
> Oh please
> the Caesar cypher was mentioned as a simplification for the purpose of
> demonstration.
> it was not intended to be even a remotely serious suggestion
>
> which I am sure at least Denis understood when he posted his tongue in
> cheek reply.

I understood that also. I don't see why that means I can't elaborate on it.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Access a class in another python script

2015-10-08 Thread DBS
On Wednesday, October 7, 2015 at 11:46:05 PM UTC-7, Terry Reedy wrote:
> On 10/8/2015 2:24 AM, DBS wrote:
> > I'm using Python 3.5 and have two python scripts where one needs
> > access to a class in the other script for authentication purposes.
> 
> Any python .py file can be either run as a main program or module (ie, 
> script) or imported as a module by another module.  If a file is meant 
> for both, it should end with
> 
> if __name__ == '__main__:
>  
> 
> The latter is ofter to call a function main() defined previously.  If 
> you have a problem with this, write a **minimal** example with at most 
> 10 lines per file and post.
> 
> 
> -- 
> Terry Jan Reedy

Hello Terry,

Thanks.  Will do and get back with what come up with.  To clarify your 
repsonse, I need to change the file name to reflect __filename__.py and then 
import the needed components (classes and variables) accordingly?  
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Planet Scipy blog

2015-10-08 Thread Oscar Benjamin
On Thu, 8 Oct 2015 15:29 Laura Creighton  wrote:

In a message of Thu, 08 Oct 2015 15:10:21 +0100, Mark Lawrence writes:
>On 08/10/2015 14:39, beliavsky--- via Python-list wrote:
>> There used to be a blog about SciPy at https 
:// planet.scipy.org/ 
, discussing the applications of Python to scientific computing. Now there
is a static page about "MPI for Python". What happened?
>>
>
>Presumably http:// www.scipy.org/

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

No, all the blog links there go to the MPI for Python link, too.



Numpy etc have been having some hosting problems recently. This might be a
temporary glitch.

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


Re: Installation problem

2015-10-08 Thread Mark Lawrence

On 08/10/2015 16:27, Laura Creighton wrote:

In a message of Thu, 08 Oct 2015 15:49:56 +0100, Tim Golden writes:

On 08/10/2015 14:25, MICHAEL wrote:

Hello,

Please forgive a new user's ignorance.

I am trying to install Python 3.5.0 on my laptop (Windows 10). The
default installation directory is shown as c:\Users\(my user
name)\AppData\Local\Programs\Python\Python35-32. However, if I select
Custom Install then the default installation directory is c:\Program
Files(x86)\Python3.5.

In either case, after the installation is complete I cannot find a
Python3.5 directory under Program Files(x86) or the Users\... directory.


OP reports off-list that the installation now appears to have been
successful. (I'm not clear whether as the result of a re-install or
simply finding the .exe)

TJG


Well, his Python shouldn't have been scattered all over his filesystem
in any case.  Did it all show up in one place like it was supposed to?

Laura



I have a very strong feeling that Steve Dower has *NOT* incorporated 
some kind of random number generator into the Python 3.5 installer such 
that weird versions of everything get scattered over a hard drive like 
confetti at a wedding.  If he had of done so I might well have had a 
word. The old lags know what I'm like, but for the benefit of the new 
lags, when I'm having a bad hair day, having got out of bed on the wrong 
side, it most certainly would *NOT* have been quiet.  Please also be 
aware that my bark is roughly one trillion times worse than my bite.


--
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: Installation problem

2015-10-08 Thread eryksun
On 10/8/15, Tim Golden  wrote:
>
> What happens if you do [Windows] + R (ie Start > Run), enter "python"
> and click OK?

The new installer for 3.5 doesn't create an "App Paths" key for
"python.exe" like the old installer used to do (see the old
Tools/msi/msi.py). Without that, unless python.exe is in the search
PATH, "Win+R -> python" and running "start python" in the command
prompt won't work. You can of course add the key manually as the
default value for
"[HKLM|HKCU]\Software\Microsoft\Windows\CurrentVersion\App
Paths\python.exe". IMO, this makes it the 'system' Python.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Installation problem

2015-10-08 Thread Oscar Benjamin
On Thu, 8 Oct 2015 22:30 eryksun  wrote:

On 10/8/15, Tim Golden  wrote:
>
> What happens if you do [Windows] + R (ie Start > Run), enter "python"
> and click OK?

The new installer for 3.5 doesn't create an "App Paths" key for
"python.exe" like the old installer used to do (see the old
Tools/msi/msi.py). Without that, unless python.exe is in the search
PATH, "Win+R -> python" and running "start python" in the command
prompt won't work. You can of course add the key manually as the
default value for
"[HKLM|HKCU]\Software\Microsoft\Windows\CurrentVersion\App
Paths\python.exe". IMO, this makes it the 'system' Python.



That's interesting. Any idea why it changed?

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


Re: Installation problem

2015-10-08 Thread eryksun
On 10/8/15, Oscar Benjamin  wrote:
> On Thu, 8 Oct 2015 22:30 eryksun  wrote:
>
> The new installer for 3.5 doesn't create an "App Paths" key for
> "python.exe" like the old installer used to do (see the old
> Tools/msi/msi.py). Without that, unless python.exe is in the search
> PATH, "Win+R -> python" and running "start python" in the command
> prompt won't work. You can of course add the key manually as the
> default value for
> "[HKLM|HKCU]\Software\Microsoft\Windows\CurrentVersion\App
> Paths\python.exe". IMO, this makes it the 'system' Python.
>
> That's interesting. Any idea why it changed?

Probably it's just an oversight. I doubt Steve Dower would have
purposefully decided to not set the "App Paths" key.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Installation problem

2015-10-08 Thread Oscar Benjamin
On Thu, 8 Oct 2015 22:41 eryksun  wrote:

> On 10/8/15, Oscar Benjamin  wrote:
> > On Thu, 8 Oct 2015 22:30 eryksun  wrote:
> >
> > The new installer for 3.5 doesn't create an "App Paths" key for
> > "python.exe" like the old installer used to do (see the old
> > Tools/msi/msi.py). Without that, unless python.exe is in the search
> > PATH, "Win+R -> python" and running "start python" in the command
> > prompt won't work. You can of course add the key manually as the
> > default value for
> > "[HKLM|HKCU]\Software\Microsoft\Windows\CurrentVersion\App
> > Paths\python.exe". IMO, this makes it the 'system' Python.
> >
> > That's interesting. Any idea why it changed?
>
> Probably it's just an oversight. I doubt Steve Dower would have
> purposefully decided to not set the "App Paths" key.
>
I guess it deserves a bug report then. (Not on a proper computer right now
but maybe tomorrow)
-- 
https://mail.python.org/mailman/listinfo/python-list


Using pipe in a system call

2015-10-08 Thread Cecil Westerhof
I want to do the following Bash command in Python:
sqlite3 spreekwoorden.sqlite "SELECT spreekwoord FROM spreekwoorden;" | 
sort > spreekwoorden2.txt

The following does this in Python:
sqlite_pipe = Popen(
(
'sqlite3',
'spreekwoorden.sqlite',
'SELECT spreekwoord FROM spreekwoorden;'
),
stdout = PIPE
)
Popen(
(
'sort',
'--output=spreekwoorden2.txt',
),
stdin = sqlite_pipe.stdout
)

Is this the correct way, or is there a better way?


By the way: I want this because I just filled the table spreekwoorden
in my Python script and want to save it immediately.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Using pipe in a system call

2015-10-08 Thread Ian Kelly
On Thu, Oct 8, 2015 at 4:03 PM, Cecil Westerhof  wrote:
> I want to do the following Bash command in Python:
> sqlite3 spreekwoorden.sqlite "SELECT spreekwoord FROM spreekwoorden;" | 
> sort > spreekwoorden2.txt
>
> The following does this in Python:
> sqlite_pipe = Popen(
> (
> 'sqlite3',
> 'spreekwoorden.sqlite',
> 'SELECT spreekwoord FROM spreekwoorden;'
> ),
> stdout = PIPE
> )
> Popen(
> (
> 'sort',
> '--output=spreekwoorden2.txt',
> ),
> stdin = sqlite_pipe.stdout
> )
>
> Is this the correct way, or is there a better way?

That seems fine to me. Alternatively you could pass shell=True to
Popen and then the original command should work verbatim (but see the
warnings about using shell=True).
-- 
https://mail.python.org/mailman/listinfo/python-list