Re: Fwd: Re: Error 0*80070570

2016-04-21 Thread Stephen Hansen
On Thu, Apr 21, 2016, at 10:46 AM, Allan Leo wrote: > I need help with this setup error. > -- Forwarded message -- > From: "Allan Leo" > Date: Apr 21, 2016 10:06 AM > Subject: Re: Error 0*80070570 > To: > Cc: > > When running the setup for your 3.5.1(32-bit version), the setup >

Re: How much sanity checking is required for function inputs?

2016-04-21 Thread Stephen Hansen
at all. What's the contents of this big dictionary that has everything in it for some reason? That said, dear god, 'piece' doesn't look like an english word to me anymore. I've never suffered semantic satiation from text before. --Stephen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: How much sanity checking is required for function inputs?

2016-04-21 Thread Stephen Hansen
On Thu, Apr 21, 2016, at 08:33 PM, Christopher Reimer wrote: > On 4/21/2016 7:20 PM, Stephen Hansen wrote: > > I... that... what... I'd forget that link and pretend you never went > > there. Its not helpful. > > I found it on the Internet, so it must be true -- and Pytho

Re: Python(x,y) 64 bit

2016-04-27 Thread Stephen Hansen
ads which is the Anaconda scientific distribution, which I know does offer 64-bit Python support. --- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: Python path and append

2016-04-27 Thread Stephen Hansen
e tracebacks. Having a nice description of what you expect to happen is often nice too, especially if its doing something "wrong" and not giving an obvious traceback. Seeing specifically what the wrong behavior is, and you explaining why you think its wrong, can be invaluable. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Madlibs.py code and error message

2016-04-27 Thread Stephen Hansen
) Python is case-sensitive. "Adjective1" and "adjective1" are separate things. In your code you're reading into "adjective1". -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Madlibs.py code and error message

2016-04-27 Thread Stephen Hansen
rmatting. I leave it to you to count and find what's missing or extra, because I'm seriously not going to do that :) -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Madlibs.py code and error message

2016-04-27 Thread Stephen Hansen
On Wed, Apr 27, 2016, at 10:32 PM, Ben Finney wrote: > Stephen Hansen writes: > > > The error message means there's a mismatch between the number of > > formatting instructions (ie, %s) and arguments passed to formatting. I > > leave it to you to count and find wha

Re: Python Madlibs.py code and error message

2016-04-28 Thread Stephen Hansen
On Wed, Apr 27, 2016, at 11:55 PM, Ben Finney wrote: > Stephen Hansen writes: > > > On Wed, Apr 27, 2016, at 10:32 PM, Ben Finney wrote: > > > Better: when you have many semantically-different values, use named > > > (not positional) parameters in the format stri

Re: Not x.islower() has different output than x.isupper() in list output...

2016-04-29 Thread Stephen Hansen
t x.isupper()" you'd get the whitespace in it too (along with all the lower case characters). If isupper/islower were perfect opposites of each-other, there'd be no need for both. But since characters can be upper, lower, or *neither*, you run into this situation. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: Not x.islower() has different output than x.isupper() in list output...

2016-04-29 Thread Stephen Hansen
On Fri, Apr 29, 2016, at 06:55 PM, Christopher Reimer wrote: > On 4/29/2016 6:29 PM, Stephen Hansen wrote: > > If isupper/islower were perfect opposites of each-other, there'd be no > > need for both. But since characters can be upper, lower, or *neither*, > > y

Re: Not x.islower() has different output than x.isupper() in list output...

2016-04-30 Thread Stephen Hansen
On Sat, Apr 30, 2016, at 09:48 AM, Christopher Reimer wrote: > On 4/29/2016 11:43 PM, Stephen Hansen wrote: > > The official documentation is accurate. > > That may be true on a technical level. But the identically worded text > in the documentation implies otherwise. That

Re: You gotta love a 2-line python solution

2016-05-01 Thread Stephen Hansen
-- Note, for paths on windows you really want to use a rawstring. Ie, r"D:\file.html". -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: Fastest way to retrieve and write html contents to file

