Re: Calling a list of functions

2015-12-13 Thread Anand
On Sunday, December 13, 2015 at 9:26:52 AM UTC-8, Ganesh Pal wrote: > Hi Team, > > Iam on linux and python 2.7 . I have a bunch of functions which I > have run sequentially . > I have put them in a list and Iam calling the functions in the list as > shown below , this works fine for me , please

Re: List of integers

2015-12-13 Thread KP
On Sunday, 13 December 2015 16:33:20 UTC-8, Chris Angelico wrote: > On Mon, Dec 14, 2015 at 11:24 AM, KP <> wrote: > > data = list(f.read(4)) > > print data > > > > from a binary file might give > > > > ['\x10', '\x20', '\x12', '\x01'] > > > > > > How can I receive this instead? > > > > [0x10, 0x2

Re: Calling a list of functions

2015-12-13 Thread Chris Angelico
On Mon, Dec 14, 2015 at 1:43 PM, Steven D'Aprano wrote: > Why do people do this? > > "Hi, here's a cake a made earlier, I think it tastes really nice. What do > you think?" > > "That's not a cake. It's a bowl of mud with a cherry on top. Where is the > actual cake?" Steven, haven't you ever had a

Re: Calling a list of functions

2015-12-13 Thread Steven D'Aprano
On Mon, 14 Dec 2015 04:26 am, Ganesh Pal wrote: > Hi Team, > > Iam on linux and python 2.7 . I have a bunch of functions which I > have run sequentially . > I have put them in a list and Iam calling the functions in the list as > shown below , this works fine for me , No it doesn't. It doesn

Re: Help on class understanding in pymc code

2015-12-13 Thread Robert
On Sunday, December 13, 2015 at 8:10:25 PM UTC-5, Peter Otten wrote: > Robert wrote: > > > Hi, > > > > I follow code example at link: > > > > https://users.obs.carnegiescience.edu/cburns/ipynbs/PyMC.html > > > > > > There is the following code line: > > > > sampler = pymc.MCMC([alpha,betax,be

Re: Help on class understanding in pymc code

2015-12-13 Thread Peter Otten
Robert wrote: > Hi, > > I follow code example at link: > > https://users.obs.carnegiescience.edu/cburns/ipynbs/PyMC.html > > > There is the following code line: > > sampler = pymc.MCMC([alpha,betax,betay,eps,model,tau,z_obs,x_true,y_true]) > > > I want to know the detail of pymc.MCMC, then

Help on class understanding in pymc code

2015-12-13 Thread Robert
Hi, I follow code example at link: https://users.obs.carnegiescience.edu/cburns/ipynbs/PyMC.html There is the following code line: sampler = pymc.MCMC([alpha,betax,betay,eps,model,tau,z_obs,x_true,y_true]) I want to know the detail of pymc.MCMC, then I get help content of it with: /

Re: List of integers

2015-12-13 Thread Chris Angelico
On Mon, Dec 14, 2015 at 11:24 AM, KP wrote: > data = list(f.read(4)) > print data > > from a binary file might give > > ['\x10', '\x20', '\x12', '\x01'] > > > How can I receive this instead? > > [0x10, 0x20, 0x12, 0x01] > > Thanks for all help! Try this: data = [ord(x) for x in f.read(4)] Note

List of integers

2015-12-13 Thread KP
data = list(f.read(4)) print data from a binary file might give ['\x10', '\x20', '\x12', '\x01'] How can I receive this instead? [0x10, 0x20, 0x12, 0x01] Thanks for all help! -- https://mail.python.org/mailman/listinfo/python-list

Re: Why is break allowed in finally, but continue is not?

2015-12-13 Thread Ben Finney
Ned Batchelder writes: > For testing coverage.py, I wrote a program to generate > randomly-structured Python functions. When compiling > the results, I got a message I'd never seen before: > > SyntaxError: 'continue' not supported inside 'finally' clause > > I guess this makes sense, when cleani

Why is break allowed in finally, but continue is not?

2015-12-13 Thread Ned Batchelder
For testing coverage.py, I wrote a program to generate randomly-structured Python functions. When compiling the results, I got a message I'd never seen before: SyntaxError: 'continue' not supported inside 'finally' clause I guess this makes sense, when cleaning up from an exception, continuing t

Re: Weird list conversion

2015-12-13 Thread Chris Angelico
On Mon, Dec 14, 2015 at 7:31 AM, Erik wrote: > On 13/12/15 20:28, Erik wrote: >> >> When you call "print", then the list class's __repr__() method is called >> which in turn calls the contained objects' __repr__() methods in turn > > > I mean the __str__() method, not __repr__() in this case - how

Re: Weird list conversion

2015-12-13 Thread Larry Hudson via Python-list
On 12/13/2015 12:05 PM, KP wrote: On Sunday, 13 December 2015 11:57:57 UTC-8, Laura Creighton wrote: In a message of Sun, 13 Dec 2015 11:45:19 -0800, KP writes: Hi all, f = open("stairs.bin", "rb") data = list(f.read(16)) print data returns ['=', '\x04', '\x00', '\x05', '\

Re: Weird list conversion

2015-12-13 Thread Erik
On 13/12/15 20:28, Erik wrote: When you call "print", then the list class's __repr__() method is called which in turn calls the contained objects' __repr__() methods in turn I mean the __str__() method, not __repr__() in this case - however, the answer is otherwise the same. E. -- https://m

Re: Weird list conversion

2015-12-13 Thread Ian Kelly
On Sun, Dec 13, 2015 at 1:05 PM, KP wrote: > On Sunday, 13 December 2015 11:57:57 UTC-8, Laura Creighton wrote: >> In a message of Sun, 13 Dec 2015 11:45:19 -0800, KP writes: >> >Hi all, >> > >> > f = open("stairs.bin", "rb") >> > data = list(f.read(16)) >> > print data >> > >> >re

Re: Weird list conversion

2015-12-13 Thread Erik
On 13/12/15 20:05, KP wrote: On Sunday, 13 December 2015 11:57:57 UTC-8, Laura Creighton wrote: In a message of Sun, 13 Dec 2015 11:45:19 -0800, KP writes: Hi all, f = open("stairs.bin", "rb") data = list(f.read(16)) print data returns ['=', '\x04', '\x00', '\x05', '\x00', '\x01', '\x00', '

Re: Weird list conversion

2015-12-13 Thread KP
On Sunday, 13 December 2015 11:57:57 UTC-8, Laura Creighton wrote: > In a message of Sun, 13 Dec 2015 11:45:19 -0800, KP writes: > >Hi all, > > > > f = open("stairs.bin", "rb") > > data = list(f.read(16)) > > print data > > > >returns > > > >['=', '\x04', '\x00', '\x05', '\x00', '\

Re: Weird list conversion

2015-12-13 Thread Ian Kelly
On Sun, Dec 13, 2015 at 12:45 PM, wrote: > 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 fir

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', '\x0

Weird list conversion

2015-12-13 Thread high5storage
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

Re: Python IO Redirection to Console

2015-12-13 Thread Terry Reedy
On 12/13/2015 9:14 AM, austin aigbe wrote: I am trying to redirect the IO (stdout, stdin and stderr) to the console. For a program run from the console, console IO is the default. One must explicitly redirect to a file stream or pipe. At least on Windows, console IO is also the default for

Re: codecs.StreamRecoder not doing what I expected.

2015-12-13 Thread D'Arcy J.M. Cain
On Sun, 13 Dec 2015 13:17:24 +0100 Laura Creighton wrote: > 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

Re: Calling a list of functions

2015-12-13 Thread Grant Edwards
On 2015-12-13, Ganesh Pal wrote: > Hi Team, > > Iam on linux and python 2.7 . I have a bunch of functions which I > have run sequentially . I have put them in a list and Iam calling the > functions in the list as shown below , this works fine for me , > please share your opinion/views on the same

Re: Calling a list of functions

2015-12-13 Thread Ian Kelly
On Sun, Dec 13, 2015 at 10:26 AM, Ganesh Pal wrote: > Hi Team, > > Iam on linux and python 2.7 . I have a bunch of functions which I > have run sequentially . > I have put them in a list and Iam calling the functions in the list as > shown below , this works fine for me , please share your > op

Re: Calling a list of functions

2015-12-13 Thread Peter Otten
Ganesh Pal wrote: > Hi Team, > > Iam on linux and python 2.7 . I have a bunch of functions which I > have run sequentially . > I have put them in a list and Iam calling the functions in the list as > shown below , this works fine for me , please share your > opinion/views on the same > > > S

Re: Calling a list of functions

2015-12-13 Thread BartC
On 13/12/2015 17:26, Ganesh Pal wrote: Iam on linux and python 2.7 . I have a bunch of functions which I have run sequentially . I have put them in a list and Iam calling the functions in the list as shown below , this works fine for me , please share your opinion/views on the same Sample c

Calling a list of functions

2015-12-13 Thread Ganesh Pal
Hi Team, Iam on linux and python 2.7 . I have a bunch of functions which I have run sequentially . I have put them in a list and Iam calling the functions in the list as shown below , this works fine for me , please share your opinion/views on the same Sample code : def print1(): print "

RE: Windows 10 and PYODBC

2015-12-13 Thread William Abdo
Problem Resolved. I have fixed the Oracle connection issue under Windows 10 with cx_Oracle . PYODBC was only failing on the Oracle connection and worked fine on MS SQL under Windows 10. Thank You for your time in this matter. Respectfully, William Abdo Software App Engineer II NTT America, an NT

Python IO Redirection to Console

2015-12-13 Thread austin aigbe
Hello, I am trying to redirect the IO (stdout, stdin and stderr) to the console. Is there a Python module for this? Thanks. Regards -- 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 Apach

Re: XMPP pub sub setup and working

2015-12-13 Thread dieter
sat...@driveu.in writes: > I am using xmpppy python library to connect with XMPP server(ejabberd2) but > unable to connect and actually don't have clarity on how to connect, > authenticate and send a message to the server. > If possible please provide some code snippet using XMPPPY. > > This i

Re: codecs.StreamRecoder not doing what I expected.

2015-12-13 Thread Peter Otten
D'Arcy J.M. Cain wrote: > On Sat, 12 Dec 2015 21:35:36 +0100 > Peter Otten <__pete...@web.de> wrote: >> def read_file(filename): >> for encoding in ["utf-8", "iso-8859-1"]: >> try: >> with open(filename, encoding=encoding) as f: >> return f.read() >>