me, my arm, my availability ...

2016-01-13 Thread Laura Creighton

I fell recently.  Ought to be nothing, but a small chip of bone, either an
existing one or one I just made is nicely wedged in the joint taking away
a whole lot of the ability of my arm to rotate in the elbow joint.  Or
hold my arm in a position that is usual for typing.  Plus,  now that the
sprain/swelling is more or less over, the pain, unfortunately is not.

The real downside is that my typing speed is down from 135-140 wpm
to 5-10 wmp.  At this rate, just getting my usual work done takes
overtime.

Seems like surgery is needed to fix this. 

So I wanted you all to know, no, I haven't forgotten you and no haven't
stopped caring.  I have just stopped being as __capable__ if you know
what I mean.

Please take care of yourselves and each other.  I will often be reading
even if typing is more than I can do right now.

Laura

ps -- (recent tutor discussion) I am with Alan and not with Mark.  I
am happy as anything when people post their not-quite-working code for
homework assignments here to tutor.  They aren't lazy bastards wanting
somebody to do their assignments for them, they want to learn why what
they are trying to do isn't working.  Sounds perfect for tutor to me.

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


Re: me, my arm, my availability ...

2016-01-13 Thread Laura Creighton
In a message of Wed, 13 Jan 2016 16:41:57 -0500, "David H. Lipman" writes:
>From: "Laura Creighton" <l...@openend.se>
>
>>
>> I fell recently.  Ought to be nothing, but a small chip of bone, either an
>
>Due to the side-effects of the prescription drugs you were given, I suggest 
>you not use a computer until you are no longer taking them.  ;-)

God, this is going to make playing games on my android tablet a problem.
And there _was_ a time when under drugs, killing monsters was about all
I was good for ...

Thank you for cheering me up, some.

Nice community this. :)

Laura

>Dave
>Multi-AV Scanning Tool - http://multi-av.thespykiller.co.uk
>http://www.pctipp.ch/downloads/dl/35905.asp 

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


Re: Library function to encode data to multipart/form-data format?

2015-12-21 Thread Laura Creighton
In a message of Mon, 21 Dec 2015 17:51:00 +, Grant Edwards writes:
>Is there a standard library function that can be used to encode data
>into multipart/form-data format?  IIRC, I looked for this once before
>and didn't find anything in the library. 
>
>[I don't want to actually send an HTTP POST or an email message, I
>just need to generate sets of data for test purposes.]
>
>-- 
>Grant Edwards   grant.b.edwardsYow! -- I love KATRINKA
>  at   because she drives a
>  gmail.comPONTIAC.  We're going
>   away now.  I fed the cat.
>-- 
>https://mail.python.org/mailman/listinfo/python-list

Cannibalise this:
http://code.activestate.com/recipes/146306/
which just uses standard library things.

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


Re: cannot open file with non-ASCII filename

2015-12-15 Thread Laura Creighton
In a message of Tue, 15 Dec 2015 08:26:37 +, Ulli Horlacher writes:
>Laura Creighton <l...@openend.se> wrote:
>
>> PyPy wrote its own pyreadline.
>> You can get it here. https://bitbucket.org/pypy/pyrepl
>
>As far as I can see, it has no getkey function.
>My users do not hit ENTER after drag or copy files.
>I need an input function with a timeout.

Right, then this isn't going to work.  Sorry about that.

Laura

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


Re: subprocess.call with non-ASCII arguments?

2015-12-15 Thread Laura Creighton
In a message of Tue, 15 Dec 2015 14:25:50 +, Ulli Horlacher writes:
>(My first posting seems to got lost)
>
>I want to create a zip file within a Python 2.7 program on windows.
>
>My code:
>
>  cmd = ['7za.exe','a','-tzip',archive] + files
>  status = subprocess.call(cmd)
>
>leads to:
>
>  File "fexit.py", line 971, in sendfile_retry
>status = subprocess.call(cmd)
>  File "C:\Python27\lib\subprocess.py", line 522, in call
>return Popen(*popenargs, **kwargs).wait()
>  File "C:\Python27\lib\subprocess.py", line 710, in __init__
>errread, errwrite)
>  File "C:\Python27\lib\subprocess.py", line 958, in _execute_child
>startupinfo)
>UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 
>87:
> ordinal not in range(128)
>
>
>This is because the array "files" contains filenames with non-ASCII
>characters.
>
>So, the problem is in subprocess.py, which I cannot modify.
>
>
>Instead of calling a 7z subprocess with non-ASCII arguments I tried to
>call it with a listfile: it starts with a "@" and contains the names of
>the files to be packed into the arcive. It is a special 7z feature.
>
>New code:
>
>  fileslist = archive + '.list'
>  flo = open(fileslist,'w')
>  for file in files: print(file,file=flo)
>  flo.close()
>  cmd = ['7za.exe','a','-tzip',archive,'@'+fileslist]
>  status = subprocess.call(cmd)
>
>
>But with that I get a new error:
>
>  File "fexit.py", line 959, in sendfile_retry
>for file in files: print(file,file=flo)
>UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 8:
>  ordinal not in range(128)
>
>
>I get the same error message, when i use:
>  flo = open(fileslist,'wb')
>  
>
>How can I tell open() or print() that I want to write non-ASCII ?

see if setting the environment variable PYTHONIOENCODING
https://docs.python.org/2/using/cmdline.html

works for you.  No promises, not a windows user.

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


Re: cannot open file with non-ASCII filename

2015-12-14 Thread Laura Creighton
In a message of Mon, 14 Dec 2015 23:41:21 +0100, "Thomas 'PointedEars' Lahn" wr
ites:

>Why do you have to use msvcrt?
>
>I would use curses for user input, but:
>
>,-
>,-
>| 
>| No one has made a Windows port of the curses module. On a Windows 
>| platform, try the Console module written by Fredrik Lundh. The Console 
>| module provides cursor-addressable text output, plus full support for 
>| mouse and keyboard input, and is available from 
>| http://effbot.org/zone/console-index.htm.
>
>So you should try that instead.

If going for curses, I'd try this instead:
http://pdcurses.sourceforge.net/

Laura

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


Re: cannot open file with non-ASCII filename

2015-12-14 Thread Laura Creighton
In a message of Mon, 14 Dec 2015 17:55:04 -0600, eryk sun writes:
>On Mon, Dec 14, 2015 at 4:17 PM, Ulli Horlacher
> wrote:
>>
>> ImportError: No module named pyreadline
>>
>> Is it a python 3.x module?
>>
>> I am limited to Python 2.7
>
>pyreadline is available for 2.7-3.5 on PyPI. Anyway, I tried it to no
>avail. When dropping a file path into the console it ignores the
>alt-numpad sequences that get queued for non-ASCII characters, just
>like mvcrt.getwch. If you decide to roll your own getwch via ctypes or
>PyWin32, I suggest starting a new topic on the ctypes list or Windows
>list.
>-- 
>https://mail.python.org/mailman/listinfo/python-list

PyPy wrote its own pyreadline.
You can get it here. https://bitbucket.org/pypy/pyrepl
And see if it works any better.

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


Re: cannot open file with non-ASCII filename

2015-12-14 Thread Laura Creighton
In a message of Mon, 14 Dec 2015 13:34:56 -0500, Terry Reedy writes:
>On 12/14/2015 11:24 AM, Ulli Horlacher wrote:
>> With Python 2.7.11 on Windows 7 my users cannot open/read files with
>> non-ASCII filenames.
>
>Right.  They should either restrict themselves to ascii (or possibly 
>latin-1) filenames or use current 3.x.  This is one of the (known) 
>unicode problems fixed in 3.x by making unicode the core text class, 
>replacing the implementation of unicode, and performing further work 
>with the new implementation.
>
>-- 
>Terry Jan Reedy
>
>-- 
>https://mail.python.org/mailman/listinfo/python-list

Given that Ulli is in Germany, latin-1 is likely to work fine for him.  And
you do it like this:

# -*- coding: latin-1 -*-
from Tkinter import *
root = Tk()
s = 'Välkommen till Göteborg'  # Welcome to Gothenburg (where I live)
u = unicode(s, 'iso8859-1')
Label(root, text=u).pack()

root.mainloop()

Laura



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


Re: codecs.StreamRecoder not doing what I expected.

2015-12-13 Thread Laura Creighton
In a message of Sun, 13 Dec 2015 01:35:45 -0500, "D'Arcy J.M. Cain" writes:
>When I try to print it to the web page it fails because the \xe9
>character is not valid ASCII.  However, my default encoding is utf-8.
>Other web pages on the same server display fine.
>
>I have the following in the Apache config by the way.
>
>SetEnv PYTHONIOENCODING utf8
>
>So, my file is utf-8, I am reading it as utf-8, my Apache server output
>is set to utf-8.  How is ASCII sneaking in?

What is your sys.stdout.encoding ?

just import sys and print the thing.

I think you will find that it is not what you expect.

Laura

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


Re: Weird list conversion

2015-12-13 Thread Laura Creighton
In a message of Sun, 13 Dec 2015 11:45:19 -0800, high5stor...@gmail.com writes:
>Hi all,
>
>  f = open("stairs.bin", "rb") 
>  data = list(f.read(16))
>  print data
>
>returns
>
>['=', '\x04', '\x00', '\x05', '\x00', '\x01', '\x00', '\x00', '\x00', '\x00', 
>'\x00', '\x00', '\x00', '\x00', '\x00', '\x00']
>
>The first byte of the file is 0x3D according to my hex editor, so why does 
>Python return '=' and not '\x3D'?
>
>As always, thanks for any help!

0x3d is the ascii code for '='
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: 2to3 translation problem

2015-12-12 Thread Laura Creighton
In a message of Sat, 12 Dec 2015 17:59:52 +0100, Peter Otten writes:
>Tony van der Hoff wrote:
>
>> On 12/12/15 15:09, Mark Lawrence wrote:
>>> On 12/12/2015 14:42, Tony van der Hoff wrote:
 Debian Jessie, python 2.7; python 3.4

 I have an application, using pygame for graphics, that works fine under
 python2.7. I have run it through 2to3, but when running the result under
 python 3.4, I get the error :

 Traceback (most recent call last):
File "ppm304.py", line 9, in 
  import pygame
 ImportError: No module named 'pygame'

 So, python 3.4 can't find the library, whilst python 2.7 can.
 How do I track down/fix the missing dependency.
>>>
>>> This isn't a 2to3 translation problem.  You've installed pygame under
>>> 2.7 at some point, repeat the process for 3.4.  I've no idea how you'd
>>> do that on Debian Jessie but on Windows it'd be "pip3.4 install pygame".
>>>
>> Thanks, Mark, for the pointer. I'm pretty sure I installed Pygame from
>> Debian's repository, via apt-get install python-pygame. I believe that
>> should be effective for any version of Python.
>
>No, that is the version for Python 2. If there is a Python 3 version it will 
>be called
>
>python3-pygame
>
>but no such package seems to be available:
>
>https://packages.debian.org/search?suite=jessie=any=names=python3-pygame

There is one in unstable, I forgot to check for jessie, sorry about that.

Laura

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


Re: 2to3 translation problem

2015-12-12 Thread Laura Creighton
In a message of Sat, 12 Dec 2015 16:31:54 +, Tony van der Hoff writes:
>On 12/12/15 15:09, Mark Lawrence wrote:
>> On 12/12/2015 14:42, Tony van der Hoff wrote:
>>> Debian Jessie, python 2.7; python 3.4
>>>
>>> I have an application, using pygame for graphics, that works fine under
>>> python2.7. I have run it through 2to3, but when running the result under
>>> python 3.4, I get the error :
>>>
>>> Traceback (most recent call last):
>>>File "ppm304.py", line 9, in 
>>>  import pygame
>>> ImportError: No module named 'pygame'
>>>
>>> So, python 3.4 can't find the library, whilst python 2.7 can.
>>> How do I track down/fix the missing dependency.
>>
>> This isn't a 2to3 translation problem.  You've installed pygame under
>> 2.7 at some point, repeat the process for 3.4.  I've no idea how you'd
>> do that on Debian Jessie but on Windows it'd be "pip3.4 install pygame".
>>
>Thanks, Mark, for the pointer. I'm pretty sure I installed Pygame from 
>Debian's repository, via apt-get install python-pygame. I believe that 
>should be effective for any version of Python.