2016-05-01 Thread Stephen Hansen
s not fast enough for you? That's less then a second. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: You gotta love a 2-line python solution

2016-05-01 Thread Stephen Hansen
On Sun, May 1, 2016, at 09:51 PM, DFS wrote: > On 5/2/2016 12:31 AM, Stephen Hansen wrote: > > On Sun, May 1, 2016, at 08:39 PM, DFS wrote: > >> To save a webpage to a file: > >> - > >> 1. import url

Re: Fastest way to retrieve and write html contents to file

2016-05-01 Thread Stephen Hansen
On Sun, May 1, 2016, at 09:50 PM, DFS wrote: > On 5/2/2016 12:40 AM, Chris Angelico wrote: > > On Mon, May 2, 2016 at 2:34 PM, Stephen Hansen wrote: > >> On Sun, May 1, 2016, at 09:06 PM, DFS wrote: > >>> Then I tested them in loops - the VBScript is MUCH faster: 0.

Re: Fastest way to retrieve and write html contents to file

2016-05-01 Thread Stephen Hansen
rt urllib2; r = urllib2.urlopen(webpage); f = open(filename, 'w'); f.write(r.read()); f.close();" 10 loops, best of 3: 175 msec per loop That's a whole lot less the 0.88secs. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: Fastest way to retrieve and write html contents to file

2016-05-01 Thread Stephen Hansen
. You haven't shown that. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: You gotta love a 2-line python solution

2016-05-01 Thread Stephen Hansen
On Sun, May 1, 2016, at 10:08 PM, DFS wrote: > On 5/2/2016 1:02 AM, Stephen Hansen wrote: > >> I actually use "D:\\file.html" in my code. > > > > Or you can do that. But the whole point of raw strings is not having to > > escape slashes :) > > >

Re: Code Opinion - Enumerate

2016-05-01 Thread Stephen Hansen
27;s too much noise to it, but in general: Using enumerate increases readability, and I use it whenever the idiom: for index, item in enumerate(thing): ... is used. Enumerate is your friend. Hug it. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: You gotta love a 2-line python solution

2016-05-01 Thread Stephen Hansen
ib.urlretrieve(webpage,webfile) WORKS > > webfile = "rD:\econpy001.html" The r is *outside* the string. Its: r"D:\econpy001.html" -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: Fastest way to retrieve and write html contents to file

2016-05-01 Thread Stephen Hansen
ame constant factor, at which point the difference is irrelevant. If you believe otherwise, demonstrate it. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: Fastest way to retrieve and write html contents to file

2016-05-02 Thread Stephen Hansen
On Mon, May 2, 2016, at 12:37 AM, DFS wrote: > On 5/2/2016 2:27 AM, Stephen Hansen wrote: > > I'm again going back to the point of: its fast enough. When comparing > > two small numbers, "twice as slow" is meaningless. > > Speed is always meaningful. >

Re: Best way to clean up list items?

2016-05-02 Thread Stephen Hansen
2'] That said: list1 = [t.strip() for t in list1 if t and not t.isspace()] -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: Python3 html scraper that supports javascript

2016-05-02 Thread Stephen Hansen
rodu_dokumentarni_film/playlist.m3u8?foo=bar";> > > > but I can't come to that point. Why? As important as it is to show code, you need to show what actually happens and what error message is produced. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: Best way to clean up list items?

2016-05-02 Thread Stephen Hansen
On Mon, May 2, 2016, at 11:09 AM, DFS wrote: > I'd prefer to get clean data in the first place, but I don't know a > better way to extract it from the HTML. Ah, right. I didn't know you were scraping HTML. Scraping HTML is rarely clean so you have to do a lot of cleanup. -

Re: You gotta love a 2-line python solution

2016-05-02 Thread Stephen Hansen
On Mon, May 2, 2016, at 08:27 PM, [email protected] wrote: > But when I try to get this forum page, it does get a html file but can't > be viewed normally. What does that mean? -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: Saving Consol outputs in a python script

