testfixtures 5.0.0 released!

2017-06-05 Thread Chris Withers
Hi All, I'm pleased to announce the release of testfixtures 5.0.0 featuring the following: * Move fromnose topytest for running tests. * Switch frommanuel tosybil

Re: Is An Element of a Sequence an Object?

2017-06-05 Thread Jussi Piitulainen
Peter Otten writes: > Thomas Jollans wrote: > >> On 04/06/17 09:52, Rustom Mody wrote: >>> On Sunday, June 4, 2017 at 12:45:23 AM UTC+5:30, Jon Forrest wrote: I'm learning about Python. A book I'm reading about it says "... a string in Python is a sequence. A sequence is an ordered

Re: Is An Element of a Sequence an Object?

2017-06-05 Thread Peter Otten
Jussi Piitulainen wrote: > Peter Otten writes: >> However, this is an implementation detail: >> > def is_cached(c): >> ... return c[0] is c[0][0] >> ... > > I think this works the same, and looks more dramatic to me: > > ...return c[0] is c[0] Indeed. That's how I would have writte

How to change variable from list to float

2017-06-05 Thread Gary Barker
I have searched for a solution to this but have not found a suitable example. The attached code generates this error: Traceback (most recent call last): File "calcsignal.py", line 7, in siglevfromexist = 34.8 + existattn TypeError: unsupported operand type(s) for +: 'float' and 'list' Ho

openpyxl reads cell with format

2017-06-05 Thread Mahmood Naderan via Python-list
Hello guys... With openpyxl, it seems that when the content of a cell is something like "4-Feb", then it is read as "2016-02-04 00:00:00" that looks like a calendar conversion. How can I read the cell as text instead of such an automatic conversion? Regards, Mahmood -- https://mail.python.org/

Openpyxl cell format

2017-06-05 Thread Mahmood Naderan via Python-list
Hello guys, With openpyxl, it seems that when the content of a cell is something like "4-Feb", then it is read as "2016-02-04 00:00:00" that looks like a calendar conversion. How can I read the cell as text instead of such an automatic conversion? Regards, Mahmood -- https://mail.python.org/m

Re: Is An Element of a Sequence an Object?

2017-06-05 Thread Paul Barry
Hi folks. The book being referred to is mine, Head First Python 2d Edition as published by O'Reilly Media at the end of last year. Jon has copied me on the discussion to date, so I've been following along. Here's a small PDF of the single page from my book (page 24), so that you can all see my u

Backward compatible of Python 2 and Python 3

2017-06-05 Thread Pradeep Patra
Hi, I want to make a program which works in both python 2.7 and python 3. Is it possible? For example python 2.7 have raw_input() to accept the input from command line whereas python 3.x method is input(). So I want to make sure the same program works in both the python versions. https://stackov

Re: Is An Element of a Sequence an Object?

2017-06-05 Thread Thomas Jollans
On 05/06/17 09:38, Jussi Piitulainen wrote: > Peter Otten writes: > >> Thomas Jollans wrote: >>> Also: >>> >> s[0] is s[0][0][0][0][0][0][0] >>> True >> >> >> However, this is an implementation detail: >> > def is_cached(c): >> ... return c[0] is c[0][0] >> ... > > I think this wo

Re: Backward compatible of Python 2 and Python 3

2017-06-05 Thread Lele Gaifax
Pradeep Patra writes: > I want to make a program which works in both python 2.7 and python 3. Is it > possible? Definitely yes. > For example python 2.7 have raw_input() to accept the input from command > line whereas python 3.x method is input(). One popular way of doing that is by using http

Re: Openpyxl cell format

2017-06-05 Thread Lele Gaifax
Mahmood Naderan via Python-list writes: > With openpyxl, it seems that when the content of a cell is something like > "4-Feb", then it is read as "2016-02-04 00:00:00" that looks like a calendar > conversion. > > How can I read the cell as text instead of such an automatic conversion? I'm not 10

Re: Is An Element of a Sequence an Object?

2017-06-05 Thread Peter Otten
Thomas Jollans wrote: > What I thought was going on was that single-character strings return > self on [0], as they do on full-length slices. > c = 'δ' c[0] is c > False c[:] is c > True c[0:1] is c > True > > I wonder why they don't do this... Perhaps noone has found a

Re: How to change variable from list to float

2017-06-05 Thread Paul Barry
The value in existattn is a single element list. The single element is a float, so just refer to it in your calculation, like so: siglevfromexist = 34.8 + existattn[0] Regards. Paul. On 3 June 2017 at 15:42, Gary Barker wrote: > I have searched for a solution to this but have not found a

Re: Openpyxl cell format

2017-06-05 Thread Mahmood Naderan via Python-list
Maybe... But specifically in my case, the excel file is exported from a web page. I think there should be a way to read the content as a pure text. Regards, Mahmood -- https://mail.python.org/mailman/listinfo/python-list