You are mistaken here.
python-pygame is only a python 2.7 pygame.

you want python3-pygame.
https://packages.debian.org/search?keywords=python3-pygame

Speaking as a debian user are going to have a _whole lot of this_.
If you don't know about apt-cache search  
let me recommend it to you.

This on debian unstable:

lac@smartwheels:~$  apt-cache search pygame
lightyears - single player real-time strategy game with steampunk sci-fi
psychopy - environment for creating psychology stimuli in Python
python-pygame - SDL bindings for games development in Python
python-pyglet - cross-platform windowing and multimedia library
pyntor - flexible and componentized presentation program
solarwolf - Collect the boxes and don't become mad
python-soya - high level 3D engine for Python
python-soya-dbg - high level 3D engine for Python - debug extension
python-soya-doc - high level 3D engine for Python
python3-pygame - SDL bindings for games development in Python (Python 3)

So, too many hits, alas, but it does tend to find such things.

Laura

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


Re: 2to3 translation problem

2015-12-12 Thread Laura Creighton
In a message of Sun, 13 Dec 2015 04:50:43 +1100, Chris Angelico writes:
>On Sun, Dec 13, 2015 at 4:30 AM, Tony van der Hoff  wrote:
>> Thanks, Laura, and others who have replied. You're right; python-3-pygame
>> exists in unstable, but has not yet made it to jessie, even in backports.
>>
>> So, I'll stick with python 2.7 for the time being; really no hardship :)
>
>The easiest solution is simply:
>
>python3 -m pip install pygame
>
>Don't worry about it not being in the Jessie repo - you can always
>grab things using pip.
>
>ChrisA

What Chris said. :)

If you are about to move your life from being python2.7 based to 
being 3.x, you are not going to be able to depend on things getting
to jessie in a timely fashion.  So you will be doing this a whole lot.

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


Re: Why doesn't response pydoc on my Python 2.7?

2015-12-12 Thread Laura Creighton
In a message of Sat, 12 Dec 2015 15:01:54 -0800, Robert writes:
>Hi,
>
>I want to use pydoc as some online tutorial shows, but it cannot run as 
>below. What is wrong?
>
>
>Thanks,
>
>
>
>
 import pydoc
 pydoc
>
 pydoc sys
>SyntaxError: invalid syntax
 import sys
 pydoc sys
>SyntaxError: invalid syntax
 help(pydoc)
>Help on module pydoc:
>..
>-- 
>https://mail.python.org/mailman/listinfo/python-list

You aren't supposed to type 
pydoc sys
from __inside__ your python command interpreter.

You type this at a command prompt.

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


[issue25851] installing 3.5 on windows server 2003 x86 R2 Standard Edition Sp2 ENU,

2015-12-12 Thread Laura Creighton

Changes by Laura Creighton <l...@openend.se>:


--
components: +Installation, Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
versions: +Python 3.5, Python 3.6

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25851>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25851] installing 3.5 on windows server 2003 x86 R2 Standard Edition Sp2 ENU,

2015-12-12 Thread Laura Creighton

New submission from Laura Creighton:

Another one in to webmaster.

Somebody tried to install 3.5 on his windows server 2003 x86 R2 Standard 
Edition Sp2 ENU, and was told that Vista or later is required.

Is this correct behaviour, or did we forget about such people?  Near as
I can tell some of them can still be on their very last gasp of 
being supported by Microsoft.

--
messages: 256298
nosy: lac
priority: normal
severity: normal
status: open
title: installing 3.5 on windows server 2003 x86 R2 Standard Edition Sp2 ENU,

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25851>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: 2to3 translation problem

2015-12-12 Thread Laura Creighton
In a message of Sat, 12 Dec 2015 20:24:10 +, Tony van der Hoff writes:
>On 12/12/15 17:54, Laura Creighton wrote:
>> In a message of Sun, 13 Dec 2015 04:50:43 +1100, Chris Angelico writes:
>>> On Sun, Dec 13, 2015 at 4:30 AM, Tony van der Hoff <t...@vanderhoff.org> 
>>> wrote:
>>>> Thanks, Laura, and others who have replied. You're right; python-3-pygame
>>>> exists in unstable, but has not yet made it to jessie, even in backports.
>>>>
>>>> So, I'll stick with python 2.7 for the time being; really no hardship :)
>>>
>>> The easiest solution is simply:
>>>
>>> python3 -m pip install pygame
>>>
>>> Don't worry about it not being in the Jessie repo - you can always
>>> grab things using pip.
>>>
>>> ChrisA
>>
>> What Chris said. :)
>>
>> If you are about to move your life from being python2.7 based to
>> being 3.x, you are not going to be able to depend on things getting
>> to jessie in a timely fashion.  So you will be doing this a whole lot.
>
>No:
>tony@tony-lx:~$ python3 -m pip install pygame
>/usr/bin/python3: No module named pip
>
>Hmm, apt-get install python3-pip: OK
>
>tony@tony-lx:~$ python3 -m pip install pygame
>Downloading/unpacking pygame
>   Could not find any downloads that satisfy the requirement pygame
>   Some externally hosted files were ignored (use --allow-external 
>pygame to allow).
>Cleaning up...
>No distributions at all found for pygame
>Storing debug log for failure in /home/tony/.pip/pip.log
>
>I really can't be bothered...
>
>Thanks for the hints.

Sorry, I forgot to warn you.  Debian, in its wisdom breaks python
up into several pieces, and so if you install python as a debian
package, you have to install the ability to use pip separately.

apt-get install python-pip  (for 2.x)
apt-get install python3-pip (for 3.x)

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


Re: python script for dwonload free anything?

2015-12-11 Thread Laura Creighton
In a message of Fri, 11 Dec 2015 06:29:33 -0800, hienm...@gmail.com writes:
>i want create script for download free 3d model from nonecg.com like 
>https://github.com/nishad/udemy-dl-windows , this script download free udemy 
>video lesson. Anyone can tell e, how to create script like that?
>-- 
>https://mail.python.org/mailman/listinfo/python-list

I think you will find this PyPi project interesting.
https://github.com/rg3/youtube-dl/

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


[issue25842] Installer does not set permissions correctly?

2015-12-11 Thread Laura Creighton

New submission from Laura Creighton:

This in from python-list.  2 complaints.  
conflict with a notepad++ plugin and incorrect permissions.

Date:Fri, 11 Dec 2015 16:30:32 +
To:  "python-l...@python.org" <python-l...@python.org>
From:Jay Hamm <ha...@vmware.com>
Subject: python 351x64


Hi

I was trying to use your windows version of python 3.5.1 x64.

It has a conflict with a notepad++ plugin NppFTP giving api-ms-win-crt-runtime-
I1-1-0.dll error on start up.

This seems pretty well documented on the web. The work around is to delete the 
plugin and reinstall since it borks the install.

Since about every other admin I've ever known uses notepad++, you might want to
 fix this.

Also your installer fails to set the permissions correctly:

H:\>py -m pip install requests
Collecting requests
  Downloading requests-2.8.1-py2.py3-none-any.whl (497kB)
100% || 499kB 875kB/s
Installing collected packages: requests
Exception:
Traceback (most recent call last):
  File "C:\Program Files\Python35\lib\site-packages\pip\basecommand.py", line 2
11, in mainstatus = self.run(options, args)
  File "C:\Program Files\Python35\lib\site-packages\pip\commands\install.py", l
ine 311, in runroot=options.root_path,
  File "C:\Program Files\Python35\lib\site-packages\pip\req\req_set.py", line 6
46, in install**kwargs
  File "C:\Program Files\Python35\lib\site-packages\pip\req\req_install.py", li
ne 803, in installself.move_wheel_files(self.source_dir, root=root)
  File "C:\Program Files\Python35\lib\site-packages\pip\req\req_install.py", li
ne 998, in move_wheel_filesisolated=self.isolated,
  File "C:\Program Files\Python35\lib\site-packages\pip\wheel.py", line 339, in
 move_wheel_filesclobber(source, lib_dir, True)
  File "C:\Program Files\Python35\lib\site-packages\pip\wheel.py", line 310, in
 clobberensure_dir(destdir)
  File "C:\Program Files\Python35\lib\site-packages\pip\utils\__init__.py", lin
e 71, in ensure_diros.makedirs(path)
  File "C:\Program Files\Python35\lib\os.py", line 241, in makedirsmkdir(na
me, mode) PermissionError: [WinError 5] Access is denied: 'C:\\Program Files\\P
ython35\\Lib\\site-packages\\requests'

Once I gave myself control it started working.

This is pretty shoddy for released software.
Thanks,
Jacob Hamm (Jay) VCP-DCV, RHCE
Senior Cloud Services Engineer - VMware vCloud Air

380 Interlocken Crescent Blvd - Ste 500, Broomfield CO 80021
Office 303 942 4638 - ha...@vmware.com<mailto:ha...@vmware.com>
Want to learn more about VMware vCloud Air?
Go to http://vcloud.vmware.com/tutorials
[vCloudAir]

--
components: Installation, Windows
messages: 256223
nosy: lac, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Installer does not set permissions correctly?
versions: Python 3.5, Python 3.6

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25842>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Problem with sqlite3 and Decimal (fwd)

2015-12-11 Thread Laura Creighton
>From python-list.
Very weird.
Another reason not to use sqlite3

--- Forwarded Message

To: python-list@python.org
From: "Frank Millman" 
Subject: Problem with sqlite3 and Decimal
Date: Fri, 11 Dec 2015 11:21:53 +0200
Lines: 71

Hi all

I need to store Decimal objects in a sqlite3 database, using Python 3.4 on
Windows 7.

I followed the instructions here -


http://stackoverflow.com/questions/6319409/how-to-convert-python-decimal-to-sqlite-numeric

It seemed to work well, but then I hit a problem. Here is a stripped-down
example -

"""
from decimal import Decimal as D
import sqlite3

# Decimal adapter (store Decimal in database as str)
sqlite3.register_adapter(D, lambda d:str(d))

# Decimal converter (convert back to Decimal on return)
sqlite3.register_converter('DEC', lambda s: D(s.decode('utf-8')))

conn = sqlite3.connect(':memory:', detect_types=sqlite3.PARSE_DECLTYPES)
cur = conn.cursor()

cur.execute("CREATE TABLE fmtemp (acno INT, bal DEC)")
cur.execute("INSERT INTO fmtemp (acno, bal) VALUES (?, ?)", ('A001',
D('0')))

sql1 = "SELECT bal FROM fmtemp"
sql2 = "UPDATE fmtemp SET bal = bal + ?"

while True:
print(cur.execute(sql1).fetchone()[0])
cur.execute(sql2, (D('123.45'),))
q = input()
if q == 'q':
break
"""

It initialises a decimal value in the database, then loops adding a decimal
value and displaying the result.

It runs fine for a while, and then the following happens -

5802.15

5925.6

6049.05

6172.49

6295.94

It consistently switches to floating point at the same position. If you
carry on for a while, it reverts back to two decimal places.

If I initialise the value as D('6049.05'), the next value is 6172.5, so it
is not the number itself that causes the problem.

I tried displaying the type - even when it switches to 6172.4999, it is
still a Decimal type.

I noticed one oddity - I am asking sqlite3 to store the value as a string,
but then I am asking it to perform arithmetic on it.

Any suggestions will be much appreciated.

Frank Millman 


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

--- End of Forwarded Message
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Script - Windows Task Scheduler - Logging

2015-12-08 Thread Laura Creighton
In a message of Mon, 07 Dec 2015 23:53:10 +, Raheel Rao writes:
>Hello there,I created a python script that connects to an ftp and downloads 
>files to a specifed folder and logs each event in a log file. This script 
>works perfectly fine as i want it to however when i put this in a task 
>scheduler, the script runs and downloads the file just fine except that there 
>is no log created. Any suggestions? I remember task scheduler have a bug where 
>you have to put something in "start in". Have been searching froums but so far 
>no luck. Thanks in advance!
>
>-- 
>https://mail.python.org/mailman/listinfo/python-list


Maybe related to this?
tackoverflow.com/questions/20196049/problems-running-python-script-by-windows-task-scheduler-that-does-pscp

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