2016-05-03 Thread Stephen Hansen
() Output will be a string, string has a splitlines method, etc. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: You gotta love a 2-line python solution

2016-05-03 Thread Stephen Hansen
On Mon, May 2, 2016, at 08:57 PM, [email protected] wrote: > Stephen Hansen at 2016/5/3 11:49:22AM wrote: > > On Mon, May 2, 2016, at 08:27 PM, [email protected] wrote: > > > But when I try to get this forum page, it does get a html file but can't > > > be vie

Re: Conditionals And Control Flows

2016-05-04 Thread Stephen Hansen
, "x and y" is false. If x is true, though, it'll return y. In this case, "x and y" will be a true thing if y is a true thing, and a false thing if y is a false thing. As you can see, all of this logic happens without ever using True or False. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: No SQLite newsgroup, so I'll ask here about SQLite, python and MS Access

2016-05-04 Thread Stephen Hansen
hp?group=gmane.comp.db.sqlite.general > Any ideas? Sorry, I don't use Access. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: Whittle it on down

2016-05-04 Thread Stephen Hansen
URTS PRIVATE', 'www.lafitness.com', 'GYMNASIUMS', 'HEALTH & >>> FITNESS CLUBS', 'www.lafitness.com', 'HEALTH & FITNESS CLUBS', >>> 'www.lafitness.com', 'PERSONAL FITNESS TRAINERS', 'HEALTH CLUBS & >>> GYMNASIUMS', 'EXERCISE & PHYSICAL FITNESS PROGRAMS', 'FITNESS CENTERS', >>> 'HEALTH CLUBS & GYMNASIUMS', 'HEALTH CLUBS & GYMNASIUMS', 'PERSONAL FITNESS >>> TRAINERS', '5', '4', '3', '2', '1', 'Yellow Pages', 'About Us', 'Contact >>> Us', 'Support', 'Terms of Use', 'Privacy Policy', 'Advertise With Us', >>> 'Add/Update Listing', 'Business Profile Login', 'F.A.Q.'] Then: >>> pattern = re.compile(r"^[A-Z\s&]+$") >>> output = [x for x in list if pattern.match(x)] >>> output ['PHYSICAL FITNESS CONSULTANTS & TRAINERS', 'HEALTH CLUBS & GYMNASIUMS', 'HEALTH CLUBS & GYMNASIUMS', 'RACQUETBALL COURTS PRIVATE', 'GYMNASIUMS', 'HEALTH & FITNESS CLUBS', 'HEALTH & FITNESS CLUBS', 'PERSONAL FITNESS TRAINERS', 'HEALTH CLUBS & GYMNASIUMS', 'EXERCISE & PHYSICAL FITNESS PROGRAMS', 'FITNESS CENTERS', 'HEALTH CLUBS & GYMNASIUMS', 'HEALTH CLUBS & GYMNASIUMS', 'PERSONAL FITNESS TRAINERS'] -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: Whittle it on down

2016-05-04 Thread Stephen Hansen
#x27;m all for the idea that one shouldn't go to regex when Python's powerful string type can answer the problem more clearly, but this seems to go out of its way to do otherwise. I don't even care about faster: Its overly complicated. Sometimes a regular expression really is the clearest

Re: Whittle it on down

2016-05-05 Thread Stephen Hansen
On Thu, May 5, 2016, at 12:04 AM, Steven D'Aprano wrote: > On Thursday 05 May 2016 16:46, Stephen Hansen wrote: > > > On Wed, May 4, 2016, at 11:04 PM, Steven D'Aprano wrote: > >> Start by writing a function or a regex that will distinguish strings that > >&g

Re: Whittle it on down

2016-05-05 Thread Stephen Hansen
On Thu, May 5, 2016, at 12:36 AM, Steven D'Aprano wrote: > Oh, a further thought... > > On Thursday 05 May 2016 16:46, Stephen Hansen wrote: > > I don't even care about faster: Its overly complicated. Sometimes a > > regular expression really is the clearest way t

Re: Whittle it on down

