Re: How modules work in Python

2014-11-18 Thread Larry Hudson
On 11/18/2014 12:59 PM, sohcahto...@gmail.com wrote: On Tuesday, November 18, 2014 12:14:15 AM UTC-8, Larry Hudson wrote: First, I'll repeat everybody else: DON'T TOP POST!!! On 11/16/2014 04:41 PM, Abdul Abdul wrote: Dave, Thanks for your nice explanation. For your answer on one of my quest

Re:scipy shape

2014-11-18 Thread Dave Angel
Abdul Abdul Wrote in message: > I came across an example that starts as follows: > > from scipy.ndimage import filters > img = zeros(im.shape) > > What does the second line mean here? Is it setting the image pixels to zero? > What is "shape" here? > This example is incomplete. Neither zeros n

Re: How to fix those errors?

2014-11-18 Thread Chris Angelico
On Wed, Nov 19, 2014 at 2:02 PM, alex23 wrote: > On 17/11/2014 1:06 PM, Chris Angelico wrote: >> >> You could then name it in Hebrew: Paamayim Nekudotayim. There is >> excellent precedent for this - it's done by a language in whose >> footsteps Python strives to follow. > > > The first time I got

Re: Trouble getting full response content from PATCH request

2014-11-18 Thread Cameron Simpson
On 17Nov2014 20:26, John Gordon wrote: I'm working with a third-party API and I'm seeing some behavior that I can't explain. The API uses the HTTP PATCH operation to set user passwords, and in case of unacceptable passwords, the response is supposed to be an HTML document containing a diagnosti

Re: How to fix those errors?

2014-11-18 Thread alex23
On 17/11/2014 1:06 PM, Chris Angelico wrote: You could then name it in Hebrew: Paamayim Nekudotayim. There is excellent precedent for this - it's done by a language in whose footsteps Python strives to follow. The first time I got a T_PAAMAYIM_NEKUDOTAYIM error, I just about flipped my desk in

Re: scipy shape

2014-11-18 Thread MRAB
On 2014-11-19 02:30, Abdul Abdul wrote: I came across an example that starts as follows: from scipy.ndimage import filters img = zeros(im.shape) What does the second line mean here? Is it setting the image pixels to zero? What is "shape" here? It looks like it might be using numpy. If 'im' i

scipy shape

2014-11-18 Thread Abdul Abdul
I came across an example that starts as follows: from scipy.ndimage import filters img = zeros(im.shape) What does the second line mean here? Is it setting the image pixels to zero? What is "shape" here? Thanks. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to access Qt components loaded from file?

2014-11-18 Thread Chris Angelico
On Wed, Nov 19, 2014 at 5:15 AM, Juan Christian wrote: > > Thanks, it's working. What would be a "professional" approach if I want to > constantly call a URL to get it's content and access this data within the > GUI? > "Constantly" doesn't make much sense when you're talking about network operati

Re: How do you download and install HTML5TreeBuilder ?

2014-11-18 Thread Simon Evans
re: Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\Intel Atom>pip install html5lib Downloading/unpacking html5lib Running setup.py (path:c:\users\intela~1\appdata\local\temp\pip_build_Intel At om\html5lib\setup.py) egg_info for pac

Re: caught in the import web again

2014-11-18 Thread Dave Angel
Chris Angelico Wrote in message: > On Wed, Nov 19, 2014 at 6:09 AM, Dave Angel wrote: >> I once worked on (and then >> fixed) a build system that could not complete a build from clean. >> It needed some pieces from a previous build in order to get to >> the point where it was ready to build th

Re: How to fix those errors?

2014-11-18 Thread Steven D'Aprano
Roy Smith wrote: > In article <54694389$0$13001$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> Chris Angelico wrote: >> >> > You should be able to use two semicolons, that's equivalent to one >> > colon right? >> > >> > ChrisA >> > (No, it isn't, so don't take this advice.

Re: How do you download and install HTML5TreeBuilder ?

2014-11-18 Thread Mark Lawrence
On 18/11/2014 21:55, Simon Evans wrote: Dear Programmers, I have installed the HTMLParserTreebuilder and LXMLTreeBuilder downloads to my Python2.7 console, using the Windows Console 'pip install' procedure. I downloaded HTML5 files and installed them to my Python2.7 directory, and went through

Re: How do you download and install HTML5TreeBuilder ?

2014-11-18 Thread John Gordon
In Simon Evans writes: > I downloaded HTML5 files and installed them to my Python2.7 directory, > and went through the 'pip install' procedure, but this did not work. > html5lib-0.999(1).tar.gz > html5lib-0.999.tar.gz > HTMLParser-0.0.2.tar.gz Those first two files seem identical. Did you m

How do you download and install HTML5TreeBuilder ?

2014-11-18 Thread Simon Evans
Dear Programmers, I have installed the HTMLParserTreebuilder and LXMLTreeBuilder downloads to my Python2.7 console, using the Windows Console 'pip install' procedure. I downloaded HTML5 files and installed them to my Python2.7 directory, and went through the 'pip install' procedure, but this did

Re: How modules work in Python

