Re: [newbie] tkFileDialog does not show title

2016-03-28 Thread Peter Pearson
On Mon, 28 Mar 2016 14:10:28 -0700 (PDT), jenswaelk...@gmail.com wrote: > I'm using the tkFileDialog-module in Python 2.7, it works fine except > for one thing: when I add a title, the title isn't shown. > > e.g. I have this line of code: > inputfilename=tkFileDialog.askopenfilename(defaultextensio

Re: i cant seem to figure out the error

2016-04-03 Thread Peter Pearson
On Sun, 3 Apr 2016 16:06:58 +0100, anthony uwaifo wrote: [snip] > > class BankAccount(object): > def __init__(self, balance): > self.balance = balance > > > def deposit(self, amount): > self.amount=amount > self.balance += amount > return self.balance > > > def withdraw(self,

Re: Unicode normalisation [was Re: [beginner] What's wrong?]

2016-04-07 Thread Peter Pearson
On Thu, 07 Apr 2016 11:37:50 +1000, Steven D'Aprano wrote: > On Thu, 7 Apr 2016 05:56 am, Thomas 'PointedEars' Lahn wrote: >> Rustom Mody wrote: > >>> So here are some examples to illustrate what I am saying: >>> >>> Example 1 -- Ligatures: >>> >>> Python3 gets it right >> flag = 1 >> flag

Re: Unicode normalisation [was Re: [beginner] What's wrong?]

2016-04-08 Thread Peter Pearson
On Fri, 08 Apr 2016 16:00:10 +1000, Steven D'Aprano wrote: > On Fri, 8 Apr 2016 02:51 am, Peter Pearson wrote: >> >> The Unicode consortium was certifiably insane when it went into the >> typesetting business. > > They are not, and never have been, in t

Re: Unicode normalisation [was Re: [beginner] What's wrong?]

2016-04-08 Thread Peter Pearson
On Sat, 9 Apr 2016 03:50:16 +1000, Chris Angelico wrote: > On Sat, Apr 9, 2016 at 3:44 AM, Marko Rauhamaa wrote: [snip] >> (As for ligatures, I understand that there might be quite a bit of >> legacy software that dedicated code points and code pages for ligatures. >> Translating that legacy soft

Re: pylint woes

2016-05-07 Thread Peter Pearson
On Sat, 7 May 2016 12:51:00 -0400, DFS wrote: > This more-anal-than-me program generated almost 2 warnings for every > line of code in my program. w t hey? Thank you for putting a sample of pylint output in front of my eyes; you inspired me to install pylint and try it out. If it teaches me ev

Re: Image loading problem

2016-05-21 Thread Peter Pearson
On Sat, 21 May 2016 08:22:41 -0700 (PDT), sweating_...@yahoo.com wrote: > > I am working on an image project, and I can display my image in > main(). I mean, I can load my image in my main(). Needless, it is > awkward. I am trying to load my image with a function, but got an > empty image window po

Re: [spam] Re: look what I've found [ignore]

2016-05-29 Thread Peter Pearson
On Sun, 29 May 2016 14:23:27 -0400, Random832 wrote: > On Sun, May 29, 2016, at 14:14, Terry Reedy wrote: >> Spam missed by the normally excellent spam filter. Ignore it. > > I didn't actually see the original message. Maybe it was sent directly > to you (and perhaps other users, but not me) with

Re: Self Learning Fortran Programming

2016-06-01 Thread Peter Pearson
On Tue, 31 May 2016 21:50:33 -0700 (PDT), Muhammad Ali wrote: > > I am interested in Python programming, [snip] Just out of curiosity, why do you seem to be confused about whether your interest is in FORTRAN or Python? -- To email me, substitute nowhere->runbox, invalid->com. -- https://mail.py

Re: I'm wrong or Will we fix the ducks limp?

2016-06-03 Thread Peter Pearson
On Fri, 3 Jun 2016 07:20:24 -0700 (PDT), Sayth Renshaw wrote: [snip] > pyqFiles = [] > for filename in sorted(file_list): > pyqFiles = pyqFiles.append(pq(filename=my_dir + filename)) > > return pyqFiles [snip] > PS I am really having a lot of fun coding. To have even more fun,

Re: Catch exception with message?

2016-06-04 Thread Peter Pearson
On Sat, 4 Jun 2016 04:44:30 +0530, Piyush Verma <114piy...@gmail.com> wrote: > Generally we catch exception using > except Exception as e: > > But sometimes, we see same type of exception is present with different > message.Is there a way to capture same exception with message > filtering? Please h

Re: Operator precedence problem

2016-06-06 Thread Peter Pearson
On Mon, 6 Jun 2016 02:24:37 +1000, Chris Angelico wrote: > On Sun, Jun 5, 2016 at 4:53 PM, ICT Ezy wrote: > 2 ** 3 ** 2 >> Answer is 512 >> Why not 64? >> Order is right-left or left-right? > > This example follows the mathematical standard; you start from the > "top" (the right hand side), a

Re: Trying to read in data for a file to a python application

2019-02-26 Thread Peter Pearson
On Tue, 26 Feb 2019 15:51:38 +, Paul Sutton wrote: > Hi > > I have been trying to write a small application that is essentially user > information application. > > https://raw.githubusercontent.com/zleap/AboutMe/master/Aboutme.py > > So far I have managed to write the data generated to a file,

Re: Read the table data from PDF files in Python

2019-04-24 Thread Peter Pearson
On Wed, 24 Apr 2019 02:36:27 -0700 (PDT), mrawat...@gmail.com wrote: > Hello, > Anyone knows how to fetch the data from PDF file having tables with > other text in Python. Need to fetch some cell values based on > condition from that table. You might find pdftotext useful. The command . . . pd

Re: Why am a getting wrong prediction when combining two list of samples, which individually gives correct prediction?

2019-06-12 Thread Peter Pearson
On Wed, 12 Jun 2019 04:12:34 -0700 (PDT), Rishika Sen wrote: > So I am coding in Python. I have to set of samples. Set1 contains > samples of class A and the other set, Set2 contains samples of class > B. When I am predicting set1 and set2 individually, the classification > is perfect. Now when I

Re: finding a component in a list of pairs

2019-06-23 Thread Peter Pearson
On 22 Jun 2019 13:24:38 GMT, Stefan Ram wrote: [snip] > > print( next( ( pair for pair in pairs if pair[ 0 ]== 'sun' ), > ( 0, '(unbekannt)' ))[ 1 ]) > print( next( itertools.dropwhile( lambda pair: pair[ 0 ]!= 'sun', pairs )) > [ 1 ]) [snip] > > The last two lines of

Re: finding a component in a list of pairs

2019-06-24 Thread Peter Pearson
[snip] > print( dict( pairs ).get( 'sun', '(unknown)' )) You probably know this, but . . . just in case . . . If you're doing this many times, you'll want to construct the dict just once and then make many references to the dict, rather than re-constructing the dict every time you want to look up

Re: Seeking help regarding Python code

2019-07-11 Thread Peter Pearson
On Thu, 11 Jul 2019 06:54:21 +0100, Debasree Banerjee wrote: > > I have a dataset like this: > > RecTime > > NO2_RAW > > NO2 > > LAQN_NO2 > > 10980 > > 06/6/19 01:45 > > 17.9544 [snip] > > Can someone please help? Your question might appear intelligibly on the mailing list (I can't tell), but

Re: How to sort the files based on the date?

2019-07-15 Thread Peter Pearson
On Mon, 15 Jul 2019 09:20:51 +0200, Peter Otten <__pete...@web.de> wrote: > Madhavan Bomidi wrote: > [snip] >> >> 3RIMG_01APR2018_0514_L2G_AOD.h5 >> 3RIMG_01APR2018_0544_L2G_AOD.h5 >> 3RIMG_01APR2018_0644_L2G_AOD.h5 >> 3RIMG_01APR2018_0714_L2G_AOD.h5 >> 3RIMG_01APR2018_0744_L2G_AOD.h5 [snip] >> >

Re: Creating time stamps

2019-07-23 Thread Peter Pearson
On Mon, 22 Jul 2019 16:25:32 -0500, Michael F. Stemper wrote: > On 22/07/2019 15.58, Chris Angelico wrote: >> On Tue, Jul 23, 2019 at 6:34 AM Michael F. Stemper >> wrote: >>> [snip] >>> from datetime import datetime >>> from time import strftime >>> timestamp = datetime.now().strftime( "%Y-%

Re: Xlabel and ylabel are not shown

2019-08-18 Thread Peter Pearson
On Sat, 17 Aug 2019 10:58:43 -0700 (PDT), Amirreza Heidari wrote: > plt.figure(1) > plt.plot(history.history["loss"], "b", label="Mean Square Error of training") > plt.plot(history.history["val_loss"], "g", label="Mean Square Error [snip] > plt.legend() > plt.xlabel("Epoche") > plt.ylabel("Mean Squ

Re: Angular distribution rose diagram in Python

2019-09-27 Thread Peter Pearson
On Fri, 27 Sep 2019 02:13:31 -0700 (PDT), Madhavan Bomidi wrote: > > Can someone help me to make python code (with some arbitrary data) for > the angular distribution rose diagram as shown in figure 7 in the > paper accessible through the web-link: > > https://www.nat-hazards-earth-syst-sci.net/17/

Re: Hello, I need help.

2019-10-15 Thread Peter Pearson
On Tue, 15 Oct 2019 18:57:04 +0300, Damla Pehlivan wrote: [snip] > . . . I downloaded the python program, and I > also downloaded Pycharm to use it. To be fair, I do not know what I am > doing, but I made some progress last night and I was happy about it. Today > when I came back from university

Re: graphics with python

2019-10-24 Thread Peter Pearson
On Thu, 24 Oct 2019 16:06:21 +0800, Maggie Q Roth wrote: [snip] > Can you show me the correct way to programming with graphics? > > I want to take some action detection, for instance, recognize dancing etc. That description of your goals is very vague. The more specific you can be about what you

Re: Randomizing Strings In A Microservices World

2019-12-10 Thread Peter Pearson
On Mon, 9 Dec 2019 21:38:43 -0600, Tim Daneliuk wrote: > On 12/9/19 8:54 PM, Dennis Lee Bieber wrote: >> On Mon, 9 Dec 2019 18:52:11 -0600, Tim Daneliuk >> declaimed the following: >> >>> - Each of these services needs to produce a string of ten digits >>> guaranteed to be unique on a per servic

Re: Complaints on installing packages

2020-01-13 Thread Peter Pearson
On Sun, 12 Jan 2020 15:21:52 +0100, ofomi matthew wrote: > Good day Python Team, > I'm Matt by name and I have been having difficulties in installing packages > on my pycharm.it keeps telling me "error installing package". Please how do > I rectify this issues step by step. > Looking forward to get

Re: Help

2020-01-13 Thread Peter Pearson
On Sun, 12 Jan 2020 22:23:58 +0530, kiran chawan wrote: > Whenever Iam trying to run this 'New latest version python software 3.8.4 > python ' but it doesn't show any install option tell me how to run this > software and install new latest version of python plz reply sir thank you To get a usef

Re: fugacity cofficient

2020-02-17 Thread Peter Pearson
On Sun, 16 Feb 2020 14:17:28 -0800 (PST), alberto wrote: > Hi, > how I could realize a script to calculate fugacity coefficients > with this formula > [snip] > > regards > > Alberto Welcome, Alberto. Can you make this look more like a Python question and less like a do-my-homework question? Sho

Re: fugacity cofficient

2020-02-17 Thread Peter Pearson
On 17 Feb 2020 18:40:00 GMT, Peter Pearson wrote: > > Welcome, Alberto. > > Can you make this look more like a Python question and less like a > do-my-homework question? Show us what you've tried. Sorry. I see you already did exactly that. -- To email me, substitute nowh

Re: Help building python application from source

2020-02-29 Thread Peter Pearson
On Fri, 28 Feb 2020 18:49:58 -0800, Mr. Lee Chiffre wrote: [snip] > I am a python noob. This is why I ask the python masters. There is a > python software I want to install on the server it is called Electrumx. > https://github.com/kyuupichan/electrumx is the link. I am having troubles > with insta

Re: news.bbs.nz is spewing duplicates to comp.lang.python

2020-04-22 Thread Peter Pearson
On Tue, 21 Apr 2020 21:42:42 + (UTC), Eli the Bearded wrote: > This just arrived at my newserver: > > Path: > reader2.panix.com!panix!goblin2!goblin.stu.neva.ru!news.unit0.net!2.eu.feeder.erje.net!4.us.feeder.erje.net!feeder.erje.net!xmission!csiph.com!news.bbs.nz!.POSTED.agency.bbs.nz!not

Re: ValueError: arrays must all be same length

2020-10-03 Thread Peter Pearson
On Fri, 2 Oct 2020 13:34:46 +0100, Shaozhong SHI wrote: > Hello, > > I got a json response from an API and tried to use pandas to put data into > a dataframe. > > However, I kept getting this ValueError: arrays must all be same length. > > Can anyone help? > > The following is the json text. Rega

Re: Truncation error

2020-10-07 Thread Peter Pearson
On Wed, 7 Oct 2020 13:29:26 +0530, Meghna Karkera wrote: > On Wed, Oct 7, 2020, 11:24 Marco Sulla wrote: >> On Wed, 7 Oct 2020 at 05:23, Meghna Karkera wrote: >> > >> > How is PYTHON better than other software's(MATLAB) in case of >> > truncation or rounding off error. > >> [snip] > > When I use

Python's carbon guilt

2020-10-10 Thread Peter Pearson
Python advocates might want to organize their thoughts on this subject before their bosses spring the suggestion: >From >https://www.sciencemag.org/news/2020/10/we-re-part-problem-astronomers-confront-their-role-and-vulnerability-climate-change > : . . . Astronomers should also abandon popul

Re: Problem saving datetime to file and reading it back for a calculation

2020-10-10 Thread Peter Pearson
On Sat, 10 Oct 2020 18:17:26 -0400, Steve wrote: > I would like to use the line: > HoursDiff = int((d2-d1).total_seconds()/3600) > to determine the difference in hours between two timedate entries. > > The variable d2 is from datetime.now() > and d1 is read from a text file. > > I can save d2 to t

Re: Best way to determine user's screensize?

2020-11-03 Thread Peter Pearson
On Sun, 1 Nov 2020 15:31:57 - (UTC), Grant Edwards wrote: > > I have no objection to saving the most recent window size and using > that on the next startup, but I hate applications that force the > _location_ of the window. I've configured my window manager to open > windows where I want them

Re: Is there a conflict of libraries here?

2020-11-06 Thread Peter Pearson
On Fri, 6 Nov 2020 02:25:25 -0500, Steve wrote: > In my program, I have the following lines of code: > import random > import re > import time > import datetime At this point, the name "datetime" points to a module. > from datetime import timedelta > from time import gmt

Re: returning totals in functions of math

2020-11-08 Thread Peter Pearson
On Sun, 8 Nov 2020 13:50:19 -0500, Quentin Bock wrote: > Errors say that add takes 1 positional argument but 3 were given? Does this > limit how many numbers I can have or do I need other variables? > Here is what I have: > def add(numbers): >total = 1 >for x in numbers: > total

Re: EnvironmentError

2020-11-20 Thread Peter Pearson
On Thu, 19 Nov 2020 13:19:07 +0100, Usman Musa wrote: > When I try to install a package or upgrade pip, using pip install I got > this error massage. > WARNING: Retrying (Retry(total=4, connect=None, read=None, > redirect=None, status=None)) after connection broken by > 'SSLError(SSLCertVeri

Re: 2 sample chi-square test

2020-12-29 Thread Peter Pearson
On Tue, 29 Dec 2020 02:52:15 -0800 (PST), Priya Singh wrote: [snip] > I have two spectra with wavelength, flux, and error on flux. I want to > find out the variability of these two spectra based on the 2 sample > Chi-square test. I am using following code: > > def compute_chi2_var(file1,file2,zemi

Re: How to copy the entire outlook message content in python

2020-12-29 Thread Peter Pearson
On Tue, 29 Dec 2020 05:38:53 -0800 (PST), nikhil k wrote: ...[snip]... > import win32com.client as win32 > > ### Functions > def getMailBody(msgFile): > start_text = "" > end_text = "" > with open(msgFile) as f: > data=f.read() > return data[data.find(start_text):d

Re: Most discussion on comp.lang.python is about developing with Python

2013-11-14 Thread Peter Pearson
On Wed, 13 Nov 2013 15:35:56 -0500, bob gailer wrote: > I joined a week or so ago. > > The subject line was copied from the description of comp.lang.python aka > python-list@python.org. > > I am very disappointed to see so much energy and bandwidth going to > conversations that bash individuals.

Re: Wrapping around a list

2013-11-27 Thread Peter Pearson
On Wed, 27 Nov 2013 08:33:43 -0500, Neil Cerutti wrote: > On Wed, Nov 27, 2013 at 5:46 AM, wrote: >> I am working on a problem (Bioinformatics domain) where all >> possible combinations of input string needs to be printed as >> sublist >> >> For example: >> Input string : "LEQN" >> Output= "[L",

Re: Time zones and why they change so damned often (was: the Gravity of Python 2)

2014-01-10 Thread Peter Pearson
On Thu, 9 Jan 2014 15:14:55 +1100, Chris Angelico wrote: [snip] > What I find, most of the time, is that it's Americans who can't handle > DST. I run an international Dungeons and Dragons campaign (we play > online, and new players are most welcome, as are people watching!), > and the Aussies (myse

Re: Trying to understand this moji-bake

2014-01-25 Thread Peter Pearson
On Sat, 25 Jan 2014 17:08:56 +1100, Chris Angelico wrote: > On Sat, Jan 25, 2014 at 3:37 PM, Steven D'Aprano > wrote: >> But using Python 2.7, I get a really bad case of moji-bake: >> >> [steve@ando ~]$ python2.7 -c "print u'ñøλπйж'" >> ñøλÏйж > > What's 2.7's default source code encoding? I

Re: Question about split method

2015-12-05 Thread Peter Pearson
On Wed, 2 Dec 2015 14:44:30 -0600, Ian Kelly wrote: > On Wed, Dec 2, 2015 at 2:37 PM, Robert wrote: [snip] >> ss0="1, 2, 4, 8, 16".split(", ") [snip] > Try help(str.split) Or if, like me, you can't remember the magic word "str", ask: help("".split) and you know you're asking about the right "s

Re: filter a list of strings

2015-12-05 Thread Peter Pearson
On Thu, 3 Dec 2015 10:27:19 +0100, wrote: [snip] > I often saw constructions like this > x for x in y if ... > But I don't understand that combination of the Python keywords (for, > in, if) I allready know. It is to complex to imagine what there really > happen. Don't give up! List comprehensi

Re: geostationary satellite data

2015-12-16 Thread Peter Pearson
On Wed, 16 Dec 2015 13:19:26 -0200, jorge.conr...@cptec.inpe.br wrote: > > I dowmloaded some data from the Mirador NASA site: > > http://mirador.gsfc.nasa.gov/cgi-bin/mirador/presentNavigation.pl?tree=project&dataset=Global-merged%20IR%20Brightness%20Temperature%20Data&project=TRMM&dataGroup=Ancill

Re: geostationary satellite data

2015-12-16 Thread Peter Pearson
On Thu, 17 Dec 2015 04:08:02 +1100, Chris Angelico wrote: > On Thu, Dec 17, 2015 at 4:04 AM, Peter Pearson > wrote: >> The file is 65274016 bytes long. You claim the dimensions are >> 9896 x 3298, but that comes out to half that number (32637008), so I'll >> bet t

Re: geostationary satellite data

2015-12-16 Thread Peter Pearson
On Thu, 17 Dec 2015 04:37:26 +1100, Chris Angelico wrote: > On Thu, Dec 17, 2015 at 4:30 AM, Peter Pearson > wrote: >> Agreed. It's annoying when an agency goes to the trouble of making >> huge datasets available online, but fails to identify the format. >>

Re: What could cause a plot fail in my code?

2015-12-21 Thread Peter Pearson
On Mon, 21 Dec 2015 09:29:24 -0800 (PST), Robert wrote: > On Monday, December 21, 2015 at 12:15:54 PM UTC-5, Robert wrote: >> Hi, >> >> I find a useful code snippet on link: >> >> http://stackoverflow.com/questions/25126444/logistic-regression-in-pymc/34400966#34400966 >> >> but it has error on

Re: yaxis

2015-12-29 Thread Peter Pearson
On Tue, 29 Dec 2015 06:25:49 -0800 (PST), damien.ishac...@gmail.com wrote: > hello I would only change the scale of the y-axis, how to deal with > matplotlib.pyplot or another library ? Here's a function I use. ax is an "axes" object, which you can get by calling the get-current-axes (gca()) met

Re: Complain

2015-12-31 Thread Peter Pearson
On Thu, 31 Dec 2015 08:24:15 -0800, ebuka ogbonnaya wrote: > my name is Ebuka Egbunine, from Nigeria.I studied Geology and > mining.Actually i downloaded python3.5(32-bit) successfully on my laptop > which operates on 32-bit memory, but the application is not opening, it > displays the message " t

Re: Sending an email with a binary attachment

2016-02-29 Thread Peter Pearson
On Mon, 29 Feb 2016 02:10:00 -0600, Anthony Papillion wrote: [snip] > > http://pastebin.com/sryj98wW To improve odds of your getting a response, let's get the code into this thread. Here it is, minus the #! preamble: from email.mime.text import MIMEText from email.mime.application import MIMEApp

Re: What arguments are passed to the __new__ method ?

2016-03-02 Thread Peter Pearson
On Tue, 1 Mar 2016 18:24:12 +0100, ast wrote: > > It's not clear to me what arguments are passed to the > __new__ method. Here is a piece of code: > > > class Premiere: > > def __new__(cls, price): > return object.__new__(cls) > > def __init__(self, price): > pass [snip

Re: Missing something about timezones

2016-03-15 Thread Peter Pearson
On Mon, 14 Mar 2016 10:19:23 -0500, Skip Montanaro wrote: > Is this correct (today, with Daylight Savings in effect)? > import pytz i.timezone > 'America/Chicago' pytz.timezone(i.timezone) > ot > datetime.datetime(2016, 3, 14, 9, 30, tzinfo= 'America/New_York' EDT-1 day, 20:00:0

Re: need help With understanding

2016-03-21 Thread Peter Pearson
On Mon, 21 Mar 2016 11:18:57 +, mohamed mohamud wrote: > hey im new at Learning Python, and i have an issue which i would like > som help With. > > i have currently installed Python, and im Reading this book which > tells me i have to have IDLE, but i cant find it on my computer. do i > need to

Re: Help with python script for NMR

2016-03-27 Thread Peter Pearson
On Sun, 27 Mar 2016 08:13:49 -0700 (PDT), mohamadma...@gmail.com wrote: > On Sunday, March 27, 2016 at 4:50:01 PM UTC+2, Joel Goldstick wrote: >> On Sun, Mar 27, 2016 at 10:38 AM, wrote: >> >> > Hello there, >> > I found a python script in a scientific article that enables a simple >> > calculati

Re: Matplotlib: getting a figure to show without plt.show()

2014-10-22 Thread Peter Pearson
On Wed, 22 Oct 2014 12:38:02 +0200, Peter Otten wrote: > Peter Pearson wrote: [snip] >> def callback(event): >> global n, first >> fig = plt.figure(2) >> fig.clear() >> plt.plot([0,1],[0,n]) >> n += 1 # (Pretending something changes from

Re: Strange result with timeit execution time measurment

2014-11-15 Thread Peter Pearson
On Sat, 15 Nov 2014 18:07:30 +0100, ast wrote: > > I needed a function f(x) which looks like sinus(2pi.x) but faster. > I wrote this one: > > -- > from math import floor > > def sinusLite(x): > x = x - floor(x) > return -16*(x-0.25)**2 + 1 if x < 0.5 else 16*(x-0.75)

Re: Python handles globals badly.

2014-12-03 Thread Peter Pearson
On Wed, 3 Dec 2014 03:27:45 +0100, Skybuck Flying wrote: > > I don't need snot telling me how to program after 20 years of programming > experience. [snip] After 20 years of programming, I had a lot to learn about programming. That was 29 years ago, and I *still* have a lot to learn about program

Re: encrypt the http request url on the local machine

2014-12-09 Thread Peter Pearson
On Mon, 8 Dec 2014 22:58:20 -0800 (PST), iMath wrote: > my software on the local machine needs to send http request to a > specific web server , is there any way to protect the http request url > from being found by Packet analyzer software like Wireshark and > fiddler. The sever is not mine, so I

[OT] x**y == y**x

2015-01-09 Thread Peter Pearson
On 09 Jan 2015 11:07:51 +0200, Jussi Piitulainen wrote: [snip] > Which reminds me of a question that once made me smile, even laugh, > and still does: 2**3 is almost 3**2 but not quite - what gives? If you've never looked at the set of reals (x,y) satisfying x**y == y**x, it's worth a visit. --

Re: [OT] x**y == y**x

2015-01-10 Thread Peter Pearson
On Fri, 09 Jan 2015 23:41:15 +0200, Marko Rauhamaa wrote: > Peter Pearson : > >> If you've never looked at the set of reals (x,y) satisfying x**y == >> y**x, it's worth a visit. > > Thanks, it was. The graph's something like this: [snip] > > Where

Re: Wildly OT: pop-up virtual keyboard for Mac or Linux?

2015-02-10 Thread Peter Pearson
On Tue, 10 Feb 2015 15:05:47 -0600, Skip Montanaro wrote: [snip] > One of the things I really like about my Skype keyboard (and likely > other "soft" keyboards on Android) is that when you hold down a "key" > for a brief moment, a little mini keyboard pops up, from which you can > easily choose var

Re: Algorithm for Creating Supersets of Smaller Sets Based on Common Elements

2015-02-22 Thread Peter Pearson
On Sat, 21 Feb 2015 14:46:26 -0500, TommyVee wrote: > Start off with sets of elements as follows: > > 1. A,B,E,F > 2. G,H,L,P,Q > 3. C,D,E,F > 4. E,X,Z > 5. L,M,R > 6. O,M,Y > > Note that sets 1, 3 and 4 all have the element 'E' in common, therefore they > are "related" and form the following supe

Re: regex line by line over file

2014-03-27 Thread Peter Pearson
On Thu, 27 Mar 2014 06:41:55 -0700 (PDT), James Smith wrote: > On Thursday, March 27, 2014 1:32:03 AM UTC-4, Steven D'Aprano wrote: > >> - are you mistaken about the content of the file? >> >> I can't help you with the first. But the second: try running this: >> >> # line2 and pat as defined abov

Re: Fortran (Was: The "does Python have variables?" debate)

2014-05-29 Thread Peter Pearson
On 29 May 2014 14:06:47 GMT, Albert van der Horst wrote: > In article , > Mark H Harris wrote: >>On 5/11/14 1:59 PM, Chris Angelico wrote: > julia> prec=524288 > 524288 > julia> with_bigfloat_precision(prec) do > println(atan(BigFloat(1)/5)*16 - atan(BigFloat(1)/239)

[OT] Re: Hyper-spacial ray-tracer

2013-10-05 Thread Peter Pearson
On Fri, 04 Oct 2013 20:17:52 -0400, Rouslan Korneychuk wrote: [snip] > I was also wondering about general relativity. I'm not going to go into > too much detail, but basically: if an object with synchronized clocks on > either end of it, passes by a static observer while traveling near the > sp

Re: Strange extra f added to bytes object

2013-10-06 Thread Peter Pearson
On Sun, 6 Oct 2013 18:47:38 -0400, Robert Jackson wrote: > --089e0160b7be912b9e04e81a52b2 > Content-Type: text/plain; charset=ISO-8859-1 > > I am very new to python [snip] Welcome. > . . . I sometimes find the > when I construct the bytes object to write it adds an extra f to the first > byte.

Re: Auto-authorization for Google Drive using Python in Mac OS X

2013-11-06 Thread Peter Pearson
On Mon, 4 Nov 2013 11:46:54 -0800 (PST), Pratik Mehta wrote: > I have written Python code for Google Drive which uploads the image > files to my drive app. I have three queries. Here is my code: [snip] > > My Queries: > 1. This program will upload all the images to my given client_id and > client_

Re: Gaussian process regression

2015-02-27 Thread Peter Pearson
On Thu, 26 Feb 2015 09:59:45 -0800 (PST), jaykim.hui...@gmail.com wrote: > > I am trying to use Gaussian process regression for Near Infrared > spectra. I have reference data(spectra), concentrations of reference > data and sample data, and I am trying to predict concentrations of > sample data. He

Re: Huh? No way to markup announcements here?

2015-04-18 Thread Peter Pearson
On Sat, 18 Apr 2015 11:36:34 +0100, Tim Golden wrote: > On 18/04/2015 11:24, edream...@gmail.com wrote: [snip] >> Is there any way to format announcements? If so, how. If not, why not? [snip] > Both of those services -- Usenet & Mailing list -- are traditionally > plain text. One could certainl

Re: Extract email address from Java script in html source using python

2015-05-23 Thread Peter Pearson
On Sat, 23 May 2015 12:16:06 +0530, savitha devi wrote: > > I am developing a web scraper code using HTMLParser. I need to extract > text/email address from java script with in the HTMLCode. Would be be correct in suspecting that you are assembling a list of email addresses for use in spamming?

Re: Guidance for academic project

2015-06-12 Thread Peter Pearson
On Fri, 12 Jun 2015 10:24:05 +0530, Alby Issac wrote: > > Am new to this group. [snip] Welcome. > . . . I just want to know that is it possible to implement a filter > for view updates in the database tables using python. and that filter > will help to reject false updates in the source databas

Matplotlib X-axis timezone trouble

2015-06-29 Thread Peter Pearson
The following code produces a plot with a line running from (9:30, 0) to (10:30, 1), not from (8:30, 0) to (9:30, 1) as I desire. If I use timezone None instead of pacific, the plot is as desired, but of course that doesn't solve the general problem of which this is a much-reduced example. If I u

Re: Matplotlib X-axis timezone trouble

2015-06-29 Thread Peter Pearson
On Tue, 30 Jun 2015 12:11:31 +1000, Chris Angelico wrote: > On Tue, Jun 30, 2015 at 10:56 AM, Peter Pearson > wrote: >> The following code produces a plot with a line running from (9:30, 0) to >> (10:30, 1), not from (8:30, 0) to (9:30, 1) as I desire. >> >> pacif

Re: Matplotlib X-axis timezone trouble

2015-06-29 Thread Peter Pearson
On Tue, 30 Jun 2015 04:03:57 +0200, Laura Creighton wrote: > In a message of 30 Jun 2015 00:56:26 +0000, Peter Pearson writes: >>The following code produces a plot with a line running from (9:30, 0) to >>(10:30, 1), not from (8:30, 0) to (9:30, 1) as I desire. >> >>If

Re: Matplotlib X-axis timezone trouble

2015-06-30 Thread Peter Pearson
On Tue, 30 Jun 2015 17:01:15 +1000, Chris Angelico wrote: > On Tue, Jun 30, 2015 at 2:49 PM, Peter Pearson > wrote: >> Time zones teem with sneaky software problems, and so does daylight-saving >> time, so this problem might strain my brain. Maybe it's going to turn >

Re: Matplotlib X-axis timezone trouble

2015-06-30 Thread Peter Pearson
On 30 Jun 2015 00:56:26 GMT, Peter Pearson wrote: > The following code produces a plot with a line running from (9:30, 0) to > (10:30, 1), not from (8:30, 0) to (9:30, 1) as I desire. > > If I use timezone None instead of pacific, the plot is as desired, but > of course that do

Datetime timezone trouble (was: Matplotlib X-axis timezone trouble)

2015-07-01 Thread Peter Pearson
On Wed, 1 Jul 2015 17:15:38 +1000, Chris Angelico wrote: > > Interestingly, when I tried this (pytz version 2015.4, Python 2.7.9, > Debian Jessie), I saw utcoffset() showing (-1, 58020) for both. That > seems... odd. And I can't fault your dates - those definitely ought to > be easily inside and e

Re: Datetime timezone trouble (was: Matplotlib X-axis timezone trouble)

2015-07-01 Thread Peter Pearson
On Wed, 1 Jul 2015 10:55:02 -0600, Ian Kelly wrote: > On Wed, Jul 1, 2015 at 10:36 AM, Peter Pearson [wrote]: [snip] >> Here's a very simple demonstration that either something is wrong >> or I don't understand how datetime and tzinfo are supposed to work: >> >&

Re: Matplotlib X-axis timezone trouble [SOLVED]

2015-07-04 Thread Peter Pearson
On Sat, 04 Jul 2015 07:29:45 +0300, Akira Li <4kir4...@gmail.com> wrote: > Peter Pearson writes: > >> The following code produces a plot with a line running from (9:30, 0) to >> (10:30, 1), not from (8:30, 0) to (9:30, 1) as I desire. >> >> If I use timezone

Re: Matplotlib X-axis timezone trouble

2015-07-10 Thread Peter Pearson
On Thu, 09 Jul 2015 19:50:33 GMT, Tony the Tiger wrote: > On Tue, 30 Jun 2015 00:56:26 +0000, Peter Pearson wrote: > >> If I use timezone US/Central, I get the same (bad) plot. > > Perhaps this can help?: > http://stackoverflow.com/questions/1301493/setting-timezone-in-pytho

Re: How to use regex (re)

2015-08-07 Thread Peter Pearson
On Thu, 6 Aug 2015 13:06:36 -0700 (PDT), PK Khatri wrote: > I have a following script which extracts xyz.tgz and outputs to a > folder which contains several sub-folders and files. > > source_dir = "c:\\TEST" > dest_dir = "c:\\TEST" > for src_name in glob.glob(os.path.join(source_dir,

Re: Python handles globals badly.

2015-09-10 Thread Peter Pearson
On Wed, 9 Sep 2015 20:20:42 +0100, Mark Lawrence wrote: > On 09/09/2015 18:59, William Ray Wing wrote: >>> On Sep 9, 2015, at 1:22 PM, Steven D'Aprano wrote: [snip] >> Right. Note that the Arabs, who DID invent zero, still count from one. [snip] > Would you please provide a citation to support yo

Re: Cryptographically strong random numbers

2015-10-16 Thread Peter Pearson
On Sat, 17 Oct 2015 03:25:03 +1100, Steven D'Aprano wrote: [snip] > randbelow(end): > return a random integer in the half-open interval 0...end > (including 0, excluding end) > > randint(start, end): > return a random integer in the closed interval start...end > (including both sta

Re: Calulation in lim (1 + 1 /n) ^n when n -> infinite

2015-11-09 Thread Peter Pearson
On Mon, 9 Nov 2015 04:21:14 -0800 (PST), Salvatore DI DIO wrote: > > I was trying to show that this limit was 'e' > But when I try large numbers I get errors > > def lim(p): > return math.pow(1 + 1.0 / p , p) > lim(5) > 2.718281748862504 lim(9) > 2.7182820518605446 !!

Re: Not Responding When Dealing with Large Data

2014-06-19 Thread Peter Pearson
On Thu, 19 Jun 2014 12:25:23 +0100, MRAB wrote: [snip] > and then you can say: > > def myCase(c): > if len(c) < 8 or len(c) > 80: > return False > > if c in mySet: > return False > > return True > > which can be shortened to: > > def m

Re: Question about Pass-by-object-reference?

2014-07-22 Thread Peter Pearson
On Tue, 22 Jul 2014 12:34:51 -0700 (PDT), fl wrote: [snip] > > But I don't understand the reassign function result: > def reassign(list): > ... list=[0,1] > ... list=[0] reassign(list) print list > [0] When you say "def reassign(list)", that means "I'm defining a function t

Re: dict to boolean expression, how to?

2014-08-01 Thread Peter Pearson
On 01 Aug 2014 14:26:38 GMT, Alex van der Spek wrote: [snip] > This newsgroup scares me, it appears to be for professional computer > scientists only, the theoretical part is sometimes too much for this > practical physicist with an old background in FORTRAN. > > Is there a better place to ask q

Re: Suitable Python code to scrape specific details from web pages.

2014-08-12 Thread Peter Pearson
On Tue, 12 Aug 2014 15:44:58 -0700 (PDT), Simon Evans wrote: [snip] > Dear Programmers, Thank you for your responses. I have installed > 'Beautiful Soup' and I have the 'Getting Started in Beautiful Soup' > book, but can't seem to make any progress with it, I am too thick to > make much use of it.

Re: Log base 2 of large integers

2014-08-13 Thread Peter Pearson
On Wed, 13 Aug 2014 15:58:02 +0200, Peter Otten <__pete...@web.de> wrote: > Mok-Kong Shen wrote: > >> I like to compute log base 2 of a fairly large integer n but >> with math.log(n,2) I got: >> >> OverflowError: long int too large to convert to float. [snip] > Or maybe our idea of "fairly large

Re: Captcha identify

2014-08-14 Thread Peter Pearson
On Wed, 13 Aug 2014 14:16:02 -0600, Ian Kelly wrote: > > . . . and as computers get more powerful the intersection > of {problems machines can't solve} and {problems humans can reliably > solve} grows ever smaller. "Which of the following eight sentences are sarcastic in tone?" -- To email me,

Re: Collaps arrays/ list of intergers

2014-08-19 Thread Peter Pearson
On Tue, 19 Aug 2014 05:54:24 -0700 (PDT), Jurgens de Bruin wrote: > > I do hope somebody can help me with the following: > I have the followings lists which represent the upper and lower value > of a range/array. > > a = [1,50] > b = [75,150] > c = [25,42] > d = [120,149] > e = [35,55] > > What I w

Re: Global indent [levity]

2014-08-23 Thread Peter Pearson
On Sat, 23 Aug 2014 19:08:10 +1000, Steven D'Aprano wrote: > Marko Rauhamaa wrote: >> Rob Gaddi : >> >>> Emacs and vim both have huge learning curves >> >> Really now? >> >> When you start emacs, it advises you to start the builtin tutorial. > > You need a tutorial for a text editor??? Did you

Re: Prime testing [was Re: My backwards logic]

2014-09-07 Thread Peter Pearson
On Sat, 6 Sep 2014 12:53:16 +0200, Manolo Martínez wrote: > On 09/06/14 at 08:38pm, Steven D'Aprano wrote: >> But even that's not how the specialists do it. If you want to check whether >> (say) 2**3000+1 is prime, you don't want to use trial division at all... > > When I was interested in these th

Re: Python Basics

2014-10-04 Thread Peter Pearson
On Sat, 04 Oct 2014 11:09:58 +1000, Steven D'Aprano wrote: > Chris Angelico wrote: > >> On Sat, Oct 4, 2014 at 8:54 AM, Seymore4Head >> wrote: > >>> for i in range(1,10): >>> print (str(i)*i) >> >> Seymour, please don't do this. When you "help" someone by just giving >> him the answer to a ho

Re: Representing mathematical equations

2014-10-06 Thread Peter Pearson
On Mon, 06 Oct 2014 08:42:01 -0600, Michael Torrie wrote: > On 10/06/2014 07:07 AM, varun...@gmail.com wrote: >>> Okay, I forgot to explain them. L is a set of links, dist is a >>> number (distance), bd is the bandwidth and hc is a number as well >>> (hopcount)...different bandwidths, hopcounts an

Re: python on Linux

2014-10-10 Thread Peter Pearson
On Fri, 10 Oct 2014 08:31:04 +0200, Irmen de Jong wrote: > On 10-10-2014 6:21, Igor Korot wrote: >> When I am on Windows, I can write something like this: >> >> sys.path.append('C:\Users\Igor\Documents\MyLib') > > While this might work on your system, it may not work on others. > > - you need to

<    1   2   3   4   >