2016-05-05 Thread Stephen Hansen
On Thu, May 5, 2016, at 10:43 AM, Steven D'Aprano wrote: > On Thu, 5 May 2016 11:32 pm, Stephen Hansen wrote: > > > On Thu, May 5, 2016, at 12:36 AM, Steven D'Aprano wrote: > >> Oh, a further thought... > >> > >> On Thursday 05 May 2016 16:46, Ste

Re: Whittle it on down

2016-05-05 Thread Stephen Hansen
On Thu, May 5, 2016, at 05:31 AM, DFS wrote: > You are out of your mind. Whoa, now. I might disagree with Steven D'Aprano about how to approach this problem, but there's no need to be rude. Everyone's trying to help you, after all. -- Stephen Hansen m e @ i x o k a

Re: Whittle it on down

2016-05-05 Thread Stephen Hansen
input. Um, no one said that. I was arguing that the *regular expression* doesn't need to be responsible for validation. > - Even if you do somehow end up with junk, there couldn't possibly be any > real consequences to that. No one said that either... > - It doesn't matte

Re: Pylint prefers list comprehension over filter...

2016-05-05 Thread Stephen Hansen
list comprehension *build a list* which is not needed, and wasteful. The above skips building a list, instead returning a generator, and join pulls items out of it one at a time as it uses them. No needlessly creating a list only to use it and discard it. -- Stephen Hansen m e @ i x o k a i . i o

Re: Pylint prefers list comprehension over filter...

2016-05-05 Thread Stephen Hansen
On Thu, May 5, 2016, at 07:46 PM, Dan Sommers wrote: > On Thu, 05 May 2016 18:37:11 -0700, Stephen Hansen wrote: > > > ''.join(x for x in string if x.isupper()) > > > The difference is, both filter and your list comprehension *build a > > list* which i

Re: A fun python CLI program for all to enjoy!

2016-05-06 Thread Stephen Hansen
ep track of the references in your head to make sure things will get closed at proper times. The 'with' statement clearly defines when resources should be closed, so its preferred (As I see you've adopted from other responses). But its also needed in other Python implementations whic

Re: Why do these statements evaluate the way they do?

2016-05-07 Thread Stephen Hansen
the only things you should use 'is' for is when comparing to singletons like None, True or False (And consider strongly not comparing against False/True with is, but instead just 'if thing' and if its True, it passes). Otherwise, 'is' should only be used when you&#

Re: Python is an Equal Opportunity Programming Language

2016-05-07 Thread Stephen Hansen
them in a disenfranchised position. Recognizing those faults and taking corrective action is fundamentally an act in the name of equality. Correcting for inequalities can not, itself, be a purely "equal" task done in pure blindness of the contextual reality of what is going on in the world. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: pylint woes

2016-05-07 Thread Stephen Hansen
"Consider using enumerate instead of iterating with range > and len" > > the offending code is: > for j in range(len(list1)): >do something with list1[j], list2[j], list3[j], etc. > > enumeration would be: > for j,item in enumerate(list1): >do something with

Re: pylint woes

2016-05-07 Thread Stephen Hansen
on on what is "good" or "bad" programming habits. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: Pylint prefers list comprehension over filter...

2016-05-07 Thread Stephen Hansen
On Sat, May 7, 2016, at 12:17 PM, Christopher Reimer wrote: > On 5/5/2016 6:37 PM, Stephen Hansen wrote: > > On Thu, May 5, 2016, at 06:26 PM, Christopher Reimer wrote: > >> Which is one is correct (Pythonic)? Or does it matter? > > First, pylint is somewhat opinionated,

Re: pylint woes

2016-05-07 Thread Stephen Hansen
ist1)) and list1[j] are all indirection, when item1 is clearly (if given a better name then 'item1') something distinct you're working on. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: pylint woes

2016-05-07 Thread Stephen Hansen
> Aside: I haven't tried, but is 'names' a bad idea or illegal for the > name of a python list or variable? Nothing wrong with names. Or 'name', for that matter. Try to avoid abbreviations. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: pylint woes