Re: manually build a unittest/doctest object.

2015-12-08 Thread Laura Creighton
In a message of Tue, 08 Dec 2015 07:04:39 -0700, Vincent Davis writes:
>On Tue, Dec 8, 2015 at 2:06 AM, Peter Otten <__pete...@web.de> wrote:
>
>> But why would you want to do that?
>
>
>Thanks Peter, I want to do that because I want to test jupyter notebooks.
>​The notebook is in JSON and I can get the source and result out but it was
>unclear to me how to stick this into a test. doctest seemed the simplest
>but maybe there is a better way.
>
>I also tried something like:
>assert exec("""print('hello word')""") == 'hello word'
>
>
>Vincent Davis
>720-301-3003
>-- 
>https://mail.python.org/mailman/listinfo/python-list

Check out this:
https://pypi.python.org/pypi/pytest-ipynb

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


Re: Problem

2015-12-08 Thread Laura Creighton
In a message of Tue, 08 Dec 2015 16:11:53 +0100, Fabien writes:
>On 12/08/2015 04:03 PM, Namrah Anwar wrote:
>> Dear Administration,
>>
>> I am Namrah Anwar writing to you from Pakistan. I downloaded Python version
>> 3.5.1 and 2.7 and after installation at first, upon opening again it asked
>(snip)
>> -- *Regards,Namrah Anwar* *PhD Student (Fellowship) - Cancer Biology -
>
>I can see from your signature that you are going to use python for 
>scientific purposes. I recommend to go directly for Anaconda:
>
>https://www.continuum.io/downloads
>
>Cheers,
>
>Fabien

That is a very good idea.

Laura

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


Re: Problem

2015-12-08 Thread Laura Creighton
In a message of Tue, 08 Dec 2015 20:03:27 +0500, Namrah Anwar writes:
>Dear Administration,
>
>I am Namrah Anwar writing to you from Pakistan. I downloaded Python version
>3.5.1 and 2.7 and after installation at first, upon opening again it asked
>for Modify, repair or uninstall options. I tried to fix it but could not.
>Can you please help me out how to fix this and why it is asking every time
>for same option?
>
>Thanking you in anticipation.
>
>-- 
>
>
>*Regards,Namrah Anwar*
>*PhD Student (Fellowship) - Cancer Biology - Agha Khan University-Karachi*
>*Masters in Health care Biotechnology  (ASAB) NUST, Islamabad*
>*Pakistan.*

What OS version are you running?

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


Re: install issue

2015-12-07 Thread Laura Creighton
In a message of Sun, 06 Dec 2015 20:44:03 +, "John Robinson" writes:
>When I run the installer (python-3.5.0.exe [win32]) I see this:
>
> 
>
>
>
> 
>
>There seems to be "hidden" buttons as clicking in the middle of this dialog
>box does continue the process. 
>
>However, when complete, and I start python, I get an error saying its not a
>valid win32 application.
>
>So, I uninstalled, and there is the same issue with the un-installer - I
>have to click random places in the dialog box to "find" the uninstall
>button, that is not shown.
>
> 
>
>(plus AVG shows this as the Heri virus - and, yes, I did disable AVG while
>attempting the installation.)
>
>Win xp, SP3, AMD Phenom, 1100, 8gb (dual boot with win7) 
>
> 
>
>Rgds

AVG, like most antivirus software, gets tons and tons of false positives.

Regardless of weirdnesses in the installer, your real problem is that
3.5 and later does not run on XP, period.  The new Python 3.5.1 released
yesterday was supposed to be able to detect your XP, and tell you that
you needed to upgrade your OS in order to run 3.5.1

Looks like things are still not working perfectly on that front, but
that's the problem.  You need to either stick with 3.4 or upgrade your OS.

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


Re: Packages installing problem

2015-12-07 Thread Laura Creighton
In a message of Mon, 07 Dec 2015 00:32:37 +, lalith writes:
>Dear sir.
>
>I was using Python2.7 and i move to Python3.5.
>I face big trouble with installing software packages, i need in my 
>development.
>
>Lalith
>-- 
>https://mail.python.org/mailman/listinfo/python-list

Do you want to install your packages system-wide?

Try py -3.5 -m install 

Do you want to install your python packages in a virtual environment?

Start reading here:
https://docs.python.org/3/library/venv.html

If you sometimes want a python 2.7 virtual env you cannot get it with
venv.  You will have to use the older virtualenv. 
https://virtualenv.readthedocs.org/en/latest/

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


Re: define the area plot

2015-12-07 Thread Laura Creighton
In a message of Mon, 07 Dec 2015 10:51:10 -0200, jorge.conr...@cptec.inpe.br wr
ites:
>
>
>Hi,
>
>I'm changing from the IDL to PYTHON. I would like know how can I define 
>the size of the window plot in Python. On IDL I define the size of area 
>plot by:
>
>
>window,1,xsize=1000,ysize=1000
>
>
>It is possible define the size of the window before my data is plotted.
>
>
>Conrado

What package are you using to plot with?

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


Re: python 3.5: upgrading smart_open package

2015-12-07 Thread Laura Creighton
In a message of Mon, 07 Dec 2015 22:45:44 +0530, Anupam Mediratta writes:
>Hello,
>
>I have to use python 3.5 in my use case and one of the packages I use
>(gensim), in turn uses smart_open (https://github.com/piskvorky/smart_open/)
>
>smart_open depends on boto and boto fails on my machine running ubuntu
>15.10.
>
>So in order for me to be able to run gensim, I need to be able to migrate
>smart_open from boto to boto3 (boto3 works fine with python 3 and ubuntu
>15.10).
>
>There is an open github issue:
>https://github.com/piskvorky/smart_open/issues/43
>
>I am not sure how to go about doing this migration. If someone has any
>directions or guidelines I will appreciate.
>
>Thanks


You have a bad problem.
https://github.com/piskvorky/smart_open/labels/help%20wanted
is the other name of https://github.com/piskvorky/smart_open/issues/43

This issue is because the author of smart_open wishes very badly to
move to boto3, but hasn't, because he wants help with something.
Thus you cannot migrate until he does.

You should send mail to the author, which I looked up for you
and you can find here.
http://radimrehurek.com/contact/

Tell him that you want smart_open to work with boto3, and that you want
to help making that happen.  Then see what he says is needed and see if
that is something you can do.

Laura

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


[issue25816] https://www.python.org/downloads/ not working for 3.5.1 for windows 10 users

2015-12-07 Thread Laura Creighton

New submission from Laura Creighton:

webmaster has heard from 2 windows 10 users who say that when 
they click on 'download windows 3.5.1' they are sent to
this  page https://www.python.org/downloads/windows/

instead of actually getting a download.

--
messages: 256063
nosy: lac
priority: normal
severity: normal
status: open
title: https://www.python.org/downloads/ not working for 3.5.1 for windows 10 
users

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25816>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Problems using celery and pyelasticsearch

2015-12-06 Thread Laura Creighton
In a message of Mon, 07 Dec 2015 02:37:15 +0100, nonami writes:

>Does anyone have any idea what could be going on or how I can further 
>inspect running tasks.

Not sure this will help, but it might ...
https://www.caktusgroup.com/blog/2013/10/30/using-strace-debug-stuck-celery-tasks/

Laura

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


Re: Issue

2015-12-06 Thread Laura Creighton
In a message of Sun, 06 Dec 2015 15:48:18 +, James Gilliver writes:
>Hi!
>I have recently installed Python 3.5.0 but cannot open the application! Could 
>you help me resolve this issue?
>Thanks,James
> 
>-- 
>https://mail.python.org/mailman/listinfo/python-list

What OS version are you running.
What happens when you try to open the application?

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


Re: issues

2015-12-06 Thread Laura Creighton
In a message of Fri, 04 Dec 2015 22:44:53 +, Anna Szaharcsuk via Python-lis
t writes:
>Hello there,
>
>I was trying to install PyCharm, but didn't worked and needed interpreter.
>the computer advised to install the python for windows.
>
>Can you help me, please, PyCharm stillnot working...allways gives a message
>for repair, after- the repair successful and again message for repair...
>
>
>Kind regards,
>Anna

What OS version do you have?  

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


Re: Message-IDs on Usenet gateway

2015-12-06 Thread Laura Creighton
In a message of Sun, 06 Dec 2015 15:51:54 -0500, Random832 writes:
>Something weird is going on. On google groups, this message has
>a different Message-ID:
>

I think it is this problem.  Start here.
https://mail.python.org/pipermail/mailman-developers/2015-November/025225.html

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


Re: Python 3.5 not work in Windows XP

2015-12-06 Thread Laura Creighton
In a message of Sat, 05 Dec 2015 22:22:41 +0600, am...@mail.ru writes:
>Installer: only 'Cancel' button visible on dialog. 'Install now...' and  
>'Customize...' work but invisible (also when deinstalling).
>
>After installing interpreter and launcher not runs (with message 'Access  
>denied)'

Yes, when 3.5.1 we will make that a lot clearer.  Windows XP is not
supported for 3.5 (and later).  Either stick with 3.4 or upgrade
your OS to something more recent.

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


Re: problem

2015-12-04 Thread Laura Creighton
In a message of Thu, 03 Dec 2015 21:25:53 +0200, Dylan Goodwin writes:
>Every time I try and run python 3.5 it keeps coming up with modify, repair
>or uninstall
>-- 
>https://mail.python.org/mailman/listinfo/python-list

What OS are you running?

If windows XP, your problem is that your OS is too old.  Python 3.5 is
not supported.  Stick with 3.4 or upgrade your OS.

If something else, you need to install 
the available service packs.  For instance, if you are running
Windows 7, https://www.microsoft.com/en-us/download/details.aspx?id=5842
is where you get service pack 1.

Laura Creighton

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


Re: python 3.5.0rc1 problem opening IDLE in windows

2015-12-04 Thread Laura Creighton
In a message of Fri, 04 Dec 2015 11:26:59 +, Nicky Mac writes:
>Dear python team
>since windows applied some updates last night to my windows 10 and windows
>7 systems,
>I can't open anything with IDLE as I usually do.
>On windows 10 (64bit with 64bit python), I performed the installation
>repair procedure.
>* Edit with IDLE does not appear as an installed windows program.
>* when I open my usual shortcut to IDLE (
>C:\Python\Python35\Lib\idlelib\idle.py)
> something briefly flashes on the screen *and immediately disappears.*
>* if I directly open a python program in windows, I get these options (as
>usual):-
>edit with IDLE (-> python launcher for windows console)
>edit with IDLE  (-> edit with IDLE (64bit))  - which I always
>use, *nothing
>happens*
>
>Any ideas gratefully received!!!
>sincerely
>Nick "Mac" McElwaine

Go to a console window and type python -m idlelib

See if you get a useful traceback, and post it here.  (If idle just
works, tell us that, instead.)

Laura Creighton

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


Re: filter a list of strings

2015-12-03 Thread Laura Creighton
In a message of Thu, 03 Dec 2015 10:27:19 +0100, c.bu...@posteo.jp writes:
>Thank you for your suggestion. This will help a lot.
>
>On 2015-12-03 08:32 Jussi Piitulainen  wrote:
>> list = [ item for item in list
>>  if ( 'Banana' not in item and
>>   'Car' not in item ) ]
>
>I often saw constructions like this
>  x for x in y if ...
>But I don't understand that combination of the Python keywords (for,
>in, if) I allready know. It is to complex to imagine what there really
>happen.
>
>I understand this
>  for x in y:
>if ...
>
>But what is about the 'x' in front of all that?

This is a list comprehension.
see: https://docs.python.org/2/tutorial/datastructures.html#list-comprehensions

But I would solve your problem like this:

things_I_do_not_want = ['Car', 'Banana', ]
things_I_want = []

for item in list_of_everything_I_started_with:
if item not in things_I_do_not_want:
   things_I_want.append(item)

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


[issue25788] fileinput.hook_encoded has no way to pass arguments to codecs

2015-12-03 Thread Laura Creighton

New submission from Laura Creighton:

Right now there is no way, aside from writing your own openhook, to
get around the limitation that openhook=fileinput.hook_encoded("utf")
will open things with the default option for codecs.open()
of errors=strict.  Adding a way to pass the errors argument seems
both easy to do and useful.

