Re: Array of Functions

2014-11-16 Thread Richard Riehle
On Friday, November 14, 2014 4:13:28 PM UTC-8, Dennis Lee Bieber wrote: > On Fri, 14 Nov 2014 14:17:23 -0800 (PST), Richard Riehle > declaimed the following: > > >In C, C++, Ada, and functional languages, I can create an array of > >functions, albeit with the nastiness of pointers in the C famil

Re: import graphics library; causes error

2014-11-16 Thread Ian Kelly
On Sun, Nov 16, 2014 at 1:39 PM, ryguy7272 wrote: > Anyway, I open the cmd window, and typed this: 'easy_install python > graphics'. So, it starts up and runs/downloads the appropriate library from > the web. I get confirmation (in the cmd window) that it finishes, then I try > to run this sc

Re: encode and decode builtins

2014-11-16 Thread dieter
Garrett Berg writes: > ... > However, there are times that I do not care what data I am working with, > and I find myself writing something like: > > if isinstance(data, bytes): data = data.decode() Apparently, below this code, you do care that "data" contains "str" (not "bytes") -- otherwise, yo

Re: caught in the import web again

2014-11-16 Thread dieter
"Charles T. Smith" writes: > ... > Are others equally frustrated by this or is there a trick or principle > that I'm missing. At this point, I guess the way I'll have to proceed is > to put every class in its own file, no matter how small. Hopefully that > takes care of the problem. Recursiv

Re: Using map()

2014-11-16 Thread Ian Kelly
On Sun, Nov 16, 2014 at 4:22 PM, Terry Reedy wrote: > If pylint sees 'map(lambda ...: ', it would be appropriate to suggest using > a comprehension or generator expression instead. This avoids the unneeded > creation and repeated call of a new function. There's actually a separate warning for th

Re: I love assert

2014-11-16 Thread Ethan Furman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/16/2014 06:09 PM, Steven D'Aprano wrote: > Ethan Furman wrote: >> On 11/14/2014 06:58 PM, Steven D'Aprano wrote: >>> Ethan Furman wrote: My point being: a safety net that is so easily disabled does not count (IMHO) as a backup.

Re: import graphics library; causes error

2014-11-16 Thread Chris Angelico
On Mon, Nov 17, 2014 at 2:03 PM, ryguy7272 wrote: > Well, that's a damn good question. I thought, by defailt, everything was > downloaded to this folder: > 'C:\Python27\Lib\site-packages' > > In there, I have all kinds of things like: > 'setuptools-6.1.dist-info', 'pip-1.5.6.dist-info', etc. > A

Re: How to fix those errors?

2014-11-16 Thread Chris Angelico
On Mon, Nov 17, 2014 at 1:55 PM, Roy Smith wrote: > Wouldn't it make more sense to use four periods? > > def spam(arg) > for x in seq > pass > > First, 2 colons is 4 dots, so it's conservation of punctuation. Second, > it reads pretty well. You could then name it in Hebrew: P

Re: import graphics library; causes error

2014-11-16 Thread ryguy7272
On Sunday, November 16, 2014 3:39:45 PM UTC-5, ryguy7272 wrote: > These libraries drive me totally nuts. Sorry, just had to get it out there. > Anyway, I open the cmd window, and typed this: 'easy_install python > graphics'. So, it starts up and runs/downloads the appropriate library from > the

Re: How to fix those errors?

2014-11-16 Thread Roy Smith
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. Thanks.) > > > Oooh! Python-

Re: How modules work in Python