2016-05-07 Thread Stephen Hansen
examples to comment > > > if ("Please choose a state" in str(matches)): > if (var == "val" or var2 == "val2"): Gah, don't do that. You're adding meaningless noise. Especially in the first case. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: pylint woes

2016-05-08 Thread Stephen Hansen
s): may be sorta vaguely long, but its not that long. Just do it and move on. Get over whatever makes you not like it. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: pylint woes

2016-05-08 Thread Stephen Hansen
an error happens. You rollback. Or correct the data. Since the data didn't go in, there should (in theory) be nothing TO commit if an error happens. Or, there should be partial data in that needs a rollback before you decide to do something else. -- Stephen Hansen m e @ i x o k a i . i o -- h

Re: pylint woes

2016-05-08 Thread Stephen Hansen
its speaking *only* about *whitespace*. ALL its saying is, "don't put spaces before commas, colons or semicolons". You can infer nothing else about it. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: pylint woes

2016-05-08 Thread Stephen Hansen
On Sun, May 8, 2016, at 02:46 PM, DFS wrote: > On 5/8/2016 5:38 PM, Stephen Hansen wrote: > > On Sun, May 8, 2016, at 02:16 PM, DFS wrote: > >> I was surprised to see the PEP8 guide approve of: > >> > >> "Yes: if x == 4: print x, y; x, y = y, x" >

Re: What should a decorator do if an attribute already exists?

2016-05-10 Thread Stephen Hansen
. Your decorator should, IMHO, treat the attribute as private data, and if something else is using the same thing, something has clearly gone wrong and raising the error early and clearly is right. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?

2016-05-10 Thread Stephen Hansen
implementation, it is guaranteed that: >>> a = "a" "a" >>> b = "aa" Are the same. Two+ string literals are implicitly combined into one at compile time. > 'master craftswoman' my ass... Yes, you're being that. Please stop. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: for / while else doesn't make sense

2016-05-19 Thread Stephen Hansen
it. They aren't. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: Self Learning Fortran Programming

2016-06-01 Thread Stephen Tucker
book. Stephen Tucker. <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virus-free. www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=w

Re: Difference between array( [1,0,1] ) and array( [ [1,0,1] ] )

2019-06-21 Thread Stephen Tucker
consisting (at the top level) of a one-element list, with that element (at this top level) being a three-element list, with these three elements (at the lower level) being 1, 0 and 1. Stephen. On Fri, Jun 21, 2019 at 7:29 AM Markos wrote: > > Hi, > > I'm studying Numpy and I don

Syntax Suggestion: Pass Function Definition as Argument

2019-11-07 Thread Stephen Waldron
Hi, I'm new to the group and to Python, so forgive me if I make any faux-pas here. As I can tell, the only way to pass a function as an argument is to reference its name as follows: def foo1(message): print(message) def foo2(foo, message): print("Your function says:") foo(message)

Re: Syntax Suggestion: Pass Function Definition as Argument

2019-11-07 Thread Stephen Waldron
Thanks Antoon. I do suppose that it is kind of wrong to say the only way is to "reference its [the function's] name" as an argument, however the point I was trying to make was that you cannot pass a function that is either not in some way previously defined or a reference to something previously

Re: Syntax Suggestion: Pass Function Definition as Argument

2019-11-07 Thread Stephen Waldron
Thanks Antoon. I do suppose that it is kind of wrong to say the only way is to "reference its [the function's] name" as an argument, however the point I was trying to make was that it isn't possible to pass a function that is either not in some way previously defined or a reference to something

Re: Syntax Suggestion: Pass Function Definition as Argument

2019-11-08 Thread Stephen Waldron
Ok firstly, this idea was inspired specifically by a project I'm working on for school concerning linked lists, in which I was trying to create a method that performed a function on elements iteratively without having to navigate the list from the head each time (of course taking the function as

The file method read does not "see" CR

2019-12-10 Thread Stephen Tucker
bytes. Given that the documentation for the read method claims that exactly size bytes are read by each call to the method (in this case, size is 1) does this behaviour constitute a bug? Stephen Tucker. -- https://mail.python.org/mailman/listinfo/python-list