--
components: IO
messages: 255818
nosy: lac, serhiy.storchaka
priority: normal
severity: normal
status: open
title: fileinput.hook_encoded has no way to pass arguments to codecs
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25788>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: getting fileinput to do errors='ignore' or 'replace'?

2015-12-03 Thread Laura Creighton
In a message of Thu, 03 Dec 2015 15:12:15 +, Adam Funk writes:
>I'm having trouble with some input files that are almost all proper
>UTF-8 but with a couple of troublesome characters mixed in, which I'd
>like to ignore instead of throwing ValueError.  I've found the
>openhook for the encoding
>
>for line in fileinput.input(options.files, 
>openhook=fileinput.hook_encoded("utf-8")):
>do_stuff(line)
>
>which the documentation describes as "a hook which opens each file
>with codecs.open(), using the given encoding to read the file", but
>I'd like codecs.open() to also have the errors='ignore' or
>errors='replace' effect.  Is it possible to do this?
>
>Thanks.

This should be both easy to add, and useful, and I happen to know that
fileinput is being hacked on by Serhiy Storchaka right now, who agrees
that this would be easy.  So, with his approval, I stuck this into the
tracker.  http://bugs.python.org/issue25788  

Future Pythons may not have the problem.

Laura

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


[issue25788] fileinput.hook_encoded has no way to pass arguments to codecs

2015-12-03 Thread Laura Creighton

Laura Creighton added the comment:

I haven't made a patch to Python for over 10 years. Before mercurial. :) Where 
do you start in terms of 'how to submit a patch'?

--
components:  -Library (Lib)
type: enhancement -> 
versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25788>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Idle, tk and MacOS

2015-12-03 Thread Laura Creighton
This in to webmaster.  Somebody got an error message about their
Tcl/Tk when they started using IDLE.  

They went to https://www.python.org/download/mac/tcltk/
and, yes indeed, their tk is 8.5.9, their OS is 10.8.5 so they
have a problem.  They downloaded the patch from ActiveState,
and did _something_ which reported 'installation successful'.

But when they restart Idle it still has 8.5.9

What else do they need to do?

Laura

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


Re: getting fileinput to do errors='ignore' or 'replace'?

2015-12-03 Thread Laura Creighton
In a message of Thu, 03 Dec 2015 19:17:51 +, Adam Funk writes:
>On 2015-12-03, Laura Creighton wrote:
>
>> In a message of Thu, 03 Dec 2015 15:12:15 +, Adam Funk writes:
>>>I'm having trouble with some input files that are almost all proper
>>>UTF-8 but with a couple of troublesome characters mixed in, which I'd
>>>like to ignore instead of throwing ValueError.  I've found the
>>>openhook for the encoding
>>>
>>>for line in fileinput.input(options.files, 
>>>openhook=fileinput.hook_encoded("utf-8")):
>>>do_stuff(line)
>>>
>>>which the documentation describes as "a hook which opens each file
>>>with codecs.open(), using the given encoding to read the file", but
>>>I'd like codecs.open() to also have the errors='ignore' or
>>>errors='replace' effect.  Is it possible to do this?
>>>
>>>Thanks.
>>
>> This should be both easy to add, and useful, and I happen to know that
>> fileinput is being hacked on by Serhiy Storchaka right now, who agrees
>> that this would be easy.  So, with his approval, I stuck this into the
>> tracker.  http://bugs.python.org/issue25788  
>>
>> Future Pythons may not have the problem.
>
>Good to know, thanks.

Well, we have moved right along to 'You write the patch, Laura' so I
can pretty much guarantee that future Pythons won't have the problem. :)

Laura

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


Re: Idle, tk and MacOS

2015-12-03 Thread Laura Creighton
In a message of Thu, 03 Dec 2015 20:34:10 +0100, Laura Creighton writes:
>This in to webmaster.  Somebody got an error message about their
>Tcl/Tk when they started using IDLE.  
>
>They went to https://www.python.org/download/mac/tcltk/
>and, yes indeed, their tk is 8.5.9, their OS is 10.8.5 so they
>have a problem.  They downloaded the patch from ActiveState,
>and did _something_ which reported 'installation successful'.
>
>But when they restart Idle it still has 8.5.9
>
>What else do they need to do?
>
>Laura

The OP reported that trying to do it again seems to have worked
great, so I guess something went wrong the first time.

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


Re: Installation Problem

2015-12-02 Thread Laura Creighton
In a message of Wed, 02 Dec 2015 14:42:48 +, Mark Lawrence writes:
>On 02/12/2015 13:59, Laura Creighton wrote:
>> In a message of Wed, 02 Dec 2015 13:30:38 +, Mark Lawrence writes:
>>> 0) before asking search for "python installation problem" just in case
>>> you're not the first person to have this issue.
>>
>> That is not a good idea, there are so many different hits for that.
>> The first one I get is this:
>> http://superuser.com/questions/613820/error-installing-python-on-windows-7-x64
>>
>> which is unlikely to be the OP's problem.
>
>So you are advocating that people keep on asking the same question, even 
>if it has been asked twice a day for the last month?

Yes.  It is old for us, but nobody should be giving 2 hoots about 
our feelings.  Since we can just ignore such things.  The problem 
is always fresh and new for the poster.

>  Wouldn't it be 
>better to advise people to restrict their search to maybe the last month 
>or even week, or do a site specific search, or even check the mailing 
>list archives?

They are already getting the advice to ask the question on python-list.
This is the preferred way to get such problems solved.  We even have
automated mailer responses telling people to ask such questions here.
We don't warn them that they are about to meet anti-social and egotistical
people who think that they should take every opportunity to be 
sarcastic that presents itself.

You also have a woefully inadequate understanding of ignorance.
See Kruger Dunnign effect:
https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
People in the bottom quartile of comprehension of anything -- i.e.
the most ignorant -- lack the metacognative skills to recognise
the solutions to their problems even when they are presented in
a clear and logical fashion.  Thus the most ignorant can not be expected 
to just google up an answer, because even if they got one, they wouldn't 
be able to recognise it.

It's bad enough when they miss solutions out there.  It's worse when
they try to do things that work for one OS on another, or one version
of an OS on another, and so on and so forth.  

Much, much better that these people come and ask quesitons.

>It's not funny, but it does show the number of times that the question 
>asked is often less than useless.  Personally I'm tired of the fit bib, 
>spoon feed, change nappy brigade, who IMHO are doing far more harm than 
>good.

I think you should stay away from python-list, then, until your sense
of humour returns and your ability to deal with the abysmally ignorant
matures.  Because this is where we actually want to get a hold of 
such people so we can teach them things, and the active and vocal
presence of people who resent them for being ignorant makes the job
a whole lot harder.

Laura

>Mark Lawrence

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


Re: Is Microsoft Windows secretly downloading childporn to your computer ?!

2015-12-02 Thread Laura Creighton
In a message of Wed, 02 Dec 2015 08:36:24 -0800, Keith Thompson writes:

>"We must do something.  This is something.  Therefore, we must do this."
>-- Antony Jay and Jonathan Lynn, "Yes Minister"

This is one of my favourite quotes of all time.  Unfortunately, you
have it slightly wrong.  The quote is:
Something must be done.  This is something.  Therefore we must do it.

cheers!
Laura

https://www.google.se/url?sa=t=j==s=web=2=rja=8=0ahUKEwjZvrXl0L3JAhVmJHIKHTBjCugQtwIIIjAB=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dtrw1PbQt_Yo=AFQjCNHEKrgju4vVOH_hmwnbn0zAWU0aEg=VwmILBUKi-vz7YCA5k_0ew

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


Re: python message

2015-12-02 Thread Laura Creighton
In a message of Wed, 02 Dec 2015 15:53:08 -0200, jorge.conr...@cptec.inpe.br wr
ites:
>
>
>
>Hi,
>
>
>I'm a new user of Pyhton and I run my code lenetcdf1.py and I plot the 
>figure but I had this message:
>
>
>/usr/lib64/python2.7/site-packages/matplotlib/collections.py:590: 
>FutureWarning: elementwise comparison failed; returning scalar instead, 
>but in the future will perform elementwise comparison
>   if self._edgecolors == str('face'):
>
>I do not understand this message. Atached it my code.
>
>
>What can I do to solve this message.
>
>Thanks in advance.
>
>
>Conrado

Your code did not get attached, but no matter.
Just ignore this one.
https://github.com/matplotlib/matplotlib/issues/5209

next release of matplotlib should fix it.

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


Re: stuff and nonsense

2015-12-02 Thread Laura Creighton
In a message of Wed, 02 Dec 2015 22:51:13 +, Denis McMahon writes:
>On Wed, 02 Dec 2015 11:32:25 -0600, Ian Kelly wrote:
>
>> In what way is discussion of a tangential topic feeding the troll? Said
>> troll is not even participating in the discussion.
>
>Reposting / responding / following up with the original subject boosts 
>the visibility of the subject to internet search engines because of the 
>way newsgroups get gated to websites.
>
>-- 
>Denis McMahon, denismfmcma...@gmail.com

That is not what I was told.  I was told that these days it is all
done by References: lines.  Thus changing the Subject no longer has
this effect.  Wrong?

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


Re: Does Python 2.7 do Open Office

2015-12-02 Thread Laura Creighton
In a message of Wed, 02 Dec 2015 18:50:34 -0500, Seymore4Head writes:
>I have a text file I would like to search through but I have tried it
>before.  I don't remember why they are not compatible together, but I
>wanted to ask to make sure.
>
>I know I can convert the file to plain text but it would be nice not
>to have to do that.
>
>-- 
>https://mail.python.org/mailman/listinfo/python-list

You are looking for PyUNO.Unfortuntately it is not well
documented, but I have heard good things about this as documentation.
https://documenthacker.wordpress.com/2013/03/05/first-draft-released/

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


Re: Installation Problem

2015-12-02 Thread Laura Creighton
In a message of Wed, 02 Dec 2015 12:08:02 +, Packie Kelly writes:
>Hi my name is Patrick,
>
>I have a problem regarding the installation of the latest version of
>python, everytime I install the program I keep getting the message modify,
>repair, uninstall. I've tried different versions but with no luck. Before
>you ask I have already completely removed the program.
>
>Looking forward to your reply

What Operating System?  If it is Windows XP, that is your problem.
Python 3.5 is not supported on Windows XP.  Either stick with 3.4 or
upgrade your OS to something more recent.

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


Re: Installation Problem

2015-12-02 Thread Laura Creighton
In a message of Wed, 02 Dec 2015 13:30:38 +, Mark Lawrence writes:
>0) before asking search for "python installation problem" just in case 
>you're not the first person to have this issue.

That is not a good idea, there are so many different hits for that.
The first one I get is this:
http://superuser.com/questions/613820/error-installing-python-on-windows-7-x64

which is unlikely to be the OP's problem.

I'd like it if people would stop mentioning crystal balls and the like
around here, which was funny once, but which has gotten extremely stale
since.  And if people whose first take on others is 'does this give me
an opportunity to be sarcastic' took it someplace else.  I get very
tired of hanging around people who think that sarcastic is clever.

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


python domain in China. This showed up on Python list

2015-12-01 Thread Laura Creighton
I think we have just dodged a bullet, let us now go thank the
nice people who sent us this and figure out how we should
secure the domain.

Laura


--- Forwarded Message

Return-Path: 
Date: Tue, 1 Dec 2015 15:12:58 +0800
From: "Ian Liu" 
To: 
Subject: python CN domain and keyword
Message-ID: <20151201151310456...@chinaregistry.org.cn>
X-mailer: Foxmail 6, 13, 102, 15 [cn]
Mime-Version: 1.0

(Please forward this to your CEO, because this is urgent. Thanks)


We are a Network Service Company which is the domain name registration
center in Shanghai, China. On Nov 30, 2015, we received an application
from Huasu Holdings Ltd requested "python" as their internet keyword
and China (CN) domain names. But after checking it, we find this name
conflict with your company name or trademark. In order to deal with
this matter better, it's necessary to send email to you and confirm
whether this company is your distributor or business partner in China?

Kind regards