2014-11-18 Thread sohcahtoa82
On Tuesday, November 18, 2014 12:14:15 AM UTC-8, Larry Hudson wrote: > First, I'll repeat everybody else: DON'T TOP POST!!! > > On 11/16/2014 04:41 PM, Abdul Abdul wrote: > > Dave, > > > > Thanks for your nice explanation. For your answer on one of my questions: > > > > *Modules don't have method

Re: caught in the import web again

2014-11-18 Thread Chris Angelico
On Wed, Nov 19, 2014 at 6:09 AM, Dave Angel wrote: > I once worked on (and then > fixed) a build system that could not complete a build from clean. > It needed some pieces from a previous build in order to get to > the point where it was ready to build those pieces. Recursive > depencies at co

Re: caught in the import web again

2014-11-18 Thread Dave Angel
Ian Kelly Wrote in message: > On Mon, Nov 17, 2014 at 6:20 PM, Dave Angel wrote: >> Ian Kelly Wrote in message: >>> On Mon, Nov 17, 2014 at 3:17 PM, Dave Angel wrote: >> In a module that might get tangled in a cycle, avoid global code that depends on other modules. Instead of puttin

Re: How to access Qt components loaded from file?

2014-11-18 Thread Juan Christian
> > You can't have a slot like this: > > MainWindow.btn.clicked.connect(MainWindow.txtbox.setText(test())) > > because that's mean: "connect to the return of > MainWindow.txtbox.setText(test())" and it's not possible at this stage > of your program. > > Use instead a function: > > MainWindow.btn.cl

Re: How to access Qt components loaded from file?

2014-11-18 Thread Vincent Vande Vyvre
Le 18/11/2014 15:49, Juan Christian a écrit : I was doing some tests, then I tried this: app = QApplication(sys.argv) MainWindow = loadui("main.ui") MainWindow.btn.clicked.connect(MainWindow.txtbox.setText(test())) MainWindow.show() app.exec_() But I get "RuntimeError: Failed to connect signal

Re: caught in the import web again

2014-11-18 Thread Ian Kelly
On Mon, Nov 17, 2014 at 6:20 PM, Dave Angel wrote: > Ian Kelly Wrote in message: >> On Mon, Nov 17, 2014 at 3:17 PM, Dave Angel wrote: > >>> In a module that might get tangled in a cycle, avoid global code >>> that depends on other modules. Instead of putting such >>> initialization at top le

Re: How to access Qt components loaded from file?

2014-11-18 Thread Juan Christian
I was doing some tests, then I tried this: app = QApplication(sys.argv) MainWindow = loadui("main.ui") MainWindow.btn.clicked.connect(MainWindow.txtbox.setText(test())) MainWindow.show() app.exec_() But I get "RuntimeError: Failed to connect signal clicked().", why? The syntax is correct, I don

ANN: Leo 5.0 beta 2 released

2014-11-18 Thread edreamleo
Leo 5.0b2 is now available at: http://sourceforge.net/projects/leo/files/Leo/ This release fixes several installation issues and updates installation instructions for Linux/Ubuntu. Leo is a PIM, an IDE and an outliner. Video tutorials: http://leoeditor.com/screencasts.html Text tutorials: http://

Re: How to access Qt components loaded from file?

2014-11-18 Thread Juan Christian
Many thanks, worked. The only problem now is that I don't have auto-complete for anything, because of this approach... I'll have to check the doc more regularly. ^^ On Tue Nov 18 2014 at 10:48:44 AM Vincent Vande Vyvre < vincent.vande.vy...@telenet.be> wrote: > Le 18/11/2014 13:18, Juan Christian

Re: How to access Qt components loaded from file?

2014-11-18 Thread Vincent Vande Vyvre
Le 18/11/2014 13:18, Juan Christian a écrit : I have this simple code that load any Qt Designer .UI file: from PySide.QtCore import QFile from PySide.QtGui import QApplication from PySide.QtUiTools import QUiLoader def loadui(file_name): loader = QUiLoader() uifile = QFile(file_name) uifile.op

How to access Qt components loaded from file?

2014-11-18 Thread Juan Christian
I have this simple code that load any Qt Designer .UI file: from PySide.QtCore import QFile from PySide.QtGui import QApplication from PySide.QtUiTools import QUiLoader def loadui(file_name): loader = QUiLoader() uifile = QFile(file_name) uifile.open(QFile.ReadOnly) ui = loader.load(uifile) uifi

Re: caught in the import web again

2014-11-18 Thread Charles T. Smith
On Tue, 18 Nov 2014 00:00:42 -0700, Michael Torrie wrote: > On 11/17/2014 03:45 PM, Steven D'Aprano wrote: > >> Circular dependencies are not just a problem in Python, they are a >> problem throughout most of software design. > > Personally I find that duck typing eliminates a lot of the circula

Re: How modules work in Python

2014-11-18 Thread Larry Hudson
First, I'll repeat everybody else: DON'T TOP POST!!! On 11/16/2014 04:41 PM, Abdul Abdul wrote: Dave, Thanks for your nice explanation. For your answer on one of my questions: *Modules don't have methods. open is an ordinary function in the module.* Isn't "method" and "function" used interch