Re: The file method read does not "see" CR

2019-12-10 Thread Stephen Tucker
d that this question 1 is virtually the same as my original question.) Stephen. On Tue, Dec 10, 2019 at 10:39 AM Chris Angelico wrote: > On Tue, Dec 10, 2019 at 9:17 PM Stephen Tucker > wrote: > > > > I am running Python 2.7.10 on a Windows 10 machine. I have writt

Clarification on Immutability please

2020-01-21 Thread Stephen Tucker
eems, tuples can be reduced in length (from the far end) (which is not what I was expecting), but they cannot be extended (which I can understand). I am probably confused, ignorant, stupid, or any combination of the above. Can you please help me become less so? Many thanks. Stephen Tucker. -- https://mail.python.org/mailman/listinfo/python-list

Re: Clarification on Immutability please

2020-01-21 Thread Stephen Tucker
. So, yes, I am stupid - or just having senior moments (I am 65, after all). Stephen. On Wed, Jan 22, 2020 at 4:30 AM Michael Torrie wrote: > On 1/21/20 6:52 PM, Ethan Furman wrote: > > On 01/21/2020 10:55 AM, Michael Torrie wrote: > > > >> Slicing > >> returns

Multiple comparisons in a single statement

2020-03-12 Thread Stephen Tucker
Thanks in anticipation. Stephen Tucker. <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virus-free. www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm

Re: Multiple comparisons in a single statement

2020-03-13 Thread Stephen Tucker
*Chris:* Thank you for your confirmation. *All: *For the record, I meant that the tuples are all the same. The tuples I have in mind contain strings, so the issue regarding the "equality" (or otherwise) of 0 and 0.0 does not arise in my case. Stephen. To answer the question O

Re: Multiple comparisons in a single statement

2020-03-16 Thread Stephen Tucker
OK. You are right. I was misleading. I am sorry for wasting your time. Thanks you for helping me to express myself. Stephen. <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virus-free. www.avast.com <http

Exceptions versus Windows ERRORLEVEL

2020-04-03 Thread Stephen Tucker
? Stephen. -- https://mail.python.org/mailman/listinfo/python-list

Re: Exceptions versus Windows ERRORLEVEL

2020-04-06 Thread Stephen Tucker
Thanks, Eryk - this is very helpful. Stephen. On Mon, Apr 6, 2020 at 6:43 AM Eryk Sun wrote: > On 4/3/20, Stephen Tucker wrote: > > > > Does an exception raised by a Python 3.x program on a Windows machine set > > ERRORLEVEL? > > ERRORLEVEL is an internal sta

Re: How to test?

2020-06-20 Thread Stephen Rosen
Worth noting: by assertTrue he probably meant assertEqual. But I'd recommend using assertIn [1] if you're using unittest to check output written to stdout/stderr. That way, your tests are slightly more robust to changes in the exact output. pytest may also be helpful for this (or any!) type of te

How to handle async and inheritance?

2020-06-30 Thread Stephen Rosen
would love to hear about it. And if someone wants to go above-and-beyond and look at webargs, and suggest a better way for us to support aiohttp, I'd obviously welcome that kind of help as well! Thanks in advance, and best regards, -Stephen [1] https://github.com/marshmallow-code/web

PEP 622

2020-07-02 Thread Stephen Carboni
Why are OR patterns going to use the bitwise operator instead of logical or operator? https://www.python.org/dev/peps/pep-0622/#combining-multiple-patterns-or-patterns -Steve -- https://mail.python.org/mailman/listinfo/python-list

Re: Bulletproof json.dump?

2020-07-07 Thread Stephen Rosen
it be fair, if your object is "case insensitive" to serialize it as { "CONTENT-TYPE": ... } or { "content-type": ... } or ... ? `r.headers["content-type"]` presumably gets a hit. `json.loads(json.dumps(dict(r.headers)))["content-type"]` will get a KeyError. This seems very much out of scope for the json package because it's not clear what it's supposed to do with this type. Libraries should ask users to specify what they mean and not make potentially harmful assumptions. Best, -Stephen -- https://mail.python.org/mailman/listinfo/python-list