Ian Liu
General Manager 
China Registry (Headquarters)
8052, Douhai Building, No. 59 Baolian Road, 
Shanghai, China
Tel: +86 21 6191 8696
Mobile: +86 138 1642 8671
Fax: +86 21 6191 8697
Web: www.chinaregistry.org.cn
- -- 
https://mail.python.org/mailman/listinfo/python-list

--- End of Forwarded Message
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python domain in China. This showed up on Python list

2015-12-01 Thread Laura Creighton
In a message of Tue, 01 Dec 2015 02:51:21 -0800, Chris Rebert writes:
>I hate to break it to you, but this seems to be just another of those
>come-ons spammed out by various scummy businesses that trawl WHOIS
>databases for people to scam into buying extra/unnecessary domain
>names. Google "chinese domain scam" for more info. I've received
>similar spams after having registered some .com domains that no
>corporation could possibly legitimately want the .cn equivalents of.

Ah...  Thank you Chris.  Sure fooled me.

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


Re: Python 3 virtualenvs

2015-11-30 Thread Laura Creighton
In a message of Mon, 30 Nov 2015 09:32:27 -0700, Carl Meyer writes:
>Hi Laura,

>I don't know what you mean by this. Venv is intended to do _exactly_
>what virtualenv does, only better. Unless by "what virtualenv does" you
>mean "also support Python 2."

That is exactly what I mean.

>> I think it is only meant to be used by people who want to install
>> packages but not site-wide, but I am not sure about that.
>
>I don't know what you mean by this either. Isn't the ability to "install
>packages but not site-wide" precisely what virtualenv (and venv) give you?

I rarely use it for that.  What I nearly always want is different
python interpreters.  CPython, PyPy, Jython for anything from 2.6 to
3.6.

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


Re: Caret key quits idle on pt keyboard

2015-11-30 Thread Laura Creighton
In a message of Tue, 01 Dec 2015 02:57:15 +1100, Chris Angelico writes:
>On Tue, Dec 1, 2015 at 2:10 AM, Random832  wrote:
>> On 2015-11-30, Chris Angelico  wrote:
>>> Hmm. This could be part of the known issues with Tk (on which Idle
>>> depends) and non-BMP characters, but a caret should be safe.
>>
>> Is there a known issue with dead keys? From what I can find the
>> Portuguese keyboard doesn't have a "proper" caret, it has a
>> circumflex dead key which you can press space or any non-vowel to
>> get a caret.  Seems to work fine for me though.
>
>Ah, that might explain it. I don't have a system to test it on,
>though. Definitely needs OS/Python version details.
>
>ChrisA

I have a Swedish keyboard which has a caret dead-key that works 
as Random832 describes.  Idle works perfectly well for me.

There are a bunch of MacOS specific idle keyboard bugs.  I wonder
if this is (possibly another) one of them.

Laura

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


Re: Python 3 virtualenvs

2015-11-30 Thread Laura Creighton
In a message of Mon, 30 Nov 2015 10:28:46 -0700, Carl Meyer writes:

>So I agree that for now you should be sticking with virtualenv (I use it
>too), but I hope you'll take another look at venv a few years down the
>road, if you find yourself in a situation where all the interpreters you
>need are 3.3+.

I will, but these days I am playing with fades, which I only discovered
a week ago, when Facundo made an announcment.
https://pypi.python.org/pypi/fades/3

And it looks like this will make my life a whole lot easier.

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


Re: Python 3 virtualenvs

2015-11-29 Thread Laura Creighton
In a message of Sun, 29 Nov 2015 13:23:19 +, Jon Ribbens writes:
>I don't know if, in future, pyvenv will be the way to go and
>virtualenv will be deprecated, but either way we do not appear
>to be there yet.

pyenv is going away.  python -m venv is the preferred way to get a venv

https://bugs.python.org/issue25154

Of course if you try it, you may get:

  Error: Command '['/bin/python3.4', '-Im', 'ensurepip', 
'--upgrade', '--default-pip']' returned non-zero exit status 1

which turns out to mean:

Your Python isn't configured with ensure-pip!

.

Right now, I personally don't know why there is a venv at all.  Despite
the similarity of names, it doesn't seem to be about doing what virtualenv
does.  I think it is only meant to be used by people who want to install
packages but not site-wide, but I am not sure about that.  I don't think
there are any plans to give venv the functionality of virtualenv, so
presumably there are people who like it just fine the way it is now.
They must have very different needs than I do.

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


Re: Python 3 virtualenvs

2015-11-29 Thread Laura Creighton
In a message of Sun, 29 Nov 2015 13:19:46 +0100, Lele Gaifax writes:
>Jon Ribbens  writes:
>
>> On 2015-11-28, D.M. Procida  
>> wrote:
>>>
>>> Is something else required?
>>
>> Debian's package management is mysterious and apparently bizarre
>> and frankly in respect to Python, not very good.
>
>I do not agree with you on the quality of Python support on Debian systems,
>but I think Daniele is missing the package "pythonX.Y-venv": they install the
>needed stuff, and in particular /usr/bin/pyvenv-X-Y.
>
>ciao, lele.

No, Pyvenv is precisely what Daniele can not use.
The problem is that venv does not come with a big sign saying

ONLY FOR PYTHON 3.x
ABSOLUTELY DOES NOT WORK FOR BUILDING 2.7 VIRTUALENVS
USE virtualenv INSTEAD for Python 2.7



which means you can waste a whole lot of time finding this out
the hard way.

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


[issue25514] better startup error messages in IDLE when stdlib modules shadowed

2015-11-29 Thread Laura Creighton

Laura Creighton added the comment:

webmaster got another one of these today.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25514>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: How can I count word frequency in a web site?

2015-11-29 Thread Laura Creighton
In a message of Sun, 29 Nov 2015 21:31:49 -0500, Cem Karan writes:
>You might want to look into Beautiful Soup 
>(https://pypi.python.org/pypi/beautifulsoup4), which is an HTML 
>screen-scraping tool.  I've never used it, but I've heard good things about it.
>
>Good luck,
>Cem Karan

http://codereview.stackexchange.com/questions/73887/finding-the-occurrences-of-all-words-in-movie-scripts

scrapes a site of movie scripts and then spits out the 10 most common
words.  I suspect the OP could modify this script to suit his or her needs.

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


Re: What use is this class?

2015-11-29 Thread Laura Creighton
In a message of Sun, 29 Nov 2015 13:36:58 -0800, fl writes:
>Hi,
>
>When I search around tutorial about None, I came across this link:
>
>http://jaredgrubb.blogspot.ca/2009/04/python-is-none-vs-none.html
>
>I don't understand what use of this class example:
>
>
>
 class Zero(): # a class that is zero
>...def __nonzero__(self):
>...   return False
>
>
>I can only get the following code running:
>
>cz1=Zero()
>cz1.__nonzero__()
>Out[119]: False
>
>
>Here are my questions:
>1. Is there any other means to use class Zero?
>2. What connection to None on the original author's intention?

The person who wrote this was curious as to why PEP 8 says:
"Comparisons to singletons like None should always be done 
 with 'is' or 'is not', never the equality operators."

He wrote this class to play around with, to see if it really made
a difference whether you write:

if x is None:

vs

if x == None:

and it does.  A class is free to implement its own version of '==' if
if likes, and there, 'being equal to None' might means something
complicated and crazy.  People who are just testing against None will
burn their fingers if they use '==' there.

Also its a bad problem when porting code to Jython.
A java null is supposed to be None.
But using '==' will call the underlying .equals method.
If you call that on a null, Java will spit out a Null Pointer Exception.

Laura

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


[issue25758] ensurepip/venv broken on Windows if path includes unicode

2015-11-28 Thread Laura Creighton

Changes by Laura Creighton <l...@openend.se>:


--
nosy: +Marcus.Smith, dstufft, ncoghlan, paul.moore

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25758>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: python response slow when running external DLL

2015-11-28 Thread Laura Creighton
In a message of Sat, 28 Nov 2015 11:13:38 +0100, Peter Otten writes:
>jf...@ms4.hinet.net wrote:
>> Using thread is obviously more logical. I think my mistake was the "while
>> busy:  pass" loop which makes no sense because it blocks the main thread,
>> just as the time.sleep() does. That's why in your link (and Laura's too)
>> the widget.after() scheduling was used for this purpose.

I never saw the reply that Peter is replying to.
The threading module constructs a higher level interface on top of the
low level thread module.  Thus it is the preferred way to go for
standard Python code -- and even Fredrik's recipe contains the
line:
import thread # should use the threading module instead!

Laura

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


Re: Find relative url in mixed text/html

2015-11-28 Thread Laura Creighton
In a message of Sun, 29 Nov 2015 00:25:07 +0800, Rob Hills writes:
>All that said, I'd be interested to see specific (and hopefully
>unbiased) info about phpBB's failings...

People I know of who run different bb software say that the spammers
really prefer phpBB.  So keeping it spam free is about 4 times the
work as for, for instance, IPB.

Hackers seem to like it too -- possibly due to this:
http://defensivedepth.com/2009/03/03/anatomy-of-a-hack-the-phpbbcom-attack/

make sure you aren't vulnerable.

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


Re: askopenfilename()

2015-11-28 Thread Laura Creighton
Maybe Wei Li Jiang's  hack will work for you?
http://stackoverflow.com/questions/3375227/how-to-give-tkinter-file-dialog-focus

But then see if it works under MacOS.  I fear it will not.

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


Re: Does Python allow variables to be passed into function for dynamic screen scraping?

2015-11-28 Thread Laura Creighton
In a message of Sat, 28 Nov 2015 14:03:10 -0800, ryguy7272 writes:
>I'm looking at this URL.
>https://en.wikipedia.org/wiki/Wikipedia:Unusual_place_names
>
>If I hit F12 I can see tags such as these:
>And so on and so forth.  
>
>I'm wondering if someone can share a script, or a function, that will allow me 
>to pass in variables and download (or simply print) the results.  I saw a 
>sample online that I thought would work, and I made a few modifications but 
>now I keep getting a message that says: ValueError: All objects passed were 
>None
>
>Here's the script that I'm playing around with.
>
>import requests
>import pandas as pd
>from bs4 import BeautifulSoup
>
>#Get the relevant webpage set the data up for parsing
>url = "https://en.wikipedia.org/wiki/Wikipedia:Unusual_place_names;
>r = requests.get(url)
>soup=BeautifulSoup(r.content,"lxml")
>
>#set up a function to parse the "soup" for each category of information and 
>put it in a DataFrame
>def get_match_info(soup,tag,class_name):
>info_array=[]
>for info in soup.find_all('%s'%tag,attrs={'class':'%s'%class_name}):
>return pd.DataFrame(info_array)
>
>#for each category pass the above function the relevant information i.e. tag 
>names
>tag1 = get_match_info(soup,"td","title")
>tag2 = get_match_info(soup,"td","class")
>
>#Concatenate the DataFrames to present a final table of all the above info 
>match_info = pd.concat([tag1,tag2],ignore_index=False,axis=1)
>
>print match_info
>
>I'd greatly appreciate any help with this.

Post your error traceback.  If you are getting Value Errors about None,
then probably something you expect to return a match, isn't.  But without
the actual error, we cannot help much.

Laura

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


Re: Does Python allow variables to be passed into function for dynamic screen scraping?