Re: Openpyxl cell format

2017-06-05 Thread Lele Gaifax
Mahmood Naderan via Python-list writes: > Maybe... But specifically in my case, the excel file is exported from a web > page. I think there should be a way to read the content as a pure text. I think that openpyxl isn't doing any heuristic translation on cell's content, but I could be wrong: I b

Re: Openpyxl cell format

2017-06-05 Thread Jon Ribbens
On 2017-06-05, Mahmood Naderan wrote: > Maybe... But specifically in my case, the excel file is exported > from a web page. I think there should be a way to read the content > as a pure text. I have a vague memory that Excel stores dates as integers, so if you were to read the raw data you would

Re: openpyxl reads cell with format

2017-06-05 Thread Mahmood Naderan via Python-list
>if the cell is an Excel date, it IS stored as a numeric As I said, the "shape" of the cell is similar to date. The content which is "4-Feb" is not a date. It is a string which I expect from cell.value to read it as "4-Feb" and nothing else. Also, I said before that the file is downloaded from

Re: Transitioning from Linux to Windows

2017-06-05 Thread Irmen de Jong
On 3-6-2017 15:44, chitt...@uah.edu wrote: > Ideally, I would like to set up the user on their Windows 7/10 system so that > they can "login" to the ubuntu system (say putty) - change working directory > (to where desired) - run the script (on the ubuntu system) - and scp the file > back to the

Re: Bug or intended behavior?

2017-06-05 Thread Peter Pearson
On Fri, 2 Jun 2017 10:17:05 -0700 (PDT), sean.diza...@gmail.com wrote: [snip] print "foo %s" % 1-2 > Traceback (most recent call last): > File "", line 1, in > TypeError: unsupported operand type(s) for -: 'str' and 'int' Others have already pointed out that you're assuming the wrong prece

Re: Bug or intended behavior?

2017-06-05 Thread Chris Angelico
On Tue, Jun 6, 2017 at 3:01 AM, Peter Pearson wrote: > On Fri, 2 Jun 2017 10:17:05 -0700 (PDT), sean.diza...@gmail.com wrote: > [snip] > print "foo %s" % 1-2 >> Traceback (most recent call last): >> File "", line 1, in >> TypeError: unsupported operand type(s) for -: 'str' and 'int' > > Oth

Re: How to change variable from list to float

2017-06-05 Thread Peter Pearson
On Mon, 5 Jun 2017 11:13:54 +0100, Paul Barry wrote: > On 3 June 2017 at 15:42, Gary Barker wrote: > >> I have searched for a solution to this but have not found a suitable >> example. >> >> The attached code generates this error: Traceback (most recent call last): >> File "calcsignal.py", line

Re: Bug or intended behavior?

2017-06-05 Thread Marko Rauhamaa
Peter Pearson : > On Fri, 2 Jun 2017 10:17:05 -0700 (PDT), sean.diza...@gmail.com wrote: > [snip] > print "foo %s" % 1-2 >> Traceback (most recent call last): >> File "", line 1, in >> TypeError: unsupported operand type(s) for -: 'str' and 'int' > > Others have already pointed out that you

Re: openpyxl reads cell with format

2017-06-05 Thread Mahmood Naderan via Python-list
OK thank you very much. As you said, it seems that it is too late for my python script. Regards, Mahmood On Monday, June 5, 2017 10:41 PM, Dennis Lee Bieber wrote: On Mon, 5 Jun 2017 14:46:18 + (UTC), Mahmood Naderan via Python-list declaimed the following: >>if the cell is an Ex

Download

2017-06-05 Thread Maria Alonso-Martirena
Good morning, You asked me to subscribe before writing to you and i've already done so. I need your help: I’ve just downloaded Python for Windows (versión 3.6.1.). However, when I try to open it, it just says “modify”, “repair” or “uninstall”. How can I solve this problem? Why is it not working

Fwd: Welcome to the "Python-list" mailing list

2017-06-05 Thread Maria Alonso-Martirena
Good afternoon, I sent you an email this afternoon asking for help. As you can see in this email, I have been admited already. Could you help me with the matter I asked you please? Thanks. Kind regards, María Alonso-Martirena. -- Forwarded message -- From: Date: 2017-06-05 21:32

Re: Bug or intended behavior?

2017-06-05 Thread Chris Angelico
On Tue, Jun 6, 2017 at 5:26 AM, Marko Rauhamaa wrote: > Peter Pearson : > >> On Fri, 2 Jun 2017 10:17:05 -0700 (PDT), sean.diza...@gmail.com wrote: >> [snip] >> print "foo %s" % 1-2 >>> Traceback (most recent call last): >>> File "", line 1, in >>> TypeError: unsupported operand type(s) for

Re: Bug or intended behavior?

