Re: How to recover bytes function?

2014-11-13 Thread Cameron Simpson
On 13Nov2014 14:32, satishmlm...@gmail.com wrote: file = open('data.bin', 'rb') bytes = file.read() bytes b'\x00\x00\x00\x02spam\x00\x03?\x9d\xf3\xb6' records = [bytes([char] * 8) for char in b'spam'] TypeError: 'bytes' object is not callable How to recover bytes function? The best way is not

Re: io.UnsupportedOperation: fileno

2014-11-13 Thread Cameron Simpson
On 14Nov2014 10:52, Ben Finney wrote: satishmlm...@gmail.com writes: fileno() in not supported. It is supported, but it is behaving as the documentation describes https://docs.python.org/3/library/io.html#io.IOBase.fileno>. Is it only in 3.1? What is the workaround? Expect an exception w

Re: fileno() not supported in Python 3.1

2014-11-13 Thread Cameron Simpson
On 13Nov2014 15:48, satishmlm...@gmail.com wrote: import sys for stream in (sys.stdin, sys.stdout, sys.stderr): print(stream.fileno()) io.UnsupportedOperation: fileno Is there a workaround? The first workaround that suggests itself it to use a more modern Python. I've got 3.4.2 h

Python 3.x (beazley): __context__ vs __cause__ attributes in exception handling

2014-11-13 Thread Veek M
In 'Chained Exceptions' - Beazley pg:626 try: pass except ValueError as e: raise SyntaxError('foo bar') from e - Here, if ValueError is raised and SyntaxError is then raised.. 'e' contains __cause__ which points to the ValueError Traceback. He goes on to say: --

Re: Python: package root, root-node, __init__.py in the package root

2014-11-13 Thread dieter
Veek M writes: > I have a package structured like so on the file system: > PKG LIBS are stored here: /usr/lib/python3.2/ > Pkg-name: foo-1.0.0 > > 1. What is the root directory, or root-node or 'root' of my package? My > understanding is that it's: /usr/lib/python3.2/foo-1.0.0/ on the file-syste

Re: fileno() not supported in Python 3.1

2014-11-13 Thread Cameron Simpson
On 14Nov2014 13:52, Ben Finney wrote: satishmlm...@gmail.com writes: How to get file descriptor number for the following: sys.stdin sys.stdout sys.stderr Why do you need this? What are you intending to do? In fairness, who cares? It is a basic and reasonable thing to do. I did it only last