2015-11-28 Thread Laura Creighton
In a message of Sat, 28 Nov 2015 14:37:26 -0800, ryguy7272 writes:
>On Saturday, November 28, 2015 at 5:28:55 PM UTC-5, Laura Creighton wrote:
>> In a message of Sat, 28 Nov 2015 14:03:10 -0800, ryguy7272 writes:
>> >I'm looking at this URL.
>> >https://en.wikipedia.org/wiki/Wikipedia:Unusual_place_names
>> >
>> >If I hit F12 I can see tags such as these:
>> >> >> >And so on and so forth.  
>> >
>> >I'm wondering if someone can share a script, or a function, that will allow 
>> >me to pass in variables and download (or simply print) the results.  I saw 
>> >a sample online that I thought would work, and I made a few modifications 
>> >but now I keep getting a message that says: ValueError: All objects passed 
>> >were None
>> >
>> >Here's the script that I'm playing around with.
>> >
>> >import requests
>> >import pandas as pd
>> >from bs4 import BeautifulSoup
>> >
>> >#Get the relevant webpage set the data up for parsing
>> >url = "https://en.wikipedia.org/wiki/Wikipedia:Unusual_place_names;
>> >r = requests.get(url)
>> >soup=BeautifulSoup(r.content,"lxml")
>> >
>> >#set up a function to parse the "soup" for each category of information and 
>> >put it in a DataFrame
>> >def get_match_info(soup,tag,class_name):
>> >info_array=[]
>> >for info in soup.find_all('%s'%tag,attrs={'class':'%s'%class_name}):
>> >return pd.DataFrame(info_array)
>> >
>> >#for each category pass the above function the relevant information i.e. 
>> >tag names
>> >tag1 = get_match_info(soup,"td","title")
>> >tag2 = get_match_info(soup,"td","class")
>> >
>> >#Concatenate the DataFrames to present a final table of all the above info 
>> >match_info = pd.concat([tag1,tag2],ignore_index=False,axis=1)
>> >
>> >print match_info
>> >
>> >I'd greatly appreciate any help with this.
>> 
>> Post your error traceback.  If you are getting Value Errors about None,
>> then probably something you expect to return a match, isn't.  But without
>> the actual error, we cannot help much.
>> 
>> Laura
>
>
>Ok.  How do I post the error traceback?  I'm using Spyder Python 2.7.

You cut and paste it out of wherever you are reading it, and paste it
into the email, along with your code, also cut and pasted from somewhere
(like an editor).  That way we get the exact code that caused the exact
traceback you are getting.

Laura

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


Re: python response slow when running external DLL

2015-11-27 Thread Laura Creighton
In a message of Fri, 27 Nov 2015 13:20:03 +0100, Peter Otten writes:

>A cleaner solution can indeed involve threads; you might adapt the approach 
>from  (Python 2 code).

But it is probably better to use threading

http://code.activestate.com/recipes/82965-threads-tkinter-and-asynchronous-io/

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


Re: What is a function parameter =[] for?

2015-11-27 Thread Laura Creighton
In a message of Fri, 27 Nov 2015 23:57:29 +1100, "Steven D'Aprano" writes:
>On Fri, 27 Nov 2015 01:56 pm, MRAB wrote:
>
>> On 2015-11-27 02:44, Steven D'Aprano wrote:
>
>>> The PyPy implementation has to take special actions to preserve the ID
>>> across object recreations. That is what I mean by "faked".
>>>
>> You could argue that it _does_ continue to exist, it just changes its
>> form...
>
>*Something* continues to exist, but it is no longer an object.
>
>I like Chris' analogy of it being like quantum mechanics -- the *object*
>isn't guaranteed to exist except when you try to access it, until then you
>don't know what form it will take at any instance.

I think it's just another instance of Just-In-Time Manufacturing
https://en.wikipedia.org/wiki/Just-in-time_manufacturing

"As soon as you need a object, we'll have one ready". :)

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


Re: Faviourite improvements in Python 3.5 (was: Python 3 virtualenvs)

2015-11-27 Thread Laura Creighton
In a message of Sat, 28 Nov 2015 12:42:30 +1100, Ben Finney writes:
>Laura Creighton <l...@openend.se> writes:
>
>> […] python3.5 which I infinitely prefer over 3.4. 
>
>That's strong language :-)
>
>Laura – and anyone else – what in your opinion are the best improvements
>brought by Python 3.5 (over Python 3.4)?

The interactive console started working again.
https://bugs.python.org/issue23441

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


Re: Python 3 virtualenvs

2015-11-27 Thread Laura Creighton
In a message of Sat, 28 Nov 2015 00:37:21 +, D.M. Procida writes:
>I have a new installation of Debian Jessie, with Python 2.7 and 3.4
>installed.
>
>I want to use Python 3.4 by default for most things, so I want
>virtualenv to create Python 3.4 virtualenvs unless I ask it to
>otherwise.
>
>It turns out that this seems to be inordinately complex.
>
>The best solution I have come up with is to alias virtualenv to
>'virtualenv -p python3.5', which seems really ugly and clunky.

This will get you python3.5 which I infinitely prefer over 3.4. 
But you said you wanted to use 3.4 ...

>Then I discover things like
>
>and realise it's not just me, it really is a nasty mess and nobody seems
>to understand what's going on.
>
>Daniele

What I found out.
https://bugs.python.org/issue25151
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=732703
https://bugs.python.org/issue25152
https://bugs.python.org/issue25154

pyenv is going away.  use python -m venv instead, if you want a 
venv.  You will never (unless somebody does a backport, which seems
very unlikley) be able to get a venv with 2.7.

I've long ago aliased virtualenv to v, so things aren't as clunky
for me.

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


[issue25741] Usual Installation Directory

2015-11-27 Thread Laura Creighton

Laura Creighton added the comment:

Where does it go if the user hasn't set %LOCALAPPDATA% ?

--
nosy: +lac

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25741>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Help with this program???

2015-11-27 Thread Laura Creighton
In a message of Fri, 27 Nov 2015 01:43:53 -0800, justin bloomer via Python-list
 writes:
>Your program should contain a function that:
>1. Seeks input from the user (via the keyboard);
>2. To build a list of student exam results;
>3. For each student their name (first and last), student number, and mark
>out of 100 should be captured;
>4. For full marks regular expressions or similar mechanisms should be used
>to ensure the data appears valid.

Hello.

We don't do people's assignments for them.
However, over on the tutor mailing list,
https://mail.python.org/mailman/listinfo/tutor
we do help people who are learning Python.

You will have to post your code, along with any error messages
you get and explain what you were trying to do.

Laura


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


[issue25741] Usual Installation Directory

2015-11-27 Thread Laura Creighton

Laura Creighton added the comment:

I don't know the answer, but from the point of view of a webmaster who
gets support requests and doesn't have a windows system, it would be
very useful to already know where a person's python is supposed to
be, and thus good if the documentation said something along the
lines of:

If the user does not specify %LOCALAPPDATA% then it defaults to
 

assuming there is such a default, of course.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25741>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Python on windows 10

2015-11-26 Thread Laura Creighton
In a message of Wed, 25 Nov 2015 20:34:01 +, francis funari writes:
>I have tried installing Python 3 on windows 10 it install OK but I do not get 
>Idle. When I type Idle in the interpreter nothing happen can you send me a 
>link to latest release of Python 3 with Idle that will run on windows 10 64 bit
>   
>Thankyou Francis Funari
>
>Sent from Mail<http://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
>-- 
>https://mail.python.org/mailman/listinfo/python-list

Sorry to hear you are having problems.

Can you please go to a command window and type

python -m idlelib  

This should fail.  However, it should fail with a meaningful traceback
which indicates where the problem is.  Copy and paste that traceback 
into mail and post that here so we have proceed.

If 'python' isn't the command you need to use to get python3.5 
perhaps py -3.5 -m idlelib will work.  But the idea is we want to
catch idle failing, so we can figure out what is going on.

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


Re: read 4D binary data

2015-11-26 Thread Laura Creighton
In a message of Thu, 26 Nov 2015 15:15:43 -0200, jorge.conr...@cptec.inpe.br wr
ites:
>Hi,
>
>
>I'm startig in Python and I have a 4D binary data. The dimension of my 
>data is:
>
>67 > longitude points
>41 > latitude points
>10 > pressure levels points
>33 > time points
>
>
>How can I read this data and what can I do to get a 2D array 
>(longitude,latitude) for a specific pressure  and time dimension.
>
>
>Conrado

If your binary data is all of the same type -- these are all floats,
or all ints -- you can use the python array module to read it.
https://docs.python.org/3/library/array.html

If they are heterogenous then you cannot use array, but can use struct
https://docs.python.org/3.5/library/struct.html

If I were you, I would want to get my data into pandas, which is
the best tool for data analysis
http://pandas.pydata.org/

And I would do this pretty much exactly as 
Albert Jan outlines in this stackoverflow question.
http://stackoverflow.com/questions/16573089/reading-binary-data-into-pandas
though, as I said, if your data is homogeneous you can use the array
module instead of using the struct one.  But struct will work on
homogenous data as well -- it is just slower.  You may not care.

Note that Albert Jan's answer is the one on the bottom, i.e. not the
one that got the checkmark from the original poster.

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


Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread Laura Creighton
In a message of Wed, 25 Nov 2015 07:13:41 -0800, Ned Batchelder writes:
>That's because it's a programming language, and very very little about
>programming languages is obvious.  The best we can hope for is "familiar,"
>and even then, familiar to who?  High school algebra students will at
>first be baffled by "x = x + 1", an equation which is clearly
>unsatisfiable.

The great sticking point for the children I am teaching is
'*' means multiplication.  You can really see that some people 
have to make extensive mental modifications in order to handle
the concept that mathematical truths are expressed in linguistic
and orthographic conventions, and that one can swap out a particular
convention 'x means multiply' and swap in another one '* means
multiply' while leaving the underlying truth unchanged.

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


Re: Help needed with compiling python

2015-11-25 Thread Laura Creighton
In a message of Wed, 25 Nov 2015 22:52:23 +0100, Cecil Westerhof writes:
>
>My system python was all-ready damaged: that is why I wanted to build
>myself.

Your Suse system probably wants to use python for something.  If your
system python is damaged, you badly need to fix that, using the 
system package managers tools, before Suse does some sort of update
on you, using the broken python, which damages more of your system.

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


Re: Multiplication [was Re: Late-binding of function defaults]

2015-11-25 Thread Laura Creighton
In a message of Thu, 26 Nov 2015 05:09:13 +1100, "Steven D'Aprano" writes:
>On Thu, 26 Nov 2015 02:59 am, Laura Creighton wrote:
>
>> The great sticking point for the children I am teaching is
>> '*' means multiplication.  You can really see that some people
>> have to make extensive mental modifications in order to handle
>> the concept that mathematical truths are expressed in linguistic
>> and orthographic conventions, and that one can swap out a particular
>> convention 'x means multiply' and swap in another one '* means
>> multiply' while leaving the underlying truth unchanged.
>
>Wow. What age children are you talking about?

12 and 13 and 14 year olds. Smart 12, 13 and 14 year olds.

They want to build web servers and host pictures of their pets.
and use the gimp to do image manipulation like crazy. They are
as interested in art as much as, or perhaps even more so than
in programming -- they just need to learn enough programming to
get to make the art and serve it up.

Designing your own Magic The Gathering cards, which has manipulated
pictures of your friends on them, and then using them to play games 
with said friends has been the craze since September.

It's not that the idea of we will use '*' is hard, but if you have
never thought about the difference between THE TRUTH and the notation
used to express the truth before, then well, you may need some time
to get used to the idea.

Laura


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


Re: Istalling python

2015-11-25 Thread Laura Creighton
In a message of Wed, 25 Nov 2015 04:22:54 +, ARONA KANAGARATHNA via Python-
list writes:
>I tried to install this software python 3.4.3 to my pc which run windows Xp 
>32. i could installed but it doesnot run.it gives this message 
>"python35-32/python.exe isnot a valid win32 app.Please help me to get solved 
>this problem
>Thanks
>Aruna

The 'python35-32' part means that what you were trying to do was
install python3.5 not 3.4.3

And that is what did not work.  The reason that it did not work is
that 3.5 does not run on windows xp.  3.4 is the latest version you
can use.  So, you can either change your operating system, and
then get 3.5, or you can find 3.4.3 over here:
https://www.python.org/downloads/release/python-343/
(downloads on the bottom of the page).

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


Re: What is a function parameter =[] for?

2015-11-24 Thread Laura Creighton
In a message of Wed, 25 Nov 2015 11:39:54 +1100, "Steven D'Aprano" writes:
>I'm not sure what value [ha, see what I did there?!] there is in inventing
>two new words for things that we already have standard terms for.

Done correctly, you can get clarity.

>"Referent" is just a funny way of saying "object", and "evalue" is just a
>misspelling of "value".

If I had a time machine, I would go back to early days of Python and
ban the use of the term 'assignment' and 'value' both.  I would insist
that the term 'binding' be used instead, though if you want to use the
verb refer, to be synonymous with bind, well, I think that would work.
(If not, next trip with the time machine, I ban that one as well.)
Then you make it perfectly clear that what are bound are _objects_
not values (or evalues).  The object has an evalue, but it is the
object that is bound.

