ANN: EmPy 4.2 -- a powerful, robust and mature templating system for Python

2024-08-25 Thread Erik Max Francis via Python-list
. See [Full list of changes between EmPy 3._x_ and 4.0](http://www.alcyone.com/software/empy/ANNOUNCE.html#all-changes) for a more comprehensive list. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W &am

ANN: EmPy 4.0.1

2024-01-01 Thread Erik Max Francis via Python-list
nges between EmPy 3._x_ and 4.0](http://www.alcyone.com/software/empy/ANNOUNCE.html#full-list-of-changes-between-empy-3-x-and-4-0) for a more comprehensive list. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57

Re: Use Chrome's / Firefox's dev-tools in python

2021-05-24 Thread max pothier
Found this: https://pastebin.com/fvLkSJRp with use-select tags. I'll try to use selenium and select the page. But using the JSON packet that's sent will still be more practical. -- https://mail.python.org/mailman/listinfo/python-list

Re: Use Chrome's / Firefox's dev-tools in python

2021-05-24 Thread max pothier
Ok, So here's a screenshot: https://ibb.co/2dtGr3c 1 is the website's scrollbar and 2 is Firefox's scrollbar. Seems like it uses a strange embed thing. The packet follows: https://pastebin.com/2qEkhZMN @Martin Di Paola: I sent you the pastebin password per email so that you're the only one who can

Re: Use Chrome's / Firefox's dev-tools in python

2021-05-23 Thread max pothier
Already tried this, only works for messages and not for homework etc. -- https://mail.python.org/mailman/listinfo/python-list

Re: Use Chrome's / Firefox's dev-tools in python

2021-05-23 Thread max pothier
@Curt: That is notifications for the ENT app, I want the notifications for the app named ProNote. ENT is for e-mails and Pronote for homework, quotes, etc. -- https://mail.python.org/mailman/listinfo/python-list

Re: Use Chrome's / Firefox's dev-tools in python

2021-05-23 Thread max pothier
Hi, Seems like that could be a method of doing things. Just one clarification: the website has unselectable text, looks like it's an image strangely generated, so if I can get the packet with it, it would be perfect. As I said (I think), logging in with Selenium was already possible, and I could

Re: Use Chrome's / Firefox's dev-tools in python

2021-05-21 Thread max pothier
Hello, Thanks for you answer! Actually my goal is not to automatically get the file once I open the page, but more to periodically check the site and get a notification when there's new homework or, at the morning, know when an hour is cancelled, so I don't want to have to open the browser every

Use Chrome's / Firefox's dev-tools in python

2021-05-20 Thread max pothier
My school has a website for homework called pronote (no problem if you don't know it). After logging in on parisclassenumerique.fr (works with selenium but I cant get requests to work), I want to read one of the packets that is sent: All the info about my day, my homework, etc. are in there a

Re: OT: Using a fake Gmail address is probably not a good idea

2019-09-16 Thread Max Zettlmeißl via Python-list
On Mon, Sep 16, 2019 at 1:56 PM Skip Montanaro wrote: > Mails for someone here who goes by the handle "ast" with a fake > address of n...@gmail.com keep landing in my Gmail spam folder. I > suspect the same is true for all people subscribed to python-list who > use Gmail. Gmail (correctly, I think

Re: open, close

2019-09-01 Thread Max Zettlmeißl via Python-list
On Sat, Aug 31, 2019 at 3:43 PM Piet van Oostrum wrote: > > There is a difference here with the construct that the OP mentioned: > > lines = open("foo.txt").readlines() > > In that case the file COULD be closed, but there is no guarantee. It depends > on garbage collection. > In your case t

Re: open, close

2019-08-31 Thread Max Zettlmeißl via Python-list
On Sat, Aug 31, 2019 at 2:22 PM Manfred Lotz wrote: > > Could I use the latter as a substitute for the with-construct? > You can't use the second statement as a proper substitute for the first one. With the context manager, it is ensured that the file is closed. It's more or less equal to a "fin

Socket.py SSM support

2019-06-01 Thread Max Franke
Hi, as of right now there appears to be a lack of setsockoptions required to enable SSM, MCAST_JOIN_SOURCE_GROUP or something a kin to that in particular. Is there currently any effort to add those options or any other workaround to make SSM work in python natively? Best regards Max

Re: Program to find Primes of the form prime(n+2) * prime(n+1) - prime(n) +- 1.

2018-10-02 Thread Max Zettlmeißl via Python-list
On Tue, Oct 2, 2018 at 10:23 PM, Musatov wrote: > Primes of the form prime(n+2) * prime(n+1) - prime(n) +- 1. > DATA > > 31, 71, 73, 137, 211, 311, 419, 421, 647, 877, 1117, 1487, 1979, 2447, 3079, > 3547, 4027, 7307, 7309, 12211, 14243, 18911, 18913, 23557, 25439, 28729, > 36683, 37831

Re: So apparently I've been banned from this list

2018-09-30 Thread Max Zettlmeißl via Python-list
On Sun, Sep 30, 2018 at 6:30 PM, Steven D'Aprano wrote: > Notwithstanding Ethan's comment about having posted the suspension notice > on the list, I see no sign that he actually did so. At the risk of > further retaliation from the moderators, I am ignoring the ban in this > instance for the purpo

Re: help me in python plssss!!!!

2018-09-14 Thread Max Zettlmeißl via Python-list
On Fri, Sep 14, 2018 at 4:33 PM, Noel P. CUA wrote: > Calculate the true, relative and approximate errors, and Relate the > absolute relative approximate error to the number of significant digits. > > epsilon = 1 > > while epsilon + 1 > 1: > epsilon = epsilon / 2.0 > > epsilon = 2 * epsilon

Re: how to convert this psuedo code to python

2018-09-14 Thread Max Zettlmeißl via Python-list
On Fri, Sep 14, 2018 at 2:37 PM, Noel P. CUA wrote: > compose your own octave script to calculate the machine > epsilon. Analyze the code. > > epsilon = 1 > DO > IF (epsilon+1<=1) EXIT > epsilon = epsilon/2 > END DO > epsilon = 2 x epsilon > epsilon = 1 while epsilon + 1 > 1: epsilon = epsi

Re: Pretty printing dicts with compact=True

2018-09-11 Thread Max Zettlmeißl via Python-list
On Tue, Sep 11, 2018 at 1:58 PM, Nicolas Hug wrote: > pprint({x: x for x in range(15)}, compact=True) > > would be be printed in 15 lines while it could fit on 2. > > > Is this a bug or was this decided on purpose? It is on purpose as can be seen in the code for pprint [1], which calls _format [2

Re: "glob.glob('weirdness')" Any thoughts?

2018-09-10 Thread Max Zettlmeißl via Python-list
On Mon, Sep 10, 2018 at 3:05 PM, Thomas Jollans wrote: from glob import glob glob('test *') > ['test comment', 'test [co]mment', 'test [fallacy]', 'test [comments]', > 'test [comment] a'] glob('test [[]*') > ['test [co]mment', 'test [fallacy]', 'test [comments]', 'test [comment] a']

Re: "glob.glob('weirdness')" Any thoughts?

2018-09-10 Thread Max Zettlmeißl via Python-list
On Sun, Sep 9, 2018 at 6:03 PM, Thomas Jollans wrote: > On 09/09/2018 02:20 PM, Gilmeh Serda wrote: >> >> >> # Python 3.6.1/Linux >> (acts the same in Python 2.7.3 also, by the way) >> > from glob import glob >> >> > glob('./Testfile *') >> >> ['./Testfile [comment] some text.txt'] >>

Re: "glob.glob('weirdness')" Any thoughts?

2018-09-10 Thread Max Zettlmeißl via Python-list
On Sun, Sep 9, 2018 at 2:20 PM, Gilmeh Serda wrote: > > # Python 3.6.1/Linux > (acts the same in Python 2.7.3 also, by the way) > from glob import glob > glob('./Testfile *') > ['./Testfile [comment] some text.txt'] > glob('./Testfile [comment]*') > [] > glob('./Testfile [comme

Re: unexpected output while using list(and nested dictionary)

2015-07-23 Thread max scalf
... On Thu, Jul 23, 2015 at 12:36 AM, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > On Thursday 23 July 2015 08:09, max scalf wrote: > > > Hello List, > > > > I have posted a question on stack overflow for better readability ... but > > i

unexpected output while using list(and nested dictionary)

2015-07-22 Thread max scalf
Hello List, I have posted a question on stack overflow for better readability ... but is intended for python list Please see question below... http://stackoverflow.com/questions/31574860/unexpected-output-while-using-listand-nested-dictionary ​ ​Any pointers is much appreciated. -- https://

Re: convert output to list(and nested dictionary)

2015-07-22 Thread max scalf
24', 'proto': 'tcp'}, {'cidr': '24.12.30.198/32', 'port': '80', 'proto': 'tcp'}, {'cidr': '10.0.2.10/32', 'port': '138', 'proto': 'udp'}, {'cidr': &#

Re: convert output to list(and nested dictionary)

2015-07-22 Thread max scalf
#x27;proto': 'tcp'} {'cidr': '10.0.2.10/32', 'port': '1024', 'proto': 'tcp'} {'cidr': '24.12.30.198/32', 'port': '80', 'proto': 'tcp'} {'cidr': '10.

Re: convert output to list(and nested dictionary)

2015-07-22 Thread max scalf
g-e632d982-995635159130', 'proto': '1', 'port': 'None'} > > > ​You can alter this and add whatever extra checks you need as Chris A > mentioned (when proto is -1 and port is None-None, or the icmp case). This > is just a very crude examp

Re: convert output to list(and nested dictionary)

2015-07-21 Thread max scalf
gt; mentioned (when proto is -1 and port is None-None, or the icmp case). This > is just a very crude example, but hopefully you get the drift. > > Most text parsing problems can easily be solved with these simple tools. > Fire up your shell and test it - this is really the best way to l

convert output to list(and nested dictionary)

2015-07-21 Thread max scalf
Hello all, For Each SecurityGroup, how can i convert that into a List that in turn will have a dictionary of the cidr block, protocol type and the port...so from output below, the SecurityGroup called "default" had 2 rules...allowing TCP port from 80 and 5500 to the source IP and then SecurityGrou

Re: What is the difference between these two? (Assigning functions to variables)

2014-11-04 Thread Max Nathaniel Ho
On Wednesday, November 5, 2014 2:00:08 PM UTC+8, Cameron Simpson wrote: > On 04Nov2014 19:17, Max Nathaniel Ho wrote: > >Just to be clear, I was referring to these two lines > > > >greet = compose_greet_func() > > > >greet_someone = greet > > Please

Re: What is the difference between these two? (Assigning functions to variables)

2014-11-04 Thread Max Nathaniel Ho
Just to be clear, I was referring to these two lines greet = compose_greet_func() greet_someone = greet On Wednesday, November 5, 2014 11:15:46 AM UTC+8, Max Nathaniel Ho wrote: > Example 1 > > def compose_greet_func(): > def get_message(): > return "Hello the

What is the difference between these two? (Assigning functions to variables)

2014-11-04 Thread Max Nathaniel Ho
Example 1 def compose_greet_func(): def get_message(): return "Hello there!" return get_message greet = compose_greet_func() print greet() Example 2 def greet(name): return "hello "+name greet_someone = greet print greet_someone("John" In Example 1, the function compoe_

[ANN] Atomos 0.1.0 - Atomic primitives for Python

2014-10-10 Thread Max Countryman
* Compare-and-set * Atomicity without having to think in terms of locks * Atoms! (http://clojure.org/atoms <http://clojure.org/atoms>) Thanks, Max-- https://mail.python.org/mailman/listinfo/python-list

ANN: EmPy 3.3.2 released (Python 3.x compatibility)

2014-01-28 Thread Erik Max Francis
EmPy should work with any version of Python from 2.4 onward, including 3.x. License This code is released under the LGPL. Release history [since 3.3] - 3.3.2; 2014 Jan 24. Additional fix for source compatibility between 2.x and 3.0. - 3.3.1; 2014 Jan 22. Source c

Pls help me...I want to save scraped data automatically to my database(cleaner version)

2014-01-25 Thread Max Cuban
I have asked this question earlier but this should make more sense than the earlier version and I don't want anyone who could potentially helped to be put off by the initial mess even if I updated it with my cleaner version as a reply I want to save the links scraped to be save in my database so t

Pls help me...I want to save data to my database but I am unable to

2014-01-25 Thread Max Cuban
This is my first programming pet project. I have the following script that extracts links from specific sites and display them on the web(via django). The script work fine but I'm unable to save any stuff in my database. Hence if I run the code, I get the output I want but then it always extracts

Python/Django Extract and append only new links

2013-12-31 Thread Max Cuban
e on my site as older pages. It's my first programming project and don't know how to incorporate this logic into my code. Any help/pointers/references will be greatly appreciated. regards, Max -- https://mail.python.org/mailman/listinfo/python-list

strip away html tags from extracted links

2013-11-29 Thread Max Cuban
I have the following code to extract certain links from a webpage: from bs4 import BeautifulSoup import urllib2, sys import re def tonaton(): site = "http://tonaton.com/en/job-vacancies-in-ghana"; hdr = {'User-Agent' : 'Mozilla/5.0'} req = urllib2.Request(site, headers=hdr) jobpas

Re: Python #ifdef

2013-06-02 Thread Erik Max Francis
hp files). But still, GNU M4 is a decent piece of technology. Agreed. The terror that most people feel when hearing "m4" is because m4 was associated with sendmail, not because m4 was inherently awful. It has problems, but you'd only encounter them when doing something _very_ abs

Functional vs. Object oriented API

2013-04-10 Thread Max Bucknell
oosing between the two styles, or is it largely a matter of personal preference? Thanks for reading, Max. -- http://mail.python.org/mailman/listinfo/python-list

datetime

2012-09-13 Thread Max
How do I set the time in Python? Also, is there any *direct* way to shift it? Say, it's 09:00 now and Python makes it 11:30 *without* me having specified "11:30" but only given Python the 2h30m interval. Note that any "indirect" methods may need complicated ways to keep track of the milliseconds

Re: Single leading dash in member variable names?

2012-09-11 Thread Erik Max Francis
as syntactic significance. Thank you! PEP 8 says this is bad form. What do you think? Where does it say that? -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Jabber erikmaxfrancis

Re: Encapsulation, inheritance and polymorphism

2012-07-21 Thread Erik Max Francis
On 07/20/2012 03:28 AM, BartC wrote: "Erik Max Francis" wrote in message news:gskdnwoqpkoovztnnz2dnuvz5s2dn...@giganews.com... On 07/20/2012 01:11 AM, Steven D'Aprano wrote: On Thu, 19 Jul 2012 13:50:36 -0500, Tim Chase wrote: I'm reminded of Graham's Number, whi

Re: Encapsulation, inheritance and polymorphism

2012-07-21 Thread Erik Max Francis
On 07/20/2012 02:05 AM, Virgil Stokes wrote: On 20-Jul-2012 10:27, Steven D'Aprano wrote: The fellow looked relived and said "Oh thank god, I thought you said *million*!" How does this relate to the python list? It's also a seriously old joke. -- Erik Max Francis

Re: Encapsulation, inheritance and polymorphism

2012-07-20 Thread Erik Max Francis
n Graham's Number but still inconceivably ginormous.) You don't even need to go that high. Even a run-of-the-mill googol (10^100) is far larger than the total number of elementary particles in the observable Universe. -- Erik Max Francis && m...@alcyone.com && http://w

Re: installing 2 and 3 alongside on MS Windows

2012-05-25 Thread Max Erickson
The proposed launcher works fine for me: https://bitbucket.org/vinay.sajip/pylauncher/downloads (I'm not sure that is the most up to date place for the launcher, but that's the one I am using) Max -- http://mail.python.org/mailman/listinfo/python-list

Re: How to convert simple B/W graphic to the dot matrix for the LED display/sign

2012-03-04 Thread Max Erickson
; im=im.convert('1') >>> px=im.load() >>> px[0,0] 0 That's the numeral one in the argument to convert. The load method returns a pixel access object. Max -- http://mail.python.org/mailman/listinfo/python-list

Re: while True or while 1

2012-01-23 Thread Erik Max Francis
Giampaolo Rodolà wrote: Il 21 gennaio 2012 22:13, Erik Max Francis ha scritto: The real reason people still use the `while 1` construct, I would imagine, is just inertia or habit, rather than a conscious, defensive decision. If it's the latter, it's a case of being _way_ too defensi

Re: while True or while 1

2012-01-21 Thread Erik Max Francis
e idiomatic `while 1` notation comes from back in the pre-Boolean days. In any reasonably modern implementation, `while True` is more self-documenting. I would imagine the primary reason people still do it, any after-the-fact rationalizations aside, is simply habit. -- Erik Max Francis &&a

Re: while True or while 1

2012-01-21 Thread Erik Max Francis
7;s quite reasonable to assume that (even in Python 2) `True` is bound to something which is, in fact, true. The real reason people still use the `while 1` construct, I would imagine, is just inertia or habit, rather than a conscious, defensive decision. If it's the latter, it's a cas

Code Review: a framework for writing IRC applications or bots

2011-10-12 Thread Max Countryman
reaction is that this is essentially useless that wasn't necessarily my goal. Nonetheless I really would appreciate any kind of code review the community might be willing to provide. The project is available here: https://github.com/maxcountryman/irctk Thanks for your time! Max -- http://ma

Re: PUT with proxy-support

2011-08-25 Thread Max Countryman
Check out the python Requests module: http://docs.python-requests.org/en/latest/index.html Sent from my iPhone On Aug 25, 2011, at 7:07, Shashwat Anand wrote: > I want to make a PUT request. > I need some headers of my own ( certificates etc ) and I need to mandatorily > use a proxy. > Also t

Re: extended slicing and negative stop value problem

2011-08-21 Thread Max
On Aug 20, 1:40 pm, Steven D'Aprano wrote: > Pardon me for breaking threading, but I don't have Max's original post. Not sure why; I also can't see it! I'll copy it at the end just in case. > On Sat, Aug 20, 2011 at 7:20 PM, Max Moroz wrote: > > Wou

Re: extended slicing and negative stop value problem

2011-08-20 Thread Max
On Aug 20, 11:29 am, Chris Angelico wrote: > If you're using a variable for the stop value, you just need to set it > to an explicit None if it would fall negative: > > >>> a[10:None:-1] > That doesn't work if it's set in a loop or if it's calculated as a formula. For example, this very simple co

extended slicing and negative stop value problem

2011-08-20 Thread Max Moroz
Would it be a good idea to change Python definition so that a[10, -1, -1] referred to the elements starting with position 10, going down to the beginning? This would require disabling the "negative stop value means counting from the end of the array" magic whenever the step value is negative. The

Re: Is it bad practise to write __all__ like that

2011-07-28 Thread Erik Max Francis
f.append(obj.__name__) return obj __all__ = AllList() @__all__ def api(): pass @__all__ def db(): pass @__all__ def input(): pass @__all__ def output(): pass @__all__ def tcl(): pass Bravo! -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose,

Re: how to call a function for evry 10 secs

2011-06-29 Thread Max Countryman
Yeah it won't work. Recursion depth will be reached. Steven's suggestion is much better. -- Max Countryman +1-917-971-8472 On Wednesday, June 29, 2011 at 2:05 PM, santosh h s wrote: > how to end ths over a period of time > > On Wed, Jun 29, 2011 at 11:25 PM, Max Co

Re: Significant figures calculation

2011-06-28 Thread Erik Max Francis
Mel wrote: Erik Max Francis wrote: Mel wrote: By convention, nobody ever talks about 1 x 9.97^6 . Not sure what the relevance is, since nobody had mentioned any such thing. If it was intended as a gag, I don't catch the reference. I get giddy once in a while.. push things to limits

Re: Significant figures calculation

2011-06-28 Thread Erik Max Francis
t 2 x 10^-8 kg, or on the order of 10^-8 kg (zero significant figures). To convert to energy, multiply by c^2. c = 3 x 10^8 m/s, so c^2 = 9 x 10^16 m^2/s^2, or about 10^17 m^2/s^2, so the Planck energy is on the order of 10^9 J. That's a calculation to zero significant figures. --

Re: Significant figures calculation

2011-06-28 Thread Erik Max Francis
Mel wrote: Erik Max Francis wrote: Chris Angelico wrote: On Tue, Jun 28, 2011 at 12:56 PM, Steven D'Aprano wrote: Zero sig figure: 0 That's not really zero significant figures; without further qualification, it's one. Is 0.0 one sig fig or two? Two. (Just vaguely curiou

Re: Significant figures calculation

2011-06-27 Thread Erik Max Francis
igure would be an order of magnitude estimate only. These aren't usually done in the "e" scientific notation, but it would be something like 10^3 (if we assume ^ is exponentiation, not the Python operator). c^2 is 9 x 10^16 m^2/s^2 to one significant figure. It's 10^17 m^2/

Re: Significant figures calculation

2011-06-27 Thread Erik Max Francis
ero sig figures value is ever useful.) Yes. They're order of magnitude estimates. 1 x 10^6 has one significant figure. 10^6 has zero. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y

Re: break in a module

2011-06-17 Thread Erik Max Francis
Steven D'Aprano wrote: On Thu, 16 Jun 2011 22:20:50 -0700, Erik Max Francis wrote: [...] Yes, which could be rephrased as the fact that `break` and `continue` are restricted to looping control structures, so reusing `break` in this context would be a bad idea. You know, kind of like the

Re: break in a module

2011-06-16 Thread Erik Max Francis
Ian Kelly wrote: On Thu, Jun 16, 2011 at 10:24 PM, Erik Max Francis wrote: True. So let's use `in` to represent breaking out of the top-level code of a module. Why not, it's not the first time a keyword has been reused, right? The point is, if it's not obvious already from

Re: break in a module

2011-06-16 Thread Erik Max Francis
Ian Kelly wrote: On Thu, Jun 16, 2011 at 7:21 PM, Erik Max Francis wrote: Neither makes sense. `break` exits out of looping structures, which the top-level code of a module most certainly is not. Why does that matter? It seems a bit like arguing that the `in` keyword can't be use

Re: break in a module

2011-06-16 Thread Erik Max Francis
t you're just being difficult. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis Winners are men who have dedicated their whole lives to winning. -- Woody Hayes -- http://mail.python.org/mailman/listinfo/python-list

Re: break in a module

2011-06-16 Thread Erik Max Francis
`. If you want to conditionally execute some code, use `if`. If you want to indicate an exceptional condition, raise an exception. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype eri

Re: break in a module

2011-06-16 Thread Erik Max Francis
Chris Angelico wrote: On Fri, Jun 17, 2011 at 9:29 AM, Erik Max Francis wrote: Chris Angelico wrote: On Fri, Jun 17, 2011 at 8:07 AM, Erik Max Francis wrote: It's quite consistent on which control structures you can break out of -- it's the looping ones. Plus functions. N

Re: break in a module

2011-06-16 Thread Erik Max Francis
Chris Angelico wrote: On Fri, Jun 17, 2011 at 8:07 AM, Erik Max Francis wrote: It's quite consistent on which control structures you can break out of -- it's the looping ones. Plus functions. No: >>> def f(): ... break ... File "", line 2 SyntaxError: 

Re: break in a module

2011-06-16 Thread Erik Max Francis
lookup where the keys are functions, and execute the value. Even then, unless there are quite a lot of cases, this may be overkill. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxf

Re: break in a module

2011-06-16 Thread Erik Max Francis
Eric Snow wrote: On Tue, Jun 14, 2011 at 5:51 PM, Erik Max Francis wrote: Ethan Furman wrote: To me, too -- too bad it doesn't work: c:\temp>\python32\python early_abort.py File "early_abort.py", line 7 return ^ SyntaxError: 'return' outside funct

Re: break in a module

2011-06-14 Thread Erik Max Francis
eak". To me, too -- too bad it doesn't work: c:\temp>\python32\python early_abort.py File "early_abort.py", line 7 return ^ SyntaxError: 'return' outside function Nor should it. There's nothing to return out of. -- Erik Max Francis && m.

Re: break in a module

2011-06-14 Thread Erik Max Francis
onsist of mostly definitions. Modules can interact with each other, be called recursively, etc., and so at an arbitrary point saying, "break out of this module" doesn't have a great deal of meaning. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis There is _never_ no hope left. Remember. -- Louis Wu -- http://mail.python.org/mailman/listinfo/python-list

Re: float("nan") in set or as key

2011-06-05 Thread Erik Max Francis
ite a different thing, not simply a Kronecker delta extended to the reals. Kronecker deltas are used all the time over the reals; for instance, in tensor calculus. Just because the return values are either 0 or 1 doesn't mean that their use is incompatible over reals (as integers

Re: float("nan") in set or as key

2011-05-28 Thread Erik Max Francis
Albert Hopkins wrote: On Sun, 2011-05-29 at 00:41 +0100, MRAB wrote: 1.0 == 1.0 True float("nan") == float("nan") False I can't cite this in a spec, but it makes sense (to me) that two things which are nan are not necessarily the same nan. It's part of t

Re: float("nan") in set or as key

2011-05-28 Thread Erik Max Francis
nan} {nan} It's fundamentally because NaN is not equal to itself, by design. Dictionaries and sets rely on equality to test for uniqueness of keys or elements. >>> nan = float("nan") >>> nan == nan False In short, don't do that. -- Erik Max Francis &&

http://DuplicateFilesDeleter.com - This software deletes duplicate files in media collection of any type

2011-04-15 Thread Max Loger
http://DuplicateFilesDeleter.com - find duplicates http://DuplicateFilesDeleter.com is an innovative tool that can recognize duplicate audio files even if they are stored in different file formats and not marked with ID3 tags. It will find fast all similar or exact duplicate audio files in a fold

Re: value of pi and 22/7

2011-03-17 Thread Erik Max Francis
quency. In all bases. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis They love too much that die for love. -- (an English proverb) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python programming

2010-12-22 Thread Max Countryman
>>> 5 in [2, 6, 5] True Sent from my iPhone On Dec 22, 2010, at 20:22, Maurice Shih wrote: > Dear python-list@python.org, > Thank you for taking the time to listen to my request. I'm a beginner > programmer and I se python 2.6. I am making a program that needs a command > that can check if a

while True or while 1

2010-12-12 Thread Max Countryman
I'm sure this has been brought up many times, but a quick Googling didn't yield the decisive results I was hoping for, so I apologize if this has already been addressed in great detail somewhere else. I am wondering what the rationale is behind preferring while True over while 1? For me, it see

Re: "Strong typing vs. strong testing"

2010-10-12 Thread Erik Max Francis
ey'll work will help alone. If you're calling a trigonometric function with a dimensionless argument, you either mean radians are you've got bigger problems with the understanding of unit systems. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/

Re: "Strong typing vs. strong testing"

2010-09-28 Thread Erik Max Francis
Keith Thompson wrote: Erik Max Francis writes: [...] >>> print c # floating point accuracy aside 299792458.0 m/s Actually, the speed of light is exactly 299792458.0 m/s by definition. (The meter and the second are defined in terms of the same wavelength of light; this wa

Re: "Strong typing vs. strong testing"

2010-09-28 Thread Erik Max Francis
ror: and do not have compatible units And everybody's favorite: >>> print ((epsilon_0*mu_0)**-0.5).simplify() 299792458.011 m/s >>> print c # floating point accuracy aside 299792458.0 m/s -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis In Heaven all the interesting people are missing. -- Friedrich Nietzsche -- http://mail.python.org/mailman/listinfo/python-list

Re: GDAL-1.7.1 : vcvarsall.bat missing

2010-06-25 Thread Max Erickson
r use with Python: http://www.develer.com/oss/GccWinBinaries He does note on the page that the MinGW project isn't quite so sure that GCC 4.x is ready for release. Max -- http://mail.python.org/mailman/listinfo/python-list

Re: Classes and threading

2010-05-18 Thread Erik Max Francis
t_ take any arguments, and explicitly call its parent constructor not passing anything. So it shouldn't be a wonder that it won't accept any arguments. If you don't intend to override the constructor in the parent class, simply don't define it. -- Erik Max Francis &&am

Re: fcntl, serial ports and serial signals on RS232.

2010-04-09 Thread Max Kotasek
On Apr 8, 11:17 am, Grant Edwards wrote: > On 2010-04-07, Max Kotasek wrote: > > > I'm trying to figure out how to parse the responses fromfcntl.ioctl() > > calls that modify the serial lines in a way that asserts that the line > > is now changed. > > Two c

fcntl, serial ports and serial signals on RS232.

2010-04-07 Thread Max Kotasek
ven taking the right approach by using the fcntl.ioctl call? The environment is a ubuntu 8.04 distribution. Unfortunately due to other limitations, I can't use/extend pyserial, though I would like to. I appreciate any advice on this matter, Max -- http://mail.python.org/mailman/listinfo/python-list

Re: Draft PEP on RSON configuration file format

2010-03-02 Thread Erik Max Francis
Patrick Maupin wrote: On Mar 2, 9:20 pm, Erik Max Francis wrote: Patrick Maupin wrote: On Mar 2, 5:36 pm, Steven D'Aprano wrote: You seem to be taking the position that if you start with a config file config.json, it is "too hard to edit", but then by renaming it to config.rs

Re: Draft PEP on RSON configuration file format

2010-03-02 Thread Erik Max Francis
#x27;s the argument being used against you, not the argument being ascribed to you. You're getting confused about something, somewhere. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype

Re: Draft PEP on RSON configuration file format

2010-03-01 Thread Erik Max Francis
make your own "more readable" format. If JSON is unreadable, so must be RSON. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis It's better to be quotab

Re: Draft PEP on RSON configuration file format

2010-03-01 Thread Erik Max Francis
point out that in their opinion it's not such a good idea. You don't own this or any other thread. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis It's better to be quotable than to be honest. -- Tom Stoppard -- http://mail.python.org/mailman/listinfo/python-list

Re: Draft PEP on RSON configuration file format

2010-03-01 Thread Erik Max Francis
not one of them. Agreed. Even YAML's acronym indicates that it is already a bridge too far; we don't need more. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmax

Re: syntax error : first python program

2009-12-22 Thread Erik Max Francis
pradeep wrote: I have this file in linux === sample.py #!/usr/bin/env python name = "blah" print name ... Any one knows , whats the syntax error here? You're indenting for no reason. -- Erik Max Francis && m...@alcyone.com && h

HTTPS - HTTPPasswordMgrWithDefaultRealm

2009-12-11 Thread Max Slimmer
ret except URLError: log = logging.getLogger() log.warn("problem connecting") raise thanks, -- Max Slimmer -- http://mail.python.org/mailman/listinfo/python-list

Re: need clarification on -0

2009-11-30 Thread Erik Max Francis
;>> 0 and True 0 >>> 0 and False 0 >>> 0 or True True What you're seeing is simply the short-circuiting behavior of the `and` and `or` operators; they return the last (relevant) value they encountered before making their determination of the value of the overall expre

Re: Python-URL! - weekly Python news and links (Nov 24)

2009-11-24 Thread Erik Max Francis
t the answer they're looking for. The former is surely just laziness, but there's something psychological going on with the latter. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-16 Thread Erik Max Francis
the same syntax, with `fi` written instead of `endif` -- not sure why the difference in keyword is that big of a deal to you. As others have pointed out, either way, there are quite a few languages that use this type of syntax. -- Erik Max Francis && m...@alcyone.com && http:/

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-16 Thread Erik Max Francis
was not a suggestion to change Python. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis Mona Lisa / Come to discover / I am your daughter -- Lamya -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a command that returns the number of substrings in a string?

2009-10-23 Thread Erik Max Francis
ng. I'm wondering if there is a function in python which can directly return this information. The .count string method. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis

Re: (from stdlib-sig) ctypes or struct from an h file

2009-10-19 Thread Erik Max Francis
on defined and need not be supported by any compilers. The proper way to do this is to define a protocol and translate it to the native structures on both sides of the communication -- both in Python and in C. There's really no way around this. -- Erik Max Francis && m

Re: (from stdlib-sig) ctypes or struct from an h file

2009-10-18 Thread Erik Max Francis
these things will be the same. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis Diplomacy and defense are not substitutes for one another. Either alone would fail. -

  1   2   3   4   5   6   7   8   9   10   >