Re: Simple question - end a raw string with a single backslash ?

2020-10-19 Thread Stephen Tucker
For a neatish way to get a string to end with a single backslash, how about mystr = r"abc\ "[:-1] (Note the space at the end of the rough-quoted string.) Virus-free. www.avast.com

Re: Parsing an HTML a tag

2005-09-24 Thread Stephen Prinster
George wrote: > How can I parse an HTML file and collect only that the A tags. I have a > start for the code but an unable to figure out how to finish the code. > HTML_parse gets the data from the URL document. Thanks for the help Have you tried using Beautiful Soup? http://www.crummy.com/softwar

Re: Memory stats

2005-09-27 Thread Stephen Kellett
Validator may fit the bill. No data on the website, just go straight to the beta page and select the product. Windows NT/W2K/XP/etc.. http://www.softwareverify.com http://www.softwareverify.com/beta.php?product=PMVB000 Stephen -- Stephen Kellett Object Media Limitedhttp://www

Re: Python profiler

2005-09-30 Thread Stephen Kellett
>how >many times it has to access the symbol table to >retrieve a specific item, and things like that. Python Coverage Validator will help you there. Python Performance Validator will help you there. http://www.softwareverify.com Windows NT/2000/XP/and above(vista, etc) Steph

Re: Need advice on finding memory leak

2005-10-16 Thread Stephen Kellett
In message <[EMAIL PROTECTED]>, [EMAIL PROTECTED] writes >I am having trouble identifying the source of a memory leak in a >Windows Python program. The basic gist is as follows: Perhaps Python Memory Validator can help you? http://www.softwareverify.com/beta.php Stephen

Re: tool for syntax coloring in html

2005-10-26 Thread Stephen Hildrey
:runtime syntax/2html.vim Regards, Steve -- Stephen Hildrey E-mail: [EMAIL PROTECTED] / Tel: +442071931337 Jabber: [EMAIL PROTECTED] / MSN: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Not Equal to Each Other?

2005-11-03 Thread Stephen Thorne
[1:8] I hope i have given you enough tools to do what you're trying to do. -- Stephen Thorne Development Engineer -- http://mail.python.org/mailman/listinfo/python-list

Re: python gc performance in large apps

2005-11-05 Thread Stephen Kellett
ed 2.0 and altering >some code I don't know if you have a Windows version of this software but if you do you may find Python Memory Validator useful. http://www.softwareverify.com/pythonMemoryValidator/index.html Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.

Re: AJAX => APAX? Or: is there support for python in browsers?

2005-11-15 Thread Stephen Prinster
Roger Erens wrote: > > I'm asking because of all the AJAX hype going on. I'd like rather not > delve too deep into JavaScript and use Python instead. > > Any insights to be shared? > > Cheers, > Roger In addition to the others already mentioned, you might want to check out Nevow. Quoting from

Re: Sending an event from a python COM server to a VB COM client

2005-11-15 Thread Stephen Prinster
Gary Kshepitzki wrote: > Hello > I am trying to send an event from a Python COM server to a VB (or VB.NET) > COM client. > I am a newbie both in VB and in python. > Can anyone give me a simple (but complete) code example both of the Python > server side and the VB client side for raising a single

Re: Python obfuscation

2005-11-17 Thread Stephen Kellett
people. They do exist, but they are rare. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list

Re: Web-based client code execution

2005-11-18 Thread Stephen Kellett
I'm pretty sure I'm correct in remembering there is a PythonScript. Anyway you are limited to ActiveState and Windows Scripting Host. For pragmatic reasons I think you would be better concentrating on JavaScript for the Client and your language of choice Python/Ruby/Lua/whate

Re: UUID?