It is crystal clear than people on this list mean very different
things when they use the term 'value', and every one of them thinks
that Python agrees with them.  Cutting this knot may require a new
word.

Laura

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


Re: Persistent api-ms-win-crt-runtime-i1-1-0.dll start up error

2015-11-24 Thread Laura Creighton
In a message of Tue, 24 Nov 2015 10:56:32 +0200, tolga.karabiyiko...@ankara.edu
.tr writes:
>Hi all;
>
>Yesterday just downloaded python-3.5.0-amd64 on windows10 running 
>laptop- running flawless.
>
>But my trouble is with my office desktop Windows Vista. Considering the 
>processor diference, this time, downloaded the python-3.5.0 (32 bit) 
>version.
>The question is i am receiving 'api-ms-win-crt-runtime-i1-1-0.dll is 
>missing' error on the start up. I think i did update my Visual C++ 
>Redistributable gear downloading and running vcredist_x86.exe (32 bit)  
>but could not get rid off the error.
>
>Do you have any other recipe for me
>-- 
>https://mail.python.org/mailman/listinfo/python-list

Yes.

You appear to have this problem.

https://bugs.python.org/issue25223

Installing http://www.microsoft.com/en-us/download/details.aspx?id=48234
directly seems to fix it.

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


Re: pip does not work anymore

2015-11-23 Thread Laura Creighton
In a message of Mon, 23 Nov 2015 08:48:54 +0100, Cecil Westerhof writes:
>When I try to install something with pip2 I get:
>Traceback (most recent call last):
>  File "/usr/bin/pip2", line 9, in 
>load_entry_point('pip==7.1.2', 'console_scripts', 'pip2')()
>  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 
> 558, in load_entry_point
>return get_distribution(dist).load_entry_point(group, name)
>  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 
> 2682, in load_entry_point
>return ep.load()
>  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 
> 2355, in load
>return self.resolve()
>  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 
> 2361, in resolve
>module = __import__(self.module_name, fromlist=['__name__'], level=0)
>  File "/usr/lib/python2.7/site-packages/pip/__init__.py", line 15, in 
> 
>from pip.vcs import git, mercurial, subversion, bazaar  # noqa
>  File "/usr/lib/python2.7/site-packages/pip/vcs/subversion.py", line 9, 
> in 
>from pip.index import Link
>  File "/usr/lib/python2.7/site-packages/pip/index.py", line 30, in 
> 
>from pip.wheel import Wheel, wheel_ext
>  File "/usr/lib/python2.7/site-packages/pip/wheel.py", line 35, in 
> 
>from pip._vendor.distlib.scripts import ScriptMaker
>  File "/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py", 
> line 14, in 
>from .compat import sysconfig, detect_encoding, ZipFile
>  File "/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.py", 
> line 31, in 
>from urllib2 import (Request, urlopen, URLError, HTTPError,
>ImportError: cannot import name HTTPSHandler
>
>With pip3 I get the same problem.
>
>It looks like openSUSE has done an upgrade in which it disabled ssl2.
>How can I get pip2/3 working again?
>
>-- 
>Cecil Westerhof
>Senior Software Engineer
>LinkedIn: http://www.linkedin.com/in/cecilwesterhof
>-- 
>https://mail.python.org/mailman/listinfo/python-list

Reading 
https://forums.opensuse.org/showthread.php/488962-OpenSuse-python-amp-openssl
seems to indicatew that you are supposed to use python-pip and not pip
for OpenSuse, but I don't have one, so that is just my interpretation.

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


Re: Problem to read from array

2015-11-21 Thread Laura Creighton
In Python we don't write while loops that often.
instead we do:

for i in range(NumberOfColumns):
for j in range(NumberOfRows):
do_something()

But for the particular case that you are after, constructing lists,
we have something even neater -- list comprehensions.

So you might write:

 >>> newarray=[]
 >>> for i in range(3):
 ... newarray[i] = i

And this would not work.

Traceback (most recent call last):
  File "", line 2, in 
IndexError: list assignment index out of range

At this point you might get a bit frustrated.  Python is happily telling
you that you don't have a newarray[0][0] which is hardly news to you who
was trying to initialise the thing.

The trick is to initialise it with a list comprehension.

You write one like this:
[ calculate_something() for i in range(LIMIT)]

This works:
 >>> newarray = [i for i in range(3)]
 >>> newarray 
[0, 1, 2]
 >>> 

As does
 >>> newarray = ["hello" for i in range(3)]
 >>> newarray
['hello', 'hello', 'hello']

You can even build your lists with a condition:
 >>> even_numbers=[x for x in range(11) if x % 2 == 0]
 >>> even_numbers
[0, 2, 4, 6, 8, 10]

You are not limited to one dimentional arrays (lists) here.  You
can have much more complicated expressions as the calculate_something.

 >>> newarray =[[ [x+2000, y*y] for x in range(3)] for y in range(5)]
 >>> newarray
[[[2000, 0], [2001, 0], [2002, 0]], [[2000, 1], [2001, 1], [2002, 1]], 
[[2000, 4], [2001, 4], [2002, 4]], [[2000, 9], [2001, 9], [2002, 9]], 
[[2000, 16], [2001, 16], [2002, 16]]]

Which leads us to a particularly useful construct:
 >>> emptyarray =[[ [] for x in range(3)] for y in range(5)]
 >>> emptyarray
[[[], [], []], [[], [], []], [[], [], []], [[], [], []], [[], [], []]]

Bingo.  Now you won't have any index errors when you try to append
to your x,y values.

Hope this is useful.
Also, there is the tutor mailing list
https://mail.python.org/mailman/listinfo/tutor
which you might be interested in, where we discuss things like this.
Peter Otten is there, too.

Laura

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


Re: Problem to read from array

2015-11-21 Thread Laura Creighton
In a message of Sat, 21 Nov 2015 15:22:55 +0100, Laura Creighton writes:
>At this point you might get a bit frustrated.  Python is happily telling
>you that you don't have a newarray[0][0] which is hardly news to you who
>was trying to initialise the thing.

My bad.  I was thinking about 2 dimentional arrays, but of course that
error is just that newarray[0] doesn't exit.

(So why is it that I can read an article 3 times, find no more errors,
post it, and _then_ discover one?!)

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


Re: What is a function parameter =[] for?

2015-11-19 Thread Laura Creighton
In a message of Thu, 19 Nov 2015 16:36:17 -0800, Ned Batchelder writes:
>On Thursday, November 19, 2015 at 7:28:44 PM UTC-5, Steven D'Aprano wrote:
>> On Fri, 20 Nov 2015 05:50 am, BartC wrote:
>> 
>> 
>> > I said that Python's "=" does a very shallow copy. And I stated that in
>> > A=B, something of B must be copied into A.
>> > 
>> > I (and probably others) would like to know why none of that is correct.
>> > But I suspect I'm not wrong.
>> 
>> Nothing of B is copied.
>
>I think we are stuck in a simple terminology conflict here.  There is something
>of B copied.  The name B refers to a value.  In CPython, that reference is a
>pointer.  That pointer (the memory address) is copied from B to A.
>
>Nothing of "B's value", that is, the object B is referring to, is copied. But
>there is something about B (the pointer to its value) that is now also 
>something
>about A, because A also has that pointer.
>
>--Ned.

In PyPy we do this too.
But we don't copy a memory-address pointer.
We have a moving garbage collector, and no objects are in any way
guaranteed to be at their last memory address.

We copy a thing that, when you ask it nicely, spits out "where the hell
is the object right now,  because I want to modify it."

But this thing is in no way tied to any particular place in any DRAM.
It hits PyPy at an abstraction layer above that of 'we write 1s and 0s
here' so if you want to implement python on a message passing system
implemented by carrier pigeon, we could do this.  It would be slow,
however. :)

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


Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-19 Thread Laura Creighton
In a message of Fri, 20 Nov 2015 06:46:42 +1100, Chris Angelico writes:

>Would this satisfy the people who get confused about "=[]"?
>
>ChrisA

My experience says that the people who are confused want lists to
behave like tuples.  period.  i.e. they don't want lists to be 
mutable.  Which means when I say 'use a tuple instead' they go
away happy. Lots of very occasional programmers in my world (children)
just use tuples instead of lists and never get surprises and 
never go on to learn about lists and why they are a good idea.

But then there are those who come back with the problem:
'my python program is too slow'.  From a perspective of
'Let us understand why this is so and what could we do to make
things faster', I can get them to come up with the idea of a 
python list all on their own.  But this requires the sort of
brain that is interested in how interpreters work, otherwise
this conversation will not happen.

Without the actual problem biting them, the whole idea of
mutable objects seems, ah, hazardous.  I wonder if we do people
a disservice by introducing them straight off in teaching python
to absolute beginners, and if the learning would go easier if
we taught tuples and made them all use them a while before we
gave them lists.

At any rate, 'what is a mutable object' is a conversation that I 
have had too many times with people who really aren't interested.
I now think that 'use a tuple instead' is the way to go, with the
addition -- come back and talk to me about this at any time if you
want to learn why this is so.

Laura

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


Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-19 Thread Laura Creighton
In a message of Thu, 19 Nov 2015 22:57:10 +0200, Marko Rauhamaa writes:
>Laura Creighton <l...@openend.se>:
>
>> My experience says that the people who are confused want lists to
>> behave like tuples. period. i.e. they don't want lists to be mutable.
>
>I think it's simpler than that. When you have:
>
>   def f(x=[]):
>   y = []
>
>the first [] is evaluated when "def" is executed, while the latter [] is
>evaluated whenever "f" is executed. It's easy to be confused.
>
>
>Marko

Note: Ned Bachelder (who is probably reading this on python-list
anyway added cc on this mail, as if I am to discuss somebody, however
briefly, they deserve to hear about it.  Which may irritate him to
get 2 copies instead of one, but so it goes.  I am talking about
BartC as well, but since this is his thread, I assume he is here.)

Now back to what Marko said:

This is one of the times when it is nice to be dealing with children.
The whole notion of 'when def is executed' is not on their radar
at all.  It is all a matter of 'I write this, I want that'. :)

And with reasonable amount of authority from experience, I can
tell you that 'write it with round brackets not square ones'
makes the code *just work* for a large number of students who
only have a limited amount of patience for 'understanding 
what they are doing'.  They want to be able to do it first,
and have understanding come later (if at all).

This is the learning approach of 'training' as opposed to
'educating'.  And, for all that we _talk_ of 'educating our
children' -- what we really do, a whole lot of the time, is
train them.  The very basic skills of reading, writing (typing?) 
and arithmetic and foreign languages  need to be trained, and no
amount of understanding the theory behind such things will
ever directly translate into being able to do it.

Indeed, the best authority on the planet on 13th century French court
dances is a one-legged Frenchman, (whose name I now forget).
Although he has (or maybe had, he is likely dead by now, he lost
his leg in WW2) the education and the theory and the scholasticism, 
anybody with 2 legs, however ignorant, can dance the court dances
better. 

Sometimes you want to understand what you are doing.  Sometimes
you just want to do it.  And sometimes, well, the only real way 
to get an understanding of what you are doing is to do it more.
This is, in my opinion, Bartc's problem. He doesn't program in
python enough to understand it more.  He wants us to give him
a better theoretical understanding of Python, but for me, at 
any rate he is hitting the wrong audience.  And Ned Batchelder
is unlikely to help.  Both of us come from the practical end
of things, and write lessons and talks like the one ChrisA
recommended -- which is wonderful.  And how I wish I could 
write like that -- but they are aimed at telling a practical
python programmer 'now that you know how to do it, here is how
to understand what you do'.  And then, pedagogically, you can 
move to 'and now you understand what you have been doing, here
are some awesome cool tricks you can do to make your life easier
(and impress your friends, for a particularly nerdy set of
freinds).

I don't think that Ned works for the untrained python programmer.
And until Bart writes a bunch of code in python, for many weeks
or even months, I will not be able to help him, either.

But in my life, I end up teaching programming, often to some very
smart young people who are specialists at being trained. They want me
to train them, not educate them.  When you are 9 years old,
approaching all of life with the attitude of 'how do I get 
to spit out the results I want' is enormously adaptive.

They have the opposite problem of BartC -- they want to be excellent
programmers without understanding anything, while he wants to 
understand everything before he knows how to write decent python code.