2014-11-16 Thread Dave Angel
(Please don't top-post. Use interleaved posting. And remove parts you didn't respond to.) (While I'm criticizing, I should point out that your quoting seems doublespaced. That makes me suspect buggy googlegroups. If you're using that, you should either find a real newsreader, use the maili

Re: import os

2014-11-16 Thread Dave Angel
Abdul Abdul Wrote in message: > Thanks for your reply. Yes, I came across this page, but didn't understand > what is meant by the operating system dependent functionality. What does that > mean? Is importing that module that serious? > > Please don't top-post here. Add your comments after some

Re:from pylab import *

2014-11-16 Thread Dave Angel
Abdul Abdul Wrote in message: > I came across an example that uses "Matplotlib". > > It used the following import to use that module: > > from pylab import * > > When I tried to run the example, I got the following error: > > C:\Python27\python.exe > C:/Users/abc/PycharmProjects/ComputerVisio

Re: from pylab import *

2014-11-16 Thread MRAB
On 2014-11-17 02:04, Abdul Abdul wrote: I came across an example that uses "Matplotlib". It used the following import to use that module: from pylab import * When I tried to run the example, I got the following error: C:\Python27\python.exe C:/Users/abc/PycharmProjects/ComputerVision/plot_ima

Re: I love assert

2014-11-16 Thread Steven D'Aprano
Ethan Furman wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 11/14/2014 06:58 PM, Steven D'Aprano wrote: >> Ethan Furman wrote: >>> >>> My point being: a safety net that is so easily disabled does not count >>> (IMHO) as a backup. >> >> Assertions are not a backup or a safety n

from pylab import *

2014-11-16 Thread Abdul Abdul
I came across an example that uses "Matplotlib". It used the following import to use that module: from pylab import * When I tried to run the example, I got the following error: C:\Python27\python.exe C:/Users/abc/PycharmProjects/ComputerVision/plot_image.py Traceback (most recent call last):

Re: Messages from code analysis tools

2014-11-16 Thread Ned Batchelder
On 11/16/14 8:21 PM, Ben Finney wrote: Ned Batchelder writes: Pylint isn't useful until you've tailored the messages. Definitely agreed. The pylint message that always irked me was: W0142: Used * or ** magic "magic"? They're features of the language! It's a warning, because the us

Re: Messages from code analysis tools (was: Using map())

2014-11-16 Thread Chris Angelico
On Mon, Nov 17, 2014 at 12:21 PM, Ben Finney wrote: >> The pylint message that always irked me was: >> >> W0142: Used * or ** magic >> >> "magic"? They're features of the language! > > It's a warning, because the use of that feature clobbers the static code > inspection you've asked for. PyLin

Re: import os

2014-11-16 Thread Chris Angelico
On Mon, Nov 17, 2014 at 12:10 PM, Abdul Abdul wrote: > Thanks for your reply. Yes, I came across this page, but didn't understand > what is meant by the operating system dependent functionality. What does > that mean? Is importing that module that serious? It's not "serious" as in "using this mod

Re: Using map()

2014-11-16 Thread Dan Stromberg
On Sun, Nov 16, 2014 at 4:09 PM, Steven D'Aprano wrote: > Pavel Volkov wrote: > >> I checked my modules with pylint and saw the following warning: >> >> W: 25,29: Used builtin function 'map' (bad-builtin) >> >> Why is the use of map() discouraged? >> It' such a useful thing. > > That's a bug in py

Re: Error when trying to open an image

2014-11-16 Thread Ben Finney
Abdul Abdul writes: > Thanks for your kind reply. Abdul, please don't top-post. Instead, trim the quoted material just to what you're responding to; then post your responses interleaved https://en.wikipedia.org/wiki/Posting_style#Interleaved_style>. > I got the following output: > > Process fin

Re: How modules work in Python

2014-11-16 Thread Ben Finney
Abdul Abdul writes: > Thanks for your nice explanation. For your answer on one of my > questions: (Please use “interleaved” posting style, for showing quoted material and your responses https://en.wikipedia.org/wiki/Posting_style#Interleaved_style>.) > * Modules don't have methods. open is an

Messages from code analysis tools (was: Using map())

2014-11-16 Thread Ben Finney
Ned Batchelder writes: > Pylint isn't useful until you've tailored the messages. Definitely agreed. > The pylint message that always irked me was: > > W0142: Used * or ** magic > > "magic"? They're features of the language! It's a warning, because the use of that feature clobbers the stati

Re: import os

2014-11-16 Thread Dan Stromberg
On Sun, Nov 16, 2014 at 5:10 PM, Abdul Abdul wrote: > Thanks for your reply. Yes, I came across this page, but didn't understand > what is meant by the operating system dependent functionality. What does > that mean? Is importing that module that serious? The os module has mostly lower level OS i

Re: import os

2014-11-16 Thread Abdul Abdul
Thanks for your reply. Yes, I came across this page, but didn't understand what is meant by the operating system dependent functionality. What does that mean? Is importing that module that serious? Thanks. On Sun, Nov 16, 2014 at 11:02 PM, Chris Angelico wrote: > On Mon, Nov 17, 2014 at 8:56 AM

Re: Using map()

2014-11-16 Thread Chris Angelico
On Mon, Nov 17, 2014 at 11:24 AM, Ned Batchelder wrote: > Pylint isn't useful until you've tailored the messages. Personally, I avoid > map, but your usage may vary. The pylint message that always irked me was: > > W0142: Used * or ** magic This is why I don't bother with linters at all. Th

Re: How to fix those errors?

2014-11-16 Thread Chris Angelico
On Mon, Nov 17, 2014 at 11:38 AM, Steven D'Aprano wrote: > for people who have a broken keyboard or have remapped colon to something > else. It would also make reading slices an exciting adventure: > > seq[1][-1] > > > What do you think? Is it perhaps better suited to perl-ideas?

Re: Error when trying to open an image

2014-11-16 Thread Abdul Abdul
Thanks for your kind reply. Yes, it seemed it worked with an older version than 3.x I got the following output: Process finished with exit code 0 So, what is the purpose of open() here? Thanks. On Mon, Nov 17, 2014 at 12:31 AM, Terry Reedy wrote: > On 11/16/2014 2:37 PM, Abdul Abdul wrote: >

Re: How modules work in Python

2014-11-16 Thread Abdul Abdul
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 interchangeably? In other words, aren't they the same thing? Or, Python has some naming conventions here?

Re: How to fix those errors?

2014-11-16 Thread Steven D'Aprano
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. Thanks.) Oooh! Python-ideas territory! I think the parser should allow two consecutive semi-colons, or four commas, as an alias for

Re: How modules work in Python

2014-11-16 Thread Steven D'Aprano
Abdul Abdul wrote: > Hello, > > I'm new to Python, and just have a small question, and thought you might > have an idea on it. > > I came across the following example that uses the Python Imaging Library > (PIL): > > from PIL import Image > img = Image.open('xyz.jpg') > > I know that PIL is a

Re: Using map()

2014-11-16 Thread Ned Batchelder
On 11/16/14 7:09 PM, Steven D'Aprano wrote: Pavel Volkov wrote: I checked my modules with pylint and saw the following warning: W: 25,29: Used builtin function 'map' (bad-builtin) Why is the use of map() discouraged? It' such a useful thing. That's a bug in pylint. It's not a bad builtin, i

Re: Using map()

2014-11-16 Thread Steven D'Aprano
Pavel Volkov wrote: > I checked my modules with pylint and saw the following warning: > > W: 25,29: Used builtin function 'map' (bad-builtin) > > Why is the use of map() discouraged? > It' such a useful thing. That's a bug in pylint. It's not a bad builtin, it is perfectly fine. Some people do

Re: Error when trying to open an image

2014-11-16 Thread Terry Reedy
On 11/16/2014 2:37 PM, Abdul Abdul wrote: Hello, I'm trying to open an image using the `Python Imaging Library` as follows: from PIL import Image img = Image.open('xyz.jpg') But, got the following error: File "C:/Users/abc/PycharmProjects/untitled/open_image.py", line 2, in from PIL imp

Re: Using map()

2014-11-16 Thread Terry Reedy
On 11/16/2014 8:01 AM, Pavel Volkov wrote: I checked my modules with pylint and saw the following warning: W: 25,29: Used builtin function 'map' (bad-builtin) Why is the use of map() discouraged? It' such a useful thing. I consider that to be a bug in pylint. It misstates a careless 'bad' o

Re: import graphics library; causes error

2014-11-16 Thread Terry Reedy
On 11/16/2014 3:39 PM, ryguy7272 wrote: These libraries drive me totally nuts. Sorry, just had to get it out there. Anyway, I open the cmd window, and typed this: > 'easy_install python graphics'. In what directory? So, it starts up and runs/downloads the appropriate library from the web. >

Re:import math error

2014-11-16 Thread Dave Angel
You forgot to specify your Python version here. ryguy7272 Wrote in message: > When I type 'import math', it seems like my Python recognizes this library. > Great. When I try to run the following script, I get an error, which > suggests (to me) the math library is not working correctly. Noth

Re:How modules work in Python

2014-11-16 Thread Dave Angel
Abdul Abdul Wrote in message: > Hello, > > I'm new to Python, and just have a small question, and thought you might have > an idea on it. You should start any new thread with a specification of the versions of software you're asking about. Since you didn't, I'll assume python version 2.7, P

Re: How to fix those errors?

2014-11-16 Thread Chris Angelico
On Mon, Nov 17, 2014 at 9:13 AM, Thomas 'PointedEars' Lahn wrote: > Thomas 'PointedEars' Lahn wrote: > >> Abdul Abdul wrote: >>> from PIL import Image >>> import os >> […] >>> for inputfile in filelist >>> outputfile = os.path.splitext(inputfile)[0]+".jpg" >>> […] >> >> Define “filelist” w

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-16 Thread Chris Angelico
On Mon, Nov 17, 2014 at 3:28 AM, Grant Edwards wrote: > But, you're right: anybody who spent more than a half hour on this is > either a flaming incompetent or a scam artist. Half an hour of human time, maybe, but potentially spread across a few hours of wall time. Building Python from source can

Re: How to fix those errors?

2014-11-16 Thread Thomas 'PointedEars' Lahn
Thomas 'PointedEars' Lahn wrote: > Abdul Abdul wrote: >> from PIL import Image >> import os > […] >> for inputfile in filelist >> outputfile = os.path.splitext(inputfile)[0]+".jpg" >> […] > > Define “filelist” which needs to refer to an iterable value. Also, you > have forgotten to end t

Re: Interrupted system call

2014-11-16 Thread Chris Angelico
On Sun, Nov 16, 2014 at 7:11 PM, Peter Bell wrote: > File "/usr/lib/python3.4/site-packages/serial/serialposix.py", line 480, > in read > if e[0] != errno.EAGAIN: > TypeError: 'InterruptedError' object is not subscriptable > ===

Re: What does this line of code mean?

2014-11-16 Thread Thomas 'PointedEars' Lahn
Abdul Abdul wrote: > I just came across the following line of code: > > outputfile = os.path.splitext(infile)[0] + ".jpg" > > Can you kindly explain to me what those parts mean? RTFM: An Python IDE like PyDev w

Re: How to fix those errors?

2014-11-16 Thread Thomas 'PointedEars' Lahn
Abdul Abdul wrote: > from PIL import Image > import os You should only import the methods that you use. > for inputfile in filelist > outputfile = os.path.splitext(inputfile)[0]+".jpg" > if inputfile != outputfile: > try: > Image.open(inputfile).save(outputfile)

Re: How to fix those errors?

2014-11-16 Thread Roy Smith
In article , Chris Angelico wrote: > On Mon, Nov 17, 2014 at 8:32 AM, Abdul Abdul wrote: > > from PIL import Image > > import os > > > > for inputfile in filelist > > outputfile = os.path.splitext(inputfile)[0]+".jpg" > > if inputfile != outputfile: > > try: > >

Re: import os

2014-11-16 Thread Chris Angelico
On Mon, Nov 17, 2014 at 8:56 AM, Abdul Abdul wrote: > I tried to refer to Python documentation for what "os" refers to, but, the > explanation was not clear. If it's something you import, what you want is the module of that name. Searching the web for 'python os module' should bring you straight

Re: How to fix those errors?

2014-11-16 Thread Chris Angelico
On Mon, Nov 17, 2014 at 8:32 AM, Abdul Abdul wrote: > from PIL import Image > import os > > for inputfile in filelist > outputfile = os.path.splitext(inputfile)[0]+".jpg" > if inputfile != outputfile: > try: > Image.open(inputfile).save(outputfile) > exc

Re: How to fix those errors?

2014-11-16 Thread Ian Kelly
On Sun, Nov 16, 2014 at 2:32 PM, Abdul Abdul wrote: > Hello, > > I'm walking through an example that goes as follows: > > from PIL import Image > import os > > for inputfile in filelist > outputfile = os.path.splitext(inputfile)[0]+".jpg" > if inputfile != outputfile: > try: >

Re: What does this line of code mean?

2014-11-16 Thread Peter Otten
Abdul Abdul wrote: > I just came across the following line of code: > > outputfile = os.path.splitext(infile)[0] + ".jpg" > > Can you kindly explain to me what those parts mean? You can try it yourself in the interactive interpreter: >>> import os.path >>> help(os.path.splitext) Help on functi

Re: OTish: using short-term TCP connections to send to multiple slaves

2014-11-16 Thread Chris Angelico
On Mon, Nov 17, 2014 at 4:21 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> UDP for anything more than your network's MTU is inefficient > > Why do you say it's inefficient? Sure, the UDP datagram will get > fragmented and re-assembled at the other end, but it's not like TCP >

import os

2014-11-16 Thread Abdul Abdul
I tried to refer to Python documentation for what "os" refers to, but, the explanation was not clear. When we write something like: import os What do we mean here? What is the purpose of such import? Thanks. -- https://mail.python.org/mailman/listinfo/python-list

Re: What does this line of code mean?

2014-11-16 Thread Ian Kelly
On Sun, Nov 16, 2014 at 2:45 PM, Abdul Abdul wrote: > I just came across the following line of code: > > outputfile = os.path.splitext(infile)[0] + ".jpg" > > Can you kindly explain to me what those parts mean? >>> import os.path >>> help(os.path.splitext) Help on function splitext in module ntpa

Re: How modules work in Python

2014-11-16 Thread Ian Kelly
On Sun, Nov 16, 2014 at 12:36 PM, Abdul Abdul wrote: > My question is, where did PIL go here? Can a module have another module > inside it? Yes, a module that contains other modules is usually called a package. -- https://mail.python.org/mailman/listinfo/python-list

Re: What does this line of code mean?

2014-11-16 Thread Tim Chase
On 2014-11-16 22:45, Abdul Abdul wrote: > I just came across the following line of code: > > outputfile = os.path.splitext(infile)[0] + ".jpg" > > Can you kindly explain to me what those parts mean? Have you tried them? https://docs.python.org/2/library/os.path.html#os.path.splitext This takes

Re: OTish: using short-term TCP connections to send to multiple slaves

2014-11-16 Thread jkn
Hi All Thanks for the various and interesting responses so far. A bit of fleshing out in a few areas: The problems of maintaining the long-term TCP connection is something I'd like to leave to one side, for now at least. There are some non-technical project issues here which is why I am con

What does this line of code mean?

2014-11-16 Thread Abdul Abdul
I just came across the following line of code: outputfile = os.path.splitext(infile)[0] + ".jpg" Can you kindly explain to me what those parts mean? Thanks. -- https://mail.python.org/mailman/listinfo/python-list

Re: import math error

2014-11-16 Thread Ian Kelly
On Sun, Nov 16, 2014 at 1:07 PM, ryguy7272 wrote: > When I type 'import math', it seems like my Python recognizes this library. > Great. When I try to run the following script, I get an error, which > suggests (to me) the math library is not working correctly. > > Script: > import math > def m

How to fix those errors?

2014-11-16 Thread Abdul Abdul
Hello, I'm walking through an example that goes as follows: from PIL import Image import os for inputfile in filelist outputfile = os.path.splitext(inputfile)[0]+".jpg" if inputfile != outputfile: try: Image.open(inputfile).save(outputfile) except IOEr

Re: [ANN] Brython 3.0.0 relased

2014-11-16 Thread Gary Herron
On 11/16/2014 12:54 AM, Pierre Quentel wrote: Hi, Version 3.0.0 of Brython has been released recently Brython is an implementation of Python 3 running in the browser, with an interface to DOM elements and events. It allows writing web client applications with Python instead of Javascript. Py

Re: Error when trying to open an image

2014-11-16 Thread Gary Herron
On 11/16/2014 11:37 AM, Abdul Abdul wrote: Hello, I'm trying to open an image using the `Python Imaging Library` as follows: from PIL import Image img = Image.open('xyz.jpg') But, got the following error: File "C:/Users/abc/PycharmProjects/untitled/open_image.py", line 2, in from PIL i

Re: import math error

2014-11-16 Thread Mayank Tripathi
Why the colon in '(1,1,2)'? On Mon Nov 17 2014 at 1:41:10 AM ryguy7272 wrote: > When I type 'import math', it seems like my Python recognizes this > library. Great. When I try to run the following script, I get an error, > which suggests (to me) the math library is not working correctly. > > S

RE: Using map()

2014-11-16 Thread Joseph L. Casale
> I checked my modules with pylint and saw the following warning: > > W: 25,29: Used builtin function 'map' (bad-builtin) > > Why is the use of map() discouraged? > It' such a useful thing. The warning manifests from the opinion that a comprehension is more suitable. You can disable the warning or

import graphics library; causes error

2014-11-16 Thread ryguy7272
These libraries drive me totally nuts. Sorry, just had to get it out there. Anyway, I open the cmd window, and typed this: 'easy_install python graphics'. So, it starts up and runs/downloads the appropriate library from the web. I get confirmation (in the cmd window) that it finishes, then I t

Re: Using map()

2014-11-16 Thread Joel Goldstick
On Sun, Nov 16, 2014 at 8:01 AM, Pavel Volkov wrote: > I checked my modules with pylint and saw the following warning: > > W: 25,29: Used builtin function 'map' (bad-builtin) > > Why is the use of map() discouraged? > It' such a useful thing. > -- > https://mail.python.org/mailman/listinfo/python-

Re: How modules work in Python

2014-11-16 Thread Joel Goldstick
On Sun, Nov 16, 2014 at 2:36 PM, Abdul Abdul wrote: > Hello, > > I'm new to Python, and just have a small question, and thought you might > have an idea on it. > > I came across the following example that uses the Python Imaging Library > (PIL): > > from PIL import Image > img = Image.open('xyz.jp

Interrupted system call

2014-11-16 Thread Peter Bell
Hi, I'm new to Python, using Python3 on RaspberryPi/ArchLinux for a home automation project. I started off with interfacing an LCD screen (serial interface) and have this working reasonably well. Then I received a couple of interface boards. I attached one of these, together with the seri

Using map()

2014-11-16 Thread Pavel Volkov
I checked my modules with pylint and saw the following warning: W: 25,29: Used builtin function 'map' (bad-builtin) Why is the use of map() discouraged? It' such a useful thing. -- https://mail.python.org/mailman/listinfo/python-list

How modules work in Python

2014-11-16 Thread Abdul Abdul
Hello, I'm new to Python, and just have a small question, and thought you might have an idea on it. I came across the following example that uses the Python Imaging Library (PIL): from PIL import Image img = Image.open('xyz.jpg') I know that PIL is a module. And, I think that Image is also a mo

Error when trying to open an image

2014-11-16 Thread Abdul Abdul
Hello, I'm trying to open an image using the `Python Imaging Library` as follows: from PIL import Image img = Image.open('xyz.jpg') But, got the following error: File "C:/Users/abc/PycharmProjects/untitled/open_image.py", line 2, in from PIL import Image File "C:\Python34\lib\site-packag

import math error

2014-11-16 Thread ryguy7272
When I type 'import math', it seems like my Python recognizes this library. Great. When I try to run the following script, I get an error, which suggests (to me) the math library is not working correctly. Script: import math def main(): print "This program finds the real solutions to a

Re: PySide 1.2.2 setMaxWidth and AeroSnap

2014-11-16 Thread Vincent Vande Vyvre
Le 16/11/2014 19:09, Juan Christian a écrit : On Sun Nov 16 2014 at 3:46:40 PM Vincent Vande Vyvre > wrote: No probleme with PyQt but I think this is a window manager question. Window, gnome, KDE, Mate, ... If your widget is a QMainWindow or

Re: PySide 1.2.2 setMaxWidth and AeroSnap

2014-11-16 Thread Juan Christian
On Sun Nov 16 2014 at 3:46:40 PM Vincent Vande Vyvre < vincent.vande.vy...@telenet.be> wrote: > > No probleme with PyQt but I think this is a window manager question. > Window, gnome, KDE, Mate, ... > > > If your widget is a QMainWindow or a QDialog add a size grip: > > self.setSizeGripEna

Re: PySide 1.2.2 setMaxWidth and AeroSnap

2014-11-16 Thread Vincent Vande Vyvre
Le 16/11/2014 16:51, Juan Christian a écrit : PySide 1.2.2 Python 3.4.2 Code: from PySide.QtGui import * class MainWindow(QWidget): def __init__(self): QWidget.__init__(self) self.setMinimumSize(600, 700) self.setMaximumWidth(600) self.setLayout(QVBoxLayout()) * Call to this module in another

Re: OTish: using short-term TCP connections to send to multiple slaves

2014-11-16 Thread Grant Edwards
On 2014-11-16, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> UDP for anything more than your network's MTU is inefficient > > Why do you say it's inefficient? Sure, the UDP datagram will get > fragmented and re-assembled at the other end, but it's not like TCP > would do any be

Re: OTish: using short-term TCP connections to send to multiple slaves

2014-11-16 Thread Roy Smith
In article , Chris Angelico wrote: > UDP for anything more than your network's MTU is inefficient Why do you say it's inefficient? Sure, the UDP datagram will get fragmented and re-assembled at the other end, but it's not like TCP would do any better. One way or another, your data is going

Re: How about some syntactic sugar for " __name__ == '__main__' "?

2014-11-16 Thread Ian Kelly
On Sun, Nov 16, 2014 at 3:39 AM, Vito De Tullio wrote: > for the "right time" you can choose to spin a thread and wait to the end of > the load of the module Yuck. "Just add threads" is /not/ the answer to everything. This case looks fairly harmless on the surface, although I could imagine it br

Re: OTish: using short-term TCP connections to send to multiple slaves

2014-11-16 Thread Grant Edwards
On 2014-11-16, Chris Angelico wrote: > >> OK, no big requirements, but 64K is still way too much to consider UDP. > > I wouldn't say "way too much"; the packet limit for UDP is actually > 64KB (minus a few bytes of headers). But UDP for anything more than > your network's MTU is inefficient, plus

Re: OTish: using short-term TCP connections to send to multiple slaves

2014-11-16 Thread Grant Edwards
On 2014-11-16, jkn wrote: > I have a use case of a single 'master' machine which will need to > periodically 'push' data to a variety of 'slave' devices on a small > local subnet, over Ethernet. We are talking perhaps a dozen devices > in all with comms occurring perhaps once very few seconds, to

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-16 Thread Grant Edwards
On 2014-11-16, Steven D'Aprano wrote: > Grant Edwards wrote: > >> On 2014-11-15, Steven D'Aprano >> wrote: >>> pythonista wrote: >>> I am developing a python application as a contractor. I would like to know if someone can provide me with some insight into the problems that t

Re: python on android: where to start

2014-11-16 Thread maurog
Il Fri, 14 Nov 2014 16:48:41 +, Phil Thompson ha scritto: > On 14/11/2014 2:18 pm, maurog wrote: >> I looked at the newsgroup, but I didn't find recent infos on this >> topic. >> On the other side I went lost by looking for this topic with google. So >> I'm asking you my question, if I want to

PySide 1.2.2 setMaxWidth and AeroSnap

2014-11-16 Thread Juan Christian
PySide 1.2.2 Python 3.4.2 Code: from PySide.QtGui import * class MainWindow(QWidget): def __init__(self): QWidget.__init__(self) self.setMinimumSize(600, 700) self.setMaximumWidth(600) self.setLayout(QVBoxLayout()) * Call to this module in another module * app = QApplication(sys.argv) window =

PySided (PyQted) question

2014-11-16 Thread doob
Help please. http://veroboard.eu/?qa=26/need-to-convert-qgraphicsitem-to-svg-element-s-in-qt-python -- https://mail.python.org/mailman/listinfo/python-list

Re: OTish: using short-term TCP connections to send to multiple slaves

2014-11-16 Thread Chris Angelico
On Mon, Nov 17, 2014 at 12:43 AM, Alain Ketterlin wrote: > jkn writes: > >> I have a use case of a single 'master' machine which will need to >> periodically 'push' data to a variety of 'slave' devices on a small local >> subnet, over Ethernet. We are talking perhaps a dozen devices in all with >

Re: OTish: using short-term TCP connections to send to multiple slaves

2014-11-16 Thread Alain Ketterlin
jkn writes: > I have a use case of a single 'master' machine which will need to > periodically 'push' data to a variety of 'slave' devices on a small local > subnet, over Ethernet. We are talking perhaps a dozen devices in all with > comms occurring perhaps once very few seconds, to much less

Re: encode and decode builtins

2014-11-16 Thread Ned Batchelder
On 11/16/14 2:39 AM, Garrett Berg wrote: I made the switch to python 3 about two months ago, and I have to say I love everything about it, /especially/ the change to using only bytes and str (no more unicode! or... everything is unicode!) As someone who works with embedded devices, it is great to

Re: OTish: using short-term TCP connections to send to multiple slaves

2014-11-16 Thread Marko Rauhamaa
jkn : > Although this ... works ..., we have had trouble maintaining the > connection, for reasons ... I am not yet fully aware of. I can see your TCP connections are choppy. Your posting is breaking up. Seriously, though, there shouldn't be any reason for TCP connections dropping on their own.

Re: [ANN] Brython 3.0.0 relased

2014-11-16 Thread Steven D'Aprano
Pierre Quentel wrote: > Hi, > > Version 3.0.0 of Brython has been released recently > > Brython is an implementation of Python 3 running in the browser, with an > interface to DOM elements and events. It allows writing web client > applications with Python instead of Javascript. Very nice! -

Re: OTish: using short-term TCP connections to send to multiple slaves

2014-11-16 Thread Chris Angelico
On Sun, Nov 16, 2014 at 11:02 PM, jkn wrote: > I have a use case of a single 'master' machine which will need to > periodically 'push' data to a variety of 'slave' devices on a small local > subnet, over Ethernet. We are talking perhaps a dozen devices in all with > comms occurring perhaps once ve

OTish: using short-term TCP connections to send to multiple slaves

2014-11-16 Thread jkn
Hi all This is a little bit OT for this newsgroup, but I intend to use python for prototyping at least, and I know there are a lot of knowledgeable people using Python in a Network context here... I have a use case of a single 'master' machine which will need to periodically 'push' data to

Re: How about some syntactic sugar for " __name__ == '__main__' "?

2014-11-16 Thread Vito De Tullio
Ian Kelly wrote: >> def main(func): >> if func.__module__ == "__main__": >> func() >> return func # The return could be omitted to block the function from >> being manually called after import. >> >> Just decorate the "main" function of the script with that, and it will be >> a

Re: How about some syntactic sugar for " __name__ == '__main__' "?

2014-11-16 Thread Vito De Tullio
Steven D'Aprano wrote: > Chris Kaynor wrote: > >> I was thinking along the lines of replacing: >> >> if __name__ == "__main__": >> <<>> >> >> with >> >> @main >> def myFunction() >> <<<> >> >> Both blocks of code will be called at the same time. > > > You can't guarantee that, because you c

Re: Where is inspect() located?

2014-11-16 Thread Chris Angelico
On Sun, Nov 16, 2014 at 9:12 PM, Albert Visser wrote: > On Sun, 16 Nov 2014 05:12:36 +0100, Igor Korot wrote: > > import lib >> >> Traceback (most recent call last): >> File "", line 1, in >> ImportError: No module named lib > > >> >> In the https://docs.python.org/2/library/inspec

Re: Where is inspect() located?

2014-11-16 Thread Albert Visser
On Sun, 16 Nov 2014 05:12:36 +0100, Igor Korot wrote: import lib Traceback (most recent call last): File "", line 1, in ImportError: No module named lib In the https://docs.python.org/2/library/inspect.html, it says it is located in Lib/inspect.py. What am I missing? Or its only for 3.

Re: [ANN] Brython 3.0.0 relased

2014-11-16 Thread Marko Rauhamaa
Pierre Quentel : > Version 3.0.0 of Brython has been released recently A timely notification! I have just introduced some server-side Python to my son and was about to start talking about client-side JavaScript. We'll give Brython a spin, instead. I'll spread the message at the office as well.

Re: isiter builtin

2014-11-16 Thread Terry Reedy
On 11/16/2014 2:57 AM, Garrett Berg wrote: (how often have you iterated over a string?) Often enough, but perhaps more often have written functions for which a string is as valid an input as many other iterables. def cross(iterable, reiterable): for a in iterable: for b in reiter

Re: caught in the import web again

2014-11-16 Thread Chris Angelico
On Sun, Nov 16, 2014 at 7:53 PM, Charles T. Smith wrote: > Yes, we're talking about recursive imports here. It's a complex, object- > oriented system with big classes and little classes that are strongly > interrelated. I can get the imports configured properly so everything > works but if I mak

Re: Efficient Threading

2014-11-16 Thread Marko Rauhamaa
Dan Stromberg : > On Fri, Nov 14, 2014 at 10:42 AM, Empty Account wrote: >> I am thinking about writing a load test tool in Python, so I am >> interested in how I can create the most concurrent threads/processes >> with the fewest OS resources. I would imagine that I/O would need to >> be non-blo

Re: isiter builtin

2014-11-16 Thread Peter Otten
Garrett Berg wrote: > I have been working with python for a few years now, and two of my > favorite features about it are iterators and duck typing. The fact that > every iterator under the sun can be accessed with a simple for loop is one > of the most amazing features of python. > > However, th

[ANN] Brython 3.0.0 relased

2014-11-16 Thread Pierre Quentel
Hi, Version 3.0.0 of Brython has been released recently Brython is an implementation of Python 3 running in the browser, with an interface to DOM elements and events. It allows writing web client applications with Python instead of Javascript. Python programs are inserted in the HTML page insi

Re: caught in the import web again

2014-11-16 Thread Charles T. Smith
On Sun, 16 Nov 2014 08:14:05 +0100, dieter wrote: > "Charles T. Smith" writes: >> Now, I'm getting these errors: >> >> ImportError: cannot import name ... >> >> and >> >> AttributeError: 'module' object has no attribute ... >> >> (what is 'module'?) >> >> Is there a way to resolve this withou

  1   2   >