Re: pyinstaller

2016-07-26 Thread Christian Gollwitzer
Am 27.07.16 um 03:15 schrieb Larry Martell: On Tue, Jul 26, 2016 at 8:49 PM, Tom Brown wrote: I used pyinstaller quite a bit 3 years ago. I could brush off the cobwebs and see if I can help if you have not solved it already. What is the issue you are having? If I import the requests module,

Re: Python Print Error

2016-07-26 Thread Frank Millman
"Cai Gengyang" wrote in message news:c704cb09-ce62-4d83-ba72-c02583580...@googlegroups.com... How to debug this error message ? print('You will be ' + str(int(myAge) + 1) + ' in a year.') Traceback (most recent call last): File "", line 1, in print('You will be ' + str(int(myAge) + 1

Re: Python Print Error

2016-07-26 Thread Jussi Piitulainen
Cai Gengyang writes: > How to debug this error message ? > > print('You will be ' + str(int(myAge) + 1) + ' in a year.') > Traceback (most recent call last): > File "", line 1, in > print('You will be ' + str(int(myAge) + 1) + ' in a year.') > ValueError: invalid literal for int() with base

Python Print Error

2016-07-26 Thread Cai Gengyang
How to debug this error message ? print('You will be ' + str(int(myAge) + 1) + ' in a year.') Traceback (most recent call last): File "", line 1, in print('You will be ' + str(int(myAge) + 1) + ' in a year.') ValueError: invalid literal for int() with base 10: '' -- https://mail.python.org

Re: reshape with xyz ordering

2016-07-26 Thread Nobody
On Tue, 26 Jul 2016 07:10:18 -0700, Heli wrote: > I sort a file with 4 columns (x,y,z, somevalue) and I sort it using > numpy.lexsort. > > ind=np.lexsort((val,z,y,x)) > > myval=val[ind] > > myval is a 1d numpy array sorted by x,then y, then z and finally val. > > how can I reshape correctly my

Re: making executables smaller

2016-07-26 Thread Steven D'Aprano
On Wed, 27 Jul 2016 03:22 am, Carter Temm wrote: > Hi, > I’m writing a couple different projects at the moment, and when I compile > it into a single executable using pyinstaller, it becomes extremely large. What do you consider "extremely large"? Ten gigabytes? 500 kilobytes? Give us a clue. >

Re: Python environment on mac

2016-07-26 Thread Cameron Simpson
On 26Jul2016 06:52, Crane Ugly wrote: Mac OS X comes with its own version of python and structure to support it. So far it was good enough for me. Then I started to use modules that distributed through MacPorts and this is where I get lost. I do not quite understand how Python environment is se

Re: pyinstaller

2016-07-26 Thread Larry Martell
On Tue, Jul 26, 2016 at 8:49 PM, Tom Brown wrote: > I used pyinstaller quite a bit 3 years ago. I could brush off the cobwebs > and see if I can help if you have not solved it already. > > What is the issue you are having? If I import the requests module, then when I run the executable I get: Im

Re: pyinstaller

2016-07-26 Thread Tom Brown
I used pyinstaller quite a bit 3 years ago. I could brush off the cobwebs and see if I can help if you have not solved it already. What is the issue you are having? -Tom On Jun 21, 2016 16:57, "Larry Martell" wrote: > Anyone here have any experience with pyinstaller? I am trying to use > it, b

Re: making executables smaller

2016-07-26 Thread Carter Temm
OK. So I guess the question should be, how can I make these executables smaller in general? Sent from my iPhone > On Jul 26, 2016, at 5:13 PM, Dennis Lee Bieber wrote: > > On Tue, 26 Jul 2016 12:22:16 -0500, Carter Temm > declaimed the following: > >> Hi, >> I’m writing a couple different pr

Re: Depending on enum34 from a library

2016-07-26 Thread Ethan Furman
On 07/24/2016 01:10 PM, Vasiliy Faronov wrote: I'm building a Python library where I want to use Python 3.4-style enums. Because I need to support Python 2.7, I'm considering using enum34 [1]. But I'm not sure how to do this: If I simply depend on enum34, it will install a module named `enum` e

Re: NumPy frombuffer giving nonsense values when reading C float array on Windows

2016-07-26 Thread eryk sun
On Tue, Jul 26, 2016 at 6:31 PM, sth wrote: > > The restype is a ctypes Structure instance with a single __fields__ entry > (coords), which Watch the underscores with ctypes attributes. Your code spells it correctly as "_fields_". > is a Structure with two fields (len and data) which are the F

Is there a documented pylibpd (pure data wrapper/library) API?

2016-07-26 Thread Michael Sperone
Hi everyone, I'm starting using the libpd wrapper/library for python (pylibpd), to load and use my pure data patches within Python. I was wondering if there was any online documentation for this python version? At the least I'm looking for a list of classes and methods. Thank you! Mike -- http

ANN: PyQt v5.7 Released

2016-07-26 Thread Phil Thompson
PyQt v5.7 has been released. These are the Python bindings for the Qt application toolkit and runs on Linux, OS X, Windows, iOS and Android. Also released for the first time under the GPL are PyQtChart, PyQtDataVisualization and PyQtPurchasing. PyQtChart are the bindings for the Qt Charts libra

Re: FW: error in python IDLE

2016-07-26 Thread Terry Reedy
On 7/26/2016 1:51 PM, Nakirekanti Jahnavi wrote: Sent from Mail for Windows 10 From: Nakirekanti Jahnavi The above is all I see. This is a text-only, no-attachment list. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: making executables smaller

2016-07-26 Thread Wildman via Python-list
On Tue, 26 Jul 2016 12:22:16 -0500, Carter Temm wrote: > Hi, > I’m writing a couple different projects at the moment, and when I > compile it into a single executable using pyinstaller, it becomes > extremely large. I’m guessing this is because of the modules used. > Because I’m not that skilled a

Re: NumPy frombuffer giving nonsense values when reading C float array on Windows

2016-07-26 Thread sth
On Tuesday, 26 July 2016 19:10:46 UTC+1, eryk sun wrote: > On Tue, Jul 26, 2016 at 12:06 PM, sth wrote: > > I'm using ctypes to interface with a binary which returns a void pointer > > (ctypes c_void_p) to a nested 64-bit float array: > > If this comes from a function result, are you certain th

Re: NumPy frombuffer giving nonsense values when reading C float array on Windows

2016-07-26 Thread eryk sun
On Tue, Jul 26, 2016 at 12:06 PM, wrote: > I'm using ctypes to interface with a binary which returns a void pointer > (ctypes c_void_p) to a nested 64-bit float array: If this comes from a function result, are you certain that its restype is ctypes.c_void_p? I commonly see typos here such as s

FW: error in python IDLE

2016-07-26 Thread Nakirekanti Jahnavi
Sent from Mail for Windows 10 From: Nakirekanti Jahnavi -- https://mail.python.org/mailman/listinfo/python-list

making executables smaller

2016-07-26 Thread Carter Temm
Hi, I’m writing a couple different projects at the moment, and when I compile it into a single executable using pyinstaller, it becomes extremely large. I’m guessing this is because of the modules used. Because I’m not that skilled at python, I put stuff like for example, import sys. I imagine t

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

2016-07-26 Thread Malcolm Greene
Hi Jussi, You answered my questions - thank you! Malcolm > 1. The signature for glob.glob() is "glob.glob(pathname, *, >recursive=False)". What is the meaning of the 2nd parameter listed >with an asterisk? It's not a parameter. It's special syntax to indicate that the remaining paramete

Re: NumPy frombuffer giving nonsense values when reading C float array on Windows

2016-07-26 Thread sth
On Tuesday, 26 July 2016 16:36:33 UTC+1, Christian Gollwitzer wrote: > Am 26.07.16 um 17:09 schrieb sth: > > it's difficult to test a .dylib / .so using valgrind > > Why is it difficult? If you have a python script such that > > python mytests.py > > loads the .so and runs the tests, then

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

2016-07-26 Thread Peter Otten
Malcolm Greene wrote: > 2. Is there a technique for using glob.glob() to recognize files and >folders that begin with a period, eg. ".profile"? The documentation >states: "If the directory contains files starting with . they won’t >be matched by default.". Any suggestions on what the n

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

2016-07-26 Thread Jussi Piitulainen
Malcolm Greene writes: > In reading Python 3.5.1's glob.glob documentation[1] I'm puzzled by the > following: > > 1. The signature for glob.glob() is "glob.glob(pathname, *, >recursive=False)". What is the meaning of the 2nd parameter listed >with an asterisk? It's not a parameter. It'

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

2016-07-26 Thread Malcolm Greene
In reading Python 3.5.1's glob.glob documentation[1] I'm puzzled by the following: 1. The signature for glob.glob() is "glob.glob(pathname, *, recursive=False)". What is the meaning of the 2nd parameter listed with an asterisk? 2. Is there a technique for using glob.glob() to recognize fi

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

2016-07-26 Thread Malcolm Greene
Hi Steven and Peter, Steven: Interestingly (oddly???) enough, the output captured by hooking the cgitb handler on my system appears to be shorter than the default cgitb output. You can see this yourself via this tiny script: import cgitb cgitb.enable(format='text') x = 1/0 The solution I came up

Re: NumPy frombuffer giving nonsense values when reading C float array on Windows

2016-07-26 Thread Christian Gollwitzer
Am 26.07.16 um 17:09 schrieb sth: it's difficult to test a .dylib / .so using valgrind Why is it difficult? If you have a python script such that python mytests.py loads the .so and runs the tests, then valgrind --tool=memcheck python mytests.py should work. This should imme

Re: Python environment on mac

2016-07-26 Thread CFK
There are two variables you will need to set; PATH and PYTHONPATH. You set your PYTHONPATH correctly, but for executables like pip, you need to set the PATH as well. You MUST do that for each account! The reason it didn't work as root is because once you su to root, it replaces your PYTHONPATH and

Re: NumPy frombuffer giving nonsense values when reading C float array on Windows

2016-07-26 Thread sth
On Tuesday, 26 July 2016 15:21:14 UTC+1, Peter Otten wrote: > > > I'm using ctypes to interface with a binary which returns a void pointer > > (ctypes c_void_p) to a nested 64-bit float array: > > [[1.0, 2.0], [3.0, 4.0], … ] > > then return the pointer so it can be freed > > > > I'm using the f

Re: reshape with xyz ordering

2016-07-26 Thread Peter Otten
Heli wrote: > I sort a file with 4 columns (x,y,z, somevalue) and I sort it using > numpy.lexsort. > > ind=np.lexsort((val,z,y,x)) > > myval=val[ind] > > myval is a 1d numpy array sorted by x,then y, then z and finally val. > > how can I reshape correctly myval so that I get a 3d numpy array >

Re: Why not allow empty code blocks?

2016-07-26 Thread Antoon Pardon
Op 24-07-16 om 21:00 schreef Chris Angelico: > A skilled craftsman in any field will choose to use quality tools. > They save time, and time is money.[/quote] Sure, but sometimes there is a flaw somewhere. A flaw whose consequences can be reduced by using an extra tool. If that is the case the rea

Re: NumPy frombuffer giving nonsense values when reading C float array on Windows

2016-07-26 Thread Peter Otten
ursch...@gmail.com wrote: > I'm using ctypes to interface with a binary which returns a void pointer > (ctypes c_void_p) to a nested 64-bit float array: > [[1.0, 2.0], [3.0, 4.0], … ] > then return the pointer so it can be freed > > I'm using the following code to de-reference it: > > # a 10-ele

reshape with xyz ordering

2016-07-26 Thread Heli
Hi, I sort a file with 4 columns (x,y,z, somevalue) and I sort it using numpy.lexsort. ind=np.lexsort((val,z,y,x)) myval=val[ind] myval is a 1d numpy array sorted by x,then y, then z and finally val. how can I reshape correctly myval so that I get a 3d numpy array maintaining the xyz orderi

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

2016-07-26 Thread Peter Otten
Malcolm Greene wrote: > Is there a way to capture cgitb's extensive output in an except clause > so that cgitb's detailed traceback output can be logged *and* the except > section can handle the exception so the script can continue running? > > My read of the cgitb documentation leads me to beli

Python environment on mac

2016-07-26 Thread Crane Ugly
Mac OS X comes with its own version of python and structure to support it. So far it was good enough for me. Then I started to use modules that distributed through MacPorts and this is where I get lost. I do not quite understand how Python environment is set. Or how to set it in a way of using, s

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

2016-07-26 Thread Steven D'Aprano
On Tue, 26 Jul 2016 08:11 pm, Malcolm Greene wrote: > Is there a way to capture cgitb's extensive output in an except clause > so that cgitb's detailed traceback output can be logged *and* the except > section can handle the exception so the script can continue running? Anything that cgitb captur

NumPy frombuffer giving nonsense values when reading C float array on Windows

2016-07-26 Thread urschrei
I'm using ctypes to interface with a binary which returns a void pointer (ctypes c_void_p) to a nested 64-bit float array: [[1.0, 2.0], [3.0, 4.0], … ] then return the pointer so it can be freed I'm using the following code to de-reference it: # a 10-element array shape = (10, 2) array_size = np

Re: Why not allow empty code blocks?

2016-07-26 Thread BartC
On 26/07/2016 08:21, Gregory Ewing wrote: BartC wrote: (Yes everyone uses T*a (pointer to T) instead of T(*a)[] (pointer to array of T), because, thanks to how C mixes up deferencing and indexing, the former can be accessed as a[i] instead of (*a)[i]. But it's wrong, and leads to errors that th

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

2016-07-26 Thread Malcolm Greene
Is there a way to capture cgitb's extensive output in an except clause so that cgitb's detailed traceback output can be logged *and* the except section can handle the exception so the script can continue running? My read of the cgitb documentation leads me to believe that the only way I can get c

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

2016-07-26 Thread Malcolm Greene
Hi Peter, > Fine! Then you can avoid the evil hack I came up with many moons ago: > https://mail.python.org/pipermail/python-list/2010-March/570941.html Evil? Damn evil! Love it! Thank you, Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Re: Why not allow empty code blocks?

2016-07-26 Thread Gregory Ewing
Marko Rauhamaa wrote: int a[3]; > a produces a pointer to the array's first element. Yes, and that makes using true pointer-to-array types in C really awkward. You're fighting against the way the language was designed to be used. If you use a language in an un-idiomatic way, you can't

Re: Why not allow empty code blocks?

2016-07-26 Thread Marko Rauhamaa
Gregory Ewing : > BartC wrote: >> (Yes everyone uses T*a (pointer to T) instead of T(*a)[] (pointer to >> array of T), because, thanks to how C mixes up deferencing and >> indexing, the former can be accessed as a[i] instead of (*a)[i]. >> >> But it's wrong, and leads to errors that the language c

Re: Why not allow empty code blocks?

2016-07-26 Thread Gregory Ewing
BartC wrote: But otherwise free-flowing English text is not a good comparison with a programming language syntax. I think Python is more like poetry. -- roses are red violets are blue is this the end of the poem no-one can tell because there is no end marker thus spake the bdfl -- https://mail

Re: Why not allow empty code blocks?

2016-07-26 Thread Gregory Ewing
BartC wrote: (Yes everyone uses T*a (pointer to T) instead of T(*a)[] (pointer to array of T), because, thanks to how C mixes up deferencing and indexing, the former can be accessed as a[i] instead of (*a)[i]. But it's wrong, and leads to errors that the language can't detect. Such as when a