It's a pedagogical problem.

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


Re: Dabbling in web development

2015-11-19 Thread Laura Creighton
In a message of Fri, 20 Nov 2015 01:07:24 +0200, Marko Rauhamaa writes:
>Laura Creighton <l...@openend.se>:
>
>> There are lots of other choices than Django.  
>>
>> see: https://wiki.python.org/moin/WebFrameworks/
>
>However, are there any good web applications? I have seen some heroic
>attempts but most fail miserably or at least have some annoying
>glitches.
>
>The cardinal sin of web development seems to be micromanagement. Instead
>of letting the web standards do their work, the application wants to be
>in full control with JavaScript and XML HTTP requests. The results can
>be awe-inspiring but at the same time fail at the basics. For example,
>select/copy with the mouse might not work. Fonts might be garbled. Half
>the page might be invisible and unscrollable. Or nothing will be
>displayed at all.
>
>
>Marko

But you see that whether or not you use a Heavy framework like
Django or a Microframework like Flask (which is all about how
to serve such things up  how you butcher the results is
your own business.)

Web design is a lot harder than most people who make webpages think.

So what else is new?

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


Re: Dabbling in web development

2015-11-19 Thread Laura Creighton
In a message of Thu, 19 Nov 2015 13:53:09 -0800, bSneddon writes:

>I know there are a plethora of web frameworks out there for Python
 and to be serious about website developement I should learn on like
 Django.  Really thought, I just want to dabble and do some easy
 stuff.  Does anyone have any suggestons?  I have a a website hosted
 with a hosting company who is supposed to have python support but
 hard to know what they have installed on there apache server.  I have
 seen a few examples out there but not too many.

There are lots of other choices than Django.  

see: https://wiki.python.org/moin/WebFrameworks/

The big split is whether you want a large framework, like Django, which
comes with all the batteries included, or a micro framework, like
Flask and Bottle, which gives you more control and is a whole lot
simpler.  

It is not the case that 'serious website developers use heavyweight
systems like Django' --- lots and lots of serious developers use 
Flask or Bottle because Django makes you do it the Django way.
Flask lets you do it however you like.  Professionally, our company
has designed a ton of websites and we use Flask nearly all of the
time, and Pylons the rest of the time.  If your brain is well-suited
for Django, by all means use that, but if it is not, then do something 
else.

I teach kids who are 9-12 years old, weekends.
Hosting their own site to support pictures of their pets is a very
common thing to want to do.

I have translated this:
http://bottlepy.org/docs/dev/tutorial.html

into Swedish and we tend to get a website up and running in 3 weekends
of thinking and coding.  (This is with kids who already know Python.
Learning enough python to do this takes longer, a whole lot longer
if you only get to code on weekends -- but most of the kids who want
to do this are also willing to write code on weekdays as well.)

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


Re: Dabbling in web development

2015-11-19 Thread Laura Creighton
In a message of Fri, 20 Nov 2015 10:09:01 +1100, Chris Angelico writes:
>On Fri, Nov 20, 2015 at 9:53 AM, Laura Creighton <l...@openend.se> wrote:
>> It is not the case that 'serious website developers use heavyweight
>> systems like Django' --- lots and lots of serious developers use
>> Flask or Bottle because Django makes you do it the Django way.
>> Flask lets you do it however you like.  Professionally, our company
>> has designed a ton of websites and we use Flask nearly all of the
>> time, and Pylons the rest of the time.  If your brain is well-suited
>> for Django, by all means use that, but if it is not, then do something
>> else.
>>
>> I teach kids who are 9-12 years old, weekends.
>> Hosting their own site to support pictures of their pets is a very
>> common thing to want to do.
>
>To add to the Flask recommendation: I teach adults (mostly; one of my
>students is in high school) to use Python, SQLAlchemy, and Flask,
>putting together a classic dynamic web site model. (I also use Flask
>myself for a couple of sites, and I like it; but that recommendation
>is weak because I don't have much experience with *other* frameworks.
>So all it means is "Flask hasn't majorly annoyed me".)
>
>ChrisA

Well, I highly recommend Flask, but the tutorial was for a
different microframework, 'Bottle'.

At the time I first collected the kids, it was a better tutorial.
Now, I suspect, there are lots of great ones for both of them.
But for me, the effort of translating any tutorial into Swedish
is huge.  Especially since I need to take a reputation hit with
every Swedish grammatical error my students find.  :)  The
students of 3 years ago have fixed my Swedish problems, mostly,
I think by now in this tutorial.

Being able to speak Swedish colloquially and read it does not 
mean you can write or translate it well enough to get your product
past the hyper-critical eyes of 11-year-olds who want evidence 
that this teacher, unlike so many others, can deliver the promised
goods. :)

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


Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?) (fwd)

2015-11-19 Thread Laura Creighton
Arrgh!

I got Ned Batchelder's email wrong.  Forgot the t.
(for somebody whose irc nick is nedbat.  )

sending this to him again.   warning any repliers that the
mail address is wrong

apologies,
Laura


--- Forwarded Message

From: Laura Creighton <l...@openend.se>
Subject: Re: Late-binding of function defaults (was Re: What is a function
 parameter =[] for?)
In-reply-to: <87d1v5emhl@elektro.pacujo.net>
References: 

Re: Public key encryption example.

2015-11-19 Thread Laura Creighton
In a message of Wed, 18 Nov 2015 16:18:28 -0700, Vincent Davis writes:
>This might be a "Let me Google that for you question", I tried.
>I am looking for the "simplest" example of sending(encrypting) and
>receiving(decrypting) using public key encryption. I am think of something
>along the lines of having all the keys in local files and saving and
>reading the message from a local file.
>
>Possibly using cryptography library elliptic-curve
>https://cryptography.io/en/latest/hazmat/primitives/asymmetric/ec/#elliptic-curve-signature-algorithms
>
>Surly there is an example out there?
>
>Vincent Davis

pycrypto does this.

https://pypi.python.org/pypi/pycrypto
code and diagrams here
http://www.laurentluce.com/posts/python-and-cryptography-with-pycrypto/

There really isn't much to it.

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


Re: PubMed / Entrez

2015-11-19 Thread Laura Creighton
In a message of Thu, 19 Nov 2015 09:17:35 +0100, c.bu...@posteo.jp writes:
>I am looking for a way to use the PubMed (medical research search
>engine) API (aka Entrez) with Python3.
>
>Does anyone know packages for that?

https://pypi.python.org/pypi/Bio_Eutils/1.63

Or just get BioPython and use the Entrez from that.

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


Re: Mapping between python packages and distro packages?

2015-11-18 Thread Laura Creighton
In a message of Wed, 18 Nov 2015 17:44:51 +1100, Chris Angelico writes:

>I don't know how the program would detect it, but I'd be thinking "the
>one where 'sudo apt-get install PACKAGENAME' gets the same code that
>'pip install THING' gets". In a lot of cases, PACKAGENAME will simply
>be python-THING or python3-THING, eg python3-sqlalchemy,
>python3-scipy, python3-bs4; as a human, that's what I'd try first. But
>having a program recognize this would be hugely beneficial.
>
>ChrisA

The problem is that this may not exist.  Debian developers, when faced
with a python package, may decide to break it up into several pieces,
and make several debian packagages.  If you want the same functionality
you have to load all of the debian packages, which of course involves
finding out what they are.

apt-cache search  works reasonably well, as long as you are
willing to put up with some false hits.  And it assumes you have a debian
system handy, of course.

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


Re: How to create a folder using IMAPLib?

2015-11-18 Thread Laura Creighton
In a message of Thu, 19 Nov 2015 07:35:36 +1100, Chris Angelico writes:
>On Thu, Nov 19, 2015 at 7:01 AM, Anthony Papillion
> wrote:
>> I'm writing a program to help migrate mail from one host to another
>> with a few special circumstances. I'm able to get a list off of the
>> source IMAP server using the .list() command but I'm not quite sure
>> how to create a folder on the target machine.
>>
>> Does anyone know how to create a folder using IMAPlib?
>
>They're called "mailboxes", which I'll admit is not the most obvious
>name, but imaplib is following the IMAP spec here. You can create them
>with .create() and delete them with .delete().
>
>ChrisA
>-- 
>https://mail.python.org/mailman/listinfo/python-list

Sample code here:
https://pymotw.com/2/imaplib/

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


Re: Matplotlib error: Value Error: x and y must have same first dimension

2015-11-13 Thread Laura Creighton
In a message of Thu, 12 Nov 2015 17:54:28 -0800, Abhishek writes:
>I am trying to run some Python code for the last few hours. How can I achieve 
>the effect of "dot divide" from Matlab, in the following code? I am having 
>trouble working with list comprehension and numpy arrays and getting the 
>following error:
>
>Traceback (most recent call last):
>  File "Thurs.py", line 128, in 
>plt.plot(np.array(range(1,N/2+2)), 
> Splot[alpha][iii,val]/utot[iii,val],color=cmap(iii/50))
>
>ValueError: x and y must have same first dimension

Splot is a list.  matplotlib wants 2 numpy arrays.  You have to cast
it with np.array() too.

no guarantees that the rest of the code works -- it is not plotting for
me -- but that gets rid of that error at any rate.

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


Re: Matplotlib error: Value Error: x and y must have same first dimension

2015-11-13 Thread Laura Creighton
In a message of Fri, 13 Nov 2015 14:04:01 +, Oscar Benjamin writes:
>On 13 November 2015 at 08:34, Laura Creighton <l...@openend.se> wrote:
>> In a message of Thu, 12 Nov 2015 17:54:28 -0800, Abhishek writes:
>>>I am trying to run some Python code for the last few hours. How can I 
>>>achieve the effect of "dot divide" from Matlab, in the following code? I am 
>>>having trouble working with list comprehension and numpy arrays and getting 
>>>the following error:
>>>
>>>Traceback (most recent call last):
>>>  File "Thurs.py", line 128, in 
>>>plt.plot(np.array(range(1,N/2+2)), 
>>> Splot[alpha][iii,val]/utot[iii,val],color=cmap(iii/50))
>>>
>>>ValueError: x and y must have same first dimension
>>
>> Splot is a list.  matplotlib wants 2 numpy arrays.  You have to cast
>> it with np.array() too.
>
>Actually the plot command is perfectly happy converting lists or lists
>of lists etc. to arrays (by calling np.array internally) so you don't
>need to convert any of your inputs. By the way: np.arange(1, N/2+2)
>would be the usual way to create a numpy array that is a range.
>
>The error here comes because (after both arguments are converted to
>arrays) they have incompatible sizes. In other words:
>
>len(range(1,N/2+2)) != len(Splot[alpha][iii,val]/utot[iii,val])
>
>I'm not sure what the solution is as the code is too complex for me to
>spend time trying to guess what it's trying to do.
>
>--
>Oscar

I am sorry for the bad information.  Thank you Oscar.

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


Re:

2015-11-13 Thread Laura Creighton
In a message of Fri, 13 Nov 2015 14:47:12 +0530, Animesh Srivastava writes:
>Whenever i install python 3.5.0 compiler
>It gives me error 0x07b
>Can u please resolve it
>-- 
>https://mail.python.org/mailman/listinfo/python-list

Maybe this is your problem
http://www.bitdefender.com/support/how-to-solve-error-message-%22the-application-was-unable-to-start-correctly-%280x07b%29-click-ok-to-close-the-application%22-1106.html

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


Re: More tkinter Madness

2015-11-13 Thread Laura Creighton
In a message of Fri, 13 Nov 2015 13:14:08 -0600, Tim Daneliuk writes:
>On 11/13/2015 12:32 AM, Christian Gollwitzer wrote:
>> Apfelkiste:Sources chris$
>
>Well, I get window and when I do this:
>
>pack [button .b -text Hello -command exit]
>
>Nothing appears.
>
>tkinter appears borked
>
>I have reinstalled once already, will try again

Next idea.

Try to run a basic Tk app and a basic Tcl one.  See if they work or not.

Laura

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


Re: Problems using struct pack/unpack in files, and reading them.

2015-11-13 Thread Laura Creighton
I forgot to add.  You get this wretched error message if your data
is shorter than expected, and you ask struct to read more than you
have, as well.  most annoying.

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


  1   2   3   4   5   6   7   >