A new Help Vampire? (was Re: (too many threads)

2014-11-13 Thread Terry Reedy
On 11/13/2014 7:51 PM, satishmlm...@gmail.com wrote: in 4 different threads How to get file descriptors of sys.stdin, sys.stdout and sys.stderr? fileno() in not supported. Is it only in 3.1? What is the workaround? > io.UnsupportedOperation: fileno > How to give a file descriptor number to this

Re: Bad file descriptor

2014-11-13 Thread Mark Lawrence
On 13/11/2014 23:40, satishmlm...@gmail.com wrote: import os os.write(1, b'Hello descriptor world\n') OSError: Bad file descriptor How to give a file descriptor number to this function? How to get a file descriptor number? I suggest getting your cheque book out and paying for the advice you

Re: io.UnsupportedOperation: fileno

2014-11-13 Thread Mark Lawrence
On 13/11/2014 23:34, satishmlm...@gmail.com wrote: What is the problem and how to overcome this problem? RTFM. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: fileno() not supported in Python 3.1

2014-11-13 Thread Ben Finney
satishmlm...@gmail.com writes: > How to get file descriptor number for the following: > sys.stdin > sys.stdout > sys.stderr Why do you need this? What are you intending to do? -- \ “Crime is contagious… if the government becomes a lawbreaker, | `\ it breeds contempt for the la

Re: How to get file descriptors of sys.stdin, sys.stdout and sys.stderr?

2014-11-13 Thread Ned Batchelder
On 11/13/14 7:54 PM, satishmlm...@gmail.com wrote: How to get file descriptors of sys.stdin, sys.stdout and sys.stderr? You don't seem to be reading any of the responses you are getting. At the very least, you don't seem to be understanding them, or engaging with the authors. You are misbe

How to get file descriptors of sys.stdin, sys.stdout and sys.stderr?

2014-11-13 Thread satishmlmlml
How to get file descriptors of sys.stdin, sys.stdout and sys.stderr? -- https://mail.python.org/mailman/listinfo/python-list

How to get file descriptors of sys.stdin, sys.stdout and sys.stderr?

2014-11-13 Thread satishmlmlml
How to get file descriptors of sys.stdin, sys.stdout and sys.stderr? -- https://mail.python.org/mailman/listinfo/python-list

Re: Bad file descriptor

2014-11-13 Thread Roy Smith
In article , Ben Finney wrote: > satishmlm...@gmail.com writes: > > > import os > > os.write(1, b'Hello descriptor world\n') > > OSError: Bad file descriptor > > It works fine for me:: > > >>> import os > >>> os.write(1, b'Hello descriptor world\n') > Hello descriptor world >

Re: A Freudian slip of *EPIC PROPORTIONS*!

2014-11-13 Thread Terry Reedy
On 11/13/2014 6:11 PM, Rick Johnson wrote: # The parse functions have no idea what to do with # Unicode, so replace all Unicode characters with "x". # This is "safe" so long as the only characters germane # to parsing the structure of Python are 7-bit ASCII. # It's *nece

Re: fileno() not supported in Python 3.1

2014-11-13 Thread satishmlmlml
How to get file descriptor number for the following: sys.stdin sys.stdout sys.stderr It is displaying io.UnsupportedOperation: fileno error Kindly help. -- https://mail.python.org/mailman/listinfo/python-list

Re: Bad file descriptor

2014-11-13 Thread Ben Finney
satishmlm...@gmail.com writes: > import os > os.write(1, b'Hello descriptor world\n') > OSError: Bad file descriptor It works fine for me:: >>> import os >>> os.write(1, b'Hello descriptor world\n') Hello descriptor world 23 You don't say which Python, or which version, you're u

Re: fileno() not supported in Python 3.1

2014-11-13 Thread Ben Finney
satishmlm...@gmail.com writes: > Is there a workaround? Please take the time to gather your thoughts, do not fire off a rapid series of terse scattered questions. What is it you're trying to do? What approach are you intending to take? -- \“I was in Las Vegas, at the roulette table, h

Re: io.UnsupportedOperation: fileno

2014-11-13 Thread Ben Finney
satishmlm...@gmail.com writes: > fileno() in not supported. It is supported, but it is behaving as the documentation describes https://docs.python.org/3/library/io.html#io.IOBase.fileno>. > Is it only in 3.1? What is the workaround? Expect an exception when you ask for the file descriptor on a

fileno() not supported in Python 3.1

2014-11-13 Thread satishmlmlml
import sys for stream in (sys.stdin, sys.stdout, sys.stderr): print(stream.fileno()) io.UnsupportedOperation: fileno Is there a workaround? -- https://mail.python.org/mailman/listinfo/python-list

Re: io.UnsupportedOperation: fileno

2014-11-13 Thread Ben Finney
satishmlm...@gmail.com writes: > What is the problem and how to overcome this problem? First, please provide context (just as the previous respondent did), so your message may be understood in the absence of those prior. https://en.wikipedia.org/wiki/Posting_style#Interleaved_style> As to your q

Re: Bad file descriptor

2014-11-13 Thread sohcahtoa82
On Thursday, November 13, 2014 3:40:50 PM UTC-8, satish...@gmail.com wrote: > import os > os.write(1, b'Hello descriptor world\n') > OSError: Bad file descriptor > > How to give a file descriptor number to this function? How to get a file > descriptor number? http://bit.ly/1zRWHyq -- https://ma

Bad file descriptor

2014-11-13 Thread satishmlmlml
import os os.write(1, b'Hello descriptor world\n') OSError: Bad file descriptor How to give a file descriptor number to this function? How to get a file descriptor number? -- https://mail.python.org/mailman/listinfo/python-list

Re: io.UnsupportedOperation: fileno

2014-11-13 Thread satishmlmlml
fileno() in not supported. Is it only in 3.1? What is the workaround? -- https://mail.python.org/mailman/listinfo/python-list

Re: io.UnsupportedOperation: fileno

2014-11-13 Thread Chris Angelico
On Fri, Nov 14, 2014 at 10:34 AM, wrote: > What is the problem and how to overcome this problem? The problem is that you're posting, with no context, a query relating to a former post which gave scanty information and no indication of what you expected. To overcome this, read this: http://www.c

Re: How to recover bytes function?

2014-11-13 Thread Ben Finney
satishmlm...@gmail.com writes: > file = open('data.bin', 'rb') > bytes = file.read() These are both terrible names, not least because they clobber the built-in objects ‘file’ and ‘bytes’. Don't name an object for *or not only for) its data type. Instead, choose names that convey the *purpose* fo

Re: help please: tkinter grid layout is very slow

2014-11-13 Thread Chris Angelico
On Fri, Nov 14, 2014 at 7:45 AM, Rich Cook wrote: > print "There are", numimages, "images" # 256 in fact... > for imagenum, (row, col) in enumerate([(row,col) for row in range(numrows) > for col in range(numcols)]): > b = Tkinter.Label(frame, compound = Tkinter.TOP) > b['text'] = os.path

Re: A Freudian slip of *EPIC PROPORTIONS*!

2014-11-13 Thread Chris Angelico
On Fri, Nov 14, 2014 at 10:11 AM, Rick Johnson wrote: > # The parse functions have no idea what to do with > # Unicode, so replace all Unicode characters with "x". > # This is "safe" so long as the only characters germane > # to parsing the structure of Python are 7-bit ASCII. >

Re: io.UnsupportedOperation: fileno

2014-11-13 Thread satishmlmlml
What is the problem and how to overcome this problem? -- https://mail.python.org/mailman/listinfo/python-list

Re: io.UnsupportedOperation: fileno

2014-11-13 Thread sohcahtoa82
On Thursday, November 13, 2014 3:23:24 PM UTC-8, satish...@gmail.com wrote: > import sys > for stream in (sys.stdin, sys.stdout, sys.stderr): >print(stream.fileno()) > > > io.UnsupportedOperation: fileno Yup. That's what I'd expect to see. -- https://mail.python.org/mailman/listinf

io.UnsupportedOperation: fileno

2014-11-13 Thread satishmlmlml
import sys for stream in (sys.stdin, sys.stdout, sys.stderr): print(stream.fileno()) io.UnsupportedOperation: fileno -- https://mail.python.org/mailman/listinfo/python-list

Re: Help with Python Multiprocessing

2014-11-13 Thread Anurag
On Thursday, November 13, 2014 2:22:29 PM UTC-5, Gary Herron wrote: > On 11/13/2014 10:07 AM, Anurag wrote: > > I am having trouble understanding the Multiprocessing module. > > I need to run three different files 'Worker1' , 'Worker2', 'Worker3' all at > > once. Currently I am doing this : > > >

Re: Help with Python Multiprocessing

2014-11-13 Thread Anurag
On Thursday, November 13, 2014 2:18:50 PM UTC-5, sohca...@gmail.com wrote: > On Thursday, November 13, 2014 10:07:56 AM UTC-8, Anurag wrote: > > I am having trouble understanding the Multiprocessing module. > > I need to run three different files 'Worker1' , 'Worker2', 'Worker3' all at > > once. C

Re: How to recover bytes function?

2014-11-13 Thread sohcahtoa82
On Thursday, November 13, 2014 2:32:47 PM UTC-8, satish...@gmail.com wrote: > file = open('data.bin', 'rb') > bytes = file.read() > bytes > b'\x00\x00\x00\x02spam\x00\x03?\x9d\xf3\xb6' > records = [bytes([char] * 8) for char in b'spam'] > TypeError: 'bytes' object is not callable > > How to recove

A Freudian slip of *EPIC PROPORTIONS*!

2014-11-13 Thread Rick Johnson
Some of the folks on this list have attempted to shame me for not accepting "with open arms", this vile encoding we call Unicode, but i wonder, are they aware of the deepest held beliefs of our very own leader? The other day whilst perusing the idlelib i came across a small but *very* significant

Re: How to recover bytes function?

2014-11-13 Thread Chris Angelico
On Fri, Nov 14, 2014 at 9:32 AM, wrote: > file = open('data.bin', 'rb') > bytes = file.read() > bytes > b'\x00\x00\x00\x02spam\x00\x03?\x9d\xf3\xb6' > records = [bytes([char] * 8) for char in b'spam'] > TypeError: 'bytes' object is not callable > > How to recover bytes function? del bytes Chris

Re: How to recover bytes function?

2014-11-13 Thread MRAB
On 2014-11-13 22:32, satishmlm...@gmail.com wrote: file = open('data.bin', 'rb') bytes = file.read() bytes b'\x00\x00\x00\x02spam\x00\x03?\x9d\xf3\xb6' records = [bytes([char] * 8) for char in b'spam'] TypeError: 'bytes' object is not callable How to recover bytes function? The simple answer:

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

2014-11-13 Thread Ian Kelly
On Thu, Nov 13, 2014 at 1:53 PM, Skip Montanaro wrote: > On Thu, Nov 13, 2014 at 2:44 PM, Skip Montanaro > wrote: >> What's not documented is >> the behavior of calling atexit.register() while atexit._run_exitfuncs >> is running. That's an implementation detail, and though unlikely to >> change,

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

2014-11-13 Thread Ian Kelly
On Thu, Nov 13, 2014 at 1:44 PM, Skip Montanaro wrote: > On Thu, Nov 13, 2014 at 2:33 PM, Ian Kelly wrote: >> ... other things decorated with atexit.register >> might actually be called before the main function > > I don't think that will happen. The atexit module is documented to > execute its e

How to recover bytes function?

2014-11-13 Thread satishmlmlml
file = open('data.bin', 'rb') bytes = file.read() bytes b'\x00\x00\x00\x02spam\x00\x03?\x9d\xf3\xb6' records = [bytes([char] * 8) for char in b'spam'] TypeError: 'bytes' object is not callable How to recover bytes function? -- https://mail.python.org/mailman/listinfo/python-list

Re: I don't read docs and don't know how to use Google. What does the print function do?

2014-11-13 Thread giacomo boffi
"Clayton Kirkwood" writes: > Although I suspect for a price you could bring all of your > professional programming jobs to somebody here, but I think you > would pay out more than you would make. s/ here/ else/ and your assumption can be falsified -- https://mail.python.org/mailman/listinfo/pyt

Re: help please: tkinter grid layout is very slow

2014-11-13 Thread Terry Reedy
On 11/13/2014 3:45 PM, Rich Cook wrote: Hi, I'm trying to toss together an image browser in tkinter, and it is so slow it is unworkable. Here is my code. Can someone point out why it's so slw? :-) Thanks root = Tkinter.Tk() root.geometry("1000x280+300+300") label = Tkinter.Button(root,

Re: What does zip mean?

2014-11-13 Thread giacomo boffi
Grant Edwards writes: > No, you don't. That's not how a zipper works. Each tooth from side A, > isn't bound with one from side B. It's bound with _two_ of them from > side B. And each of those is in turn bound with an additional tooth > from side A, and so on... > >> In your program you have tw

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

2014-11-13 Thread Skip Montanaro
On Thu, Nov 13, 2014 at 2:44 PM, Skip Montanaro wrote: > What's not documented is > the behavior of calling atexit.register() while atexit._run_exitfuncs > is running. That's an implementation detail, and though unlikely to > change, it might be worthwhile getting that behavior documented. http:/

help please: tkinter grid layout is very slow

2014-11-13 Thread Rich Cook
Hi, I'm trying to toss together an image browser in tkinter, and it is so slow it is unworkable. Here is my code. Can someone point out why it's so slw? :-) Thanks root = Tkinter.Tk() root.geometry("1000x280+300+300") label = Tkinter.Button(root, compound=Tkinter.TOP) label.pack() numim

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

2014-11-13 Thread Skip Montanaro
On Thu, Nov 13, 2014 at 2:33 PM, Ian Kelly wrote: > ... other things decorated with atexit.register > might actually be called before the main function I don't think that will happen. The atexit module is documented to execute its exit functions in reverse order. What's not documented is the beha

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

2014-11-13 Thread Ethan Furman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/13/2014 12:33 PM, Ian Kelly wrote: > On Thu, Nov 13, 2014 at 11:32 AM, Ethan Furman wrote: >> On 11/12/2014 01:51 PM, Ian Kelly wrote: >>> >>> On Wed, Nov 12, 2014 at 2:33 PM, Chris Kaynor wrote: A decorator is an interesting idea, a

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

2014-11-13 Thread Ian Kelly
On Thu, Nov 13, 2014 at 11:32 AM, Ethan Furman wrote: > On 11/12/2014 01:51 PM, Ian Kelly wrote: >> >> On Wed, Nov 12, 2014 at 2:33 PM, Chris Kaynor wrote: >>> >>> A decorator is an interesting idea, and should be easy to implement (only >>> lightly tested): >>> >>> def main(func): >>> if fun

Re: Communicating with a PHP script (and pretending I'm a browser)

2014-11-13 Thread Roy Smith
In article , Lie Ryan wrote: > On 13/11/14 03:57, Larry Martell wrote: > > We were all making this much harder than it is. I ended up doing this: > > > > wp = urllib.request.urlopen('http://php_page/?' + request.POST.urlencode()) > > pw = wp.read() You can do this if you want, but it's much eas

Re: Help with Python Multiprocessing

2014-11-13 Thread Gary Herron
On 11/13/2014 10:07 AM, Anurag wrote: I am having trouble understanding the Multiprocessing module. I need to run three different files 'Worker1' , 'Worker2', 'Worker3' all at once. Currently I am doing this : from multiprocessing import Process import Worker1.py import Worker2.py import Worke

Re: Help with Python Multiprocessing

2014-11-13 Thread sohcahtoa82
On Thursday, November 13, 2014 10:07:56 AM UTC-8, Anurag wrote: > I am having trouble understanding the Multiprocessing module. > I need to run three different files 'Worker1' , 'Worker2', 'Worker3' all at > once. Currently I am doing this : > > from multiprocessing import Process > > import Wor

Re: Help with Python Multiprocessing

2014-11-13 Thread MRAB
On 2014-11-13 18:10, Anurag wrote: On Thursday, November 13, 2014 1:07:56 PM UTC-5, Anurag wrote: I am having trouble understanding the Multiprocessing module. I need to run three different files 'Worker1' , 'Worker2', 'Worker3' all at once. Currently I am doing this : from multiprocessing imp

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

2014-11-13 Thread Ethan Furman
On 11/12/2014 01:51 PM, Ian Kelly wrote: On Wed, Nov 12, 2014 at 2:33 PM, Chris Kaynor wrote: A decorator is an interesting idea, and should be easy to implement (only lightly tested): def main(func): if func.__module__ == "__main__": func() return func # The return coul

Re: Help with Python Multiprocessing

2014-11-13 Thread Anurag
On Thursday, November 13, 2014 1:07:56 PM UTC-5, Anurag wrote: > I am having trouble understanding the Multiprocessing module. > I need to run three different files 'Worker1' , 'Worker2', 'Worker3' all at > once. Currently I am doing this : > > from multiprocessing import Process > > import Work

Help with Python Multiprocessing

2014-11-13 Thread Anurag
I am having trouble understanding the Multiprocessing module. I need to run three different files 'Worker1' , 'Worker2', 'Worker3' all at once. Currently I am doing this : from multiprocessing import Process import Worker1.py import Worker2.py import Worker3.py p1 = Process(target=Worker1.py)

netaddr value back to IP

2014-11-13 Thread Noah
Hi there List, I am trying to get a value back to IP using the netaddr python module. How do I get the value 'ip' back to IP format? how is it done? snip print IPNetwork(v4_peer_ip).value ip = IPNetwork(v4_peer_ip).value + 1 print ip --- snip --- Cheers, Noah -- https:/

Re: Synchronizing a sound with a widget change

2014-11-13 Thread Dave Angel
"Yimr Zero" Wrote in message: > body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; > margin-left: 0.5em; }body { font-size: 10.5pt; font-family: 'Segoe UI'; > color: rgb(0, 0, 0); line-height: 1.5; } > Hi, > You may try to add the sleep(5) after the color change statemen

Re: [Python-Dev] Dinamically set __call__ method

2014-11-13 Thread Lie Ryan
On 05/11/14 06:15, Roberto Martínez wrote: The thing with this is tricky. I need the change in the instance, > not in the class, because I have multiple instances and all of > them must have different implementations of __call__. Why not just use functions with closure if that's what you need?

Re: ssl error with the python mac binary

2014-11-13 Thread Paul Wiseman
On 12 November 2014 19:52, Ned Deily wrote: > In article > , > Paul Wiseman wrote: >> I'm currently using the installer with py2app to make a distributable >> app that targets 10.5+ (including ppc). To save having more than one >> build I use this for all downloads. Although I'm starting to cons

Re: Communicating with a PHP script (and pretending I'm a browser)

2014-11-13 Thread Lie Ryan
On 13/11/14 03:57, Larry Martell wrote: We were all making this much harder than it is. I ended up doing this: wp = urllib.request.urlopen('http://php_page/?' + request.POST.urlencode()) pw = wp.read() I was about that suggest that actually, just be careful to escape things properly. Although

Re: Synchronizing a sound with a widget change

2014-11-13 Thread Yimr Zero
Hi, You may try to add the sleep(5) after the color change statement. You could adjust the sleep time to let the color change and beep synchroize. Thanks. Yimr Zero From: ast Date: 2014-11-13 18:50 To: python-list Subject: Synchronizing a sound with a widget change Hello, here is a small te

Re: I love assert

2014-11-13 Thread Lie Ryan
On 13/11/14 10:05, Ian Kelly wrote: On Wed, Nov 12, 2014 at 3:47 PM, Marko Rauhamaa wrote: Ian Kelly : Apart from idiomatic style, there is no difference between # never reached assert False raise RuntimeError('Unreachable code reached') If the purpose is communication, the

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

2014-11-13 Thread Chris Angelico
On Fri, Nov 14, 2014 at 12:33 AM, Roy Smith wrote: > ... you also get to not worry > about what order things are defined. That's only as regards the interpreter, though. My point has nothing to do with the order the interpreter sees things, it's all about how they're laid out for humans to read.

Re: [Python-Dev] Dinamically set __call__ method

2014-11-13 Thread Fabio Zadrozny
On Thu, Nov 13, 2014 at 2:20 AM, Gregory Ewing wrote: > Fabio Zadrozny wrote: > >> can someone from python-dev give some background of why that's the way it >> is? >> > > It's because, with new-style classes, a class is also an > instance (of class "type" or a subclass thereof). So > without that

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

2014-11-13 Thread Roy Smith
In article , Chris Angelico wrote: > On Thu, Nov 13, 2014 at 7:47 PM, Cameron Simpson wrote: > > My view is that if there's a main (i.e. the module implements a small app > > all on its own, however tiny), then the main program logic should come > > first. The details follow later. > > Ah, I s

Re: Synchronizing a sound with a widget change

2014-11-13 Thread ast
"Dave Angel" a écrit dans le message de news:mailman.15773.1415878987.18130.python-l...@python.org... I don't use Windows, but from what I read, winsound.Beep is a blocking call, and therefore must not be used in the main thread of a gui environment. Once the function is called, no events

Re: Synchronizing a sound with a widget change

2014-11-13 Thread Dave Angel
"ast" Wrote in message: > > "ast" a écrit dans le message de > news:54648e75$0$12771$426a7...@news.free.fr... >> >> "ast" a écrit dans le message de >> news:54648d03$0$1981$426a7...@news.free.fr... >> >>> >>> I have the idea to run an other thread to emit the sound, but I didn't try >>> yet.

Re: Synchronizing a sound with a widget change

2014-11-13 Thread ast
"ast" a écrit dans le message de news:54648e75$0$12771$426a7...@news.free.fr... "ast" a écrit dans le message de news:54648d03$0$1981$426a7...@news.free.fr... I have the idea to run an other thread to emit the sound, but I didn't try yet. Is it the solution ? nope, still doesn't work

Re: Synchronizing a sound with a widget change

2014-11-13 Thread ast
"ast" a écrit dans le message de news:54648d03$0$1981$426a7...@news.free.fr... I have the idea to run an other thread to emit the sound, but I didn't try yet. Is it the solution ? nope, still doesn't work ! --- from tkinter import Tk, Frame from wi

Synchronizing a sound with a widget change

2014-11-13 Thread ast
Hello, here is a small test code: from tkinter import Tk, Frame from winsound import Beep root = Tk() f = Frame(root, width=300, height=300) f.pack() f.config(bg='Yellow') Beep(2000, 1000) -- I intended to change the frame color to yellow (f.config(bg='Yellow')) a

PyDev 3.9.0 Released

2014-11-13 Thread Fabio Zadrozny
What is PyDev? --- PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and IronPython development. It comes with goodies such as code completion, syntax highlighting, syntax analysis, code analysis, refactor, debug, interactive console, etc. Details on

Re: xml problem in parsing the great grandchildren

2014-11-13 Thread Peter Otten
OmPs wrote: > import xml.etree.ElementTree as ET > > inv = open('lshw.xml', 'r') > inv = inv.read() > inv = ET.XML(inv) > > find_memory =inventory.findall(".//node[@id='bank:*']") > > # I am stuck here. What is required is description of the system memory, > but system has lot of places where

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

2014-11-13 Thread Chris Angelico
On Thu, Nov 13, 2014 at 7:47 PM, Cameron Simpson wrote: > My view is that if there's a main (i.e. the module implements a small app > all on its own, however tiny), then the main program logic should come > first. The details follow later. Ah, I see. Makes sense. It's kinda like an executable doc

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

2014-11-13 Thread Cameron Simpson
On 13Nov2014 19:04, Chris Angelico wrote: On Thu, Nov 13, 2014 at 6:23 PM, Cameron Simpson wrote: Indeed. This aspect is a deal breaker for me; I'd never use it. I make a point of putting the module's main function right up the top, immediately after the imports and any "constants" (let's not

xml problem in parsing the great grandchildren

2014-11-13 Thread OmPs
http://pastebin.com/GCD6J0wd I am stuck here. What I am looking for is description of the system memory, but system has lot of places where class=memory is used and hence i can't use it. i need the one's which has id=bank:0 .. n and collect the decryption of it. I don't have option to use lxml.

Python: package root, root-node, __init__.py in the package root

2014-11-13 Thread Veek M
I have a package structured like so on the file system: PKG LIBS are stored here: /usr/lib/python3.2/ Pkg-name: foo-1.0.0 1. What is the root directory, or root-node or 'root' of my package? My understanding is that it's: /usr/lib/python3.2/foo-1.0.0/ on the file-system and this is referred to t

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

2014-11-13 Thread Chris Angelico
On Thu, Nov 13, 2014 at 6:23 PM, Cameron Simpson wrote: > Indeed. This aspect is a deal breaker for me; I'd never use it. > > I make a point of putting the module's main function right up the top, > immediately after the imports and any "constants" (let's not dither over > that term). I _want_ the