2017-06-05 Thread Michael Torrie
On 06/05/2017 01:26 PM, Marko Rauhamaa wrote: > Interestingly, however, Python hasn't extended that principle to the > expression syntax. You could have: > >>>> 1 + 2*3 >7 >>>> 1+2 * 3 >9 And thankfully they didn't. Because it wouldn't make sense to do so. Having whitespace inden

Re: Bug or intended behavior?

2017-06-05 Thread Marko Rauhamaa
Michael Torrie : > On 06/05/2017 01:26 PM, Marko Rauhamaa wrote: >> Interestingly, however, Python hasn't extended that principle to the >> expression syntax. You could have: >> >>>>> 1 + 2*3 >>7 >>>>> 1+2 * 3 >>9 > > And thankfully they didn't. Because it wouldn't make sense to d

Re: Download

2017-06-05 Thread Michael Torrie
On 06/05/2017 09:16 AM, Maria Alonso-Martirena wrote: > Good morning, > > You asked me to subscribe before writing to you and i've already done so. I > need your help: I’ve just downloaded Python for Windows (versión 3.6.1.). > However, when I try to open it, it just says “modify”, “repair” or > “

Re: Bug or intended behavior?

2017-06-05 Thread Michael Torrie
On 06/05/2017 02:05 PM, Marko Rauhamaa wrote: > Michael Torrie : >> On 06/05/2017 01:26 PM, Marko Rauhamaa wrote: >>> Interestingly, however, Python hasn't extended that principle to the >>> expression syntax. You could have: >>> >>>>>> 1 + 2*3 >>>7 >>>>>> 1+2 * 3 >>>9 >> >> And th

Re: Bug or intended behavior?

2017-06-05 Thread Skip Montanaro
On Mon, Jun 5, 2017 at 2:26 PM, Marko Rauhamaa wrote: > Interestingly, however, Python hasn't extended that principle to the > expression syntax. You could have: > >>>> 1 + 2*3 >7 >>>> 1+2 * 3 >9 In a later post, you referenced a Wikipedia page on order of operations

Re: openpyxl reads cell with format

2017-06-05 Thread Thomas Jollans
On 05/06/17 16:46, Mahmood Naderan wrote: >> if the cell is an Excel date, it IS stored as a numeric > > As I said, the "shape" of the cell is similar to date. The content which is > "4-Feb" is not a date. It is a string which I expect from cell.value to read > it as "4-Feb" and nothing else. >

converting Julian date to normal date

2017-06-05 Thread sum abiut
i am using python,and django as my web framework. I use sqlalchemy to connect to MSSQL data that is running Epicor database. Epicor is using julian * date. How to you convert julian date to normal date* *cheers,* -- https://mail.python.org/mailman/listinfo/python-list

Re: converting Julian date to normal date

2017-06-05 Thread Larry Martell
On Mon, Jun 5, 2017 at 6:11 PM, sum abiut wrote: > i am using python,and django as my web framework. I use sqlalchemy to > connect to MSSQL data that is running Epicor database. Epicor is using > julian > > * date. How to you convert julian date to normal date* You cross posted this to the djan

Re: Openpyxl cell format

2017-06-05 Thread Gregory Ewing
Mahmood Naderan wrote: Maybe... But specifically in my case, the excel file is exported from a web page. I think there should be a way to read the content as a pure text. What form are you getting the file in? Are you being given an Excel file, or are you loading a text file into Excel? The pr

Re: openpyxl reads cell with format

2017-06-05 Thread Gregory Ewing
Mahmood Naderan wrote: from a button on a web page, I chose "export as excel" to download the data. Do you get an option to export in any other format? CSV would be best, since you can trivially read that with Python's csv module. If Excel is the only format available, you should complain to t

Re: openpyxl reads cell with format

2017-06-05 Thread Christopher Reimer
On 6/5/2017 4:55 PM, Gregory Ewing wrote: Mahmood Naderan wrote: from a button on a web page, I chose "export as excel" to download the data. Do you get an option to export in any other format? CSV would be best, since you can trivially read that with Python's csv module. If Excel is the onl

Namedtuple problem #32.11.d

2017-06-05 Thread Deborah Swanson
I have a list of namedtuples: [{Record}(r0=v0, r1=v1,...,r10=v10,r11='',...r93='') . . . {Record}(r0=v0, r1=v1,...,r10=v10,r11='',...r93='')] In the first section of code, I process some of the first 10 columns (r0=v0, r1=v1,...,r10=v10), and place the results in

how to decrypt encrypted text to a clear text

2017-06-05 Thread Ho Yeung Lee
i use wb to write pubic and private key and succeed to import private, but after decrypt, it return hex number not a clear text is there any more key needed? or do wb influence the result? from Crypto.PublicKey import RSA keypair = RSA.generate(2048) alice_privkey = keypair.exportKey('PEM', '