2005-11-28 Thread Stephen Prinster
Huang Zhen wrote: > Hello, > How can I get a UUID with python? > Thanks! I've never used this, but I just saw it on Planet Python this morning: http://www.livejournal.com/users/zestyping/157957.html HTH, Steve P. -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposal: Inline Import

2005-12-09 Thread Stephen Prinster
Shane Hathaway wrote: > Do you have any ideas on how to improve the process of maintaining > imports? Benji's suggestion of jumping around doesn't work for moving > code and it interrupts my train of thought. Sprinkling the code with > import statements causes a speed penalty and a lot of clutter

Re: Frameworks for "Non-Content Oriented Web Apps"

2005-01-01 Thread Stephen Thorne
ct which represents data. It knows how to handle form submissions, validate data, etc. And you 'publish' that object. The user can then interact with that object. Anyway, I haven't mucked around with nevow for months, you're better off checking out nevow.com and divmod.org yours

Re: Developing Commercial Applications in Python

2005-01-03 Thread Stephen Waterbury
It's me wrote: Shaw-PTI (www.pti-us.com) uses Python in their software. ... but the "Python Powered" logo is conspicuous by its absence from their site. Too bad that some commercial exploiters of Python don't advertise that fact more often. Every little bit helps! Steve -- http://mail.python.org/m

Re: The Industry choice

2005-01-03 Thread Stephen Waterbury
Steve Holden wrote: Aahz wrote: In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: Aahz wrote: In article <[EMAIL PROTECTED]>, Paul Rubin wrote: I was pretty skeptical of Java's checked exceptions when I first used them but have been coming around a

Re: Decorators and static typing.

2005-01-05 Thread Stephen Thorne
t. Something standard is desired. Why don't we make it a language feature so that we don't have to waste even more lines of code and brain-cycles with obscure things like: def f(n): assert type(n) in (int, float) or subscribesToDuckType("number") using handwrit

Re: Developing Commercial Applications in Python

2005-01-06 Thread Stephen Waterbury
Nick Vargish wrote: [EMAIL PROTECTED] writes: Can somebody there to point me any good commercial applications developed using python ? Python is used in several games ... Also see Python Success Stories: http://pythonology.org/success A notable example is Verity's search engine -- see http://pyth

Re: Pre/Postconditions with decorators

2005-01-06 Thread Stephen Thorne
)) (this is, of course, using the framehack lambda replacement presented in a thread about a week ago). Stephen. Stephen. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Operating System???

2005-01-07 Thread Stephen Kellett
In message <[EMAIL PROTECTED]>, Christopher Koppler <[EMAIL PROTECTED]> writes Still, Java feels like C++ done right, while being more wrong >:-[ Couldn't disagree more. Just about anything you want to do that is low-level, is impossible in Java. Anyway this is off-topic.

Re: Python Operating System???

2005-01-07 Thread Stephen Kellett
In message <[EMAIL PROTECTED]>, Arich Chanachai <[EMAIL PROTECTED]> writes think). Or what about D? Digital Mars have a D compiler. http://www.digitalmars.com Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:

Re: Software archeology (was Re: Developing Commercial Applications in Python)

2005-01-07 Thread Stephen Waterbury
Aahz wrote: In article <[EMAIL PROTECTED]>, Stephen Waterbury <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] writes: Can somebody there to point me any good commercial applications developed using python ? Also see Python Success Stories: http://pythonology.org/success A notabl

Re: Software archeology (was Re: Developing Commercial Applications in Python)

2005-01-07 Thread Stephen Waterbury
Aahz wrote: In article <[EMAIL PROTECTED]>, Stephen Waterbury <[EMAIL PROTECTED]> wrote: Aahz wrote: In article <[EMAIL PROTECTED]>, Stephen Waterbury <[EMAIL PROTECTED]> wrote: Also see Python Success Stories: http://pythonology.org/success A notable example is Verit

Re: Pre/Postconditions with decorators

2005-01-08 Thread Stephen Thorne
adlines(), .seek() and .read() method? 2) How do you turn off the type checking for production code? Otherwise I quite like it. Please publish it somewhere. Stephen. -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   9   10   >