Re: what would be the regular expression for null byte present in a string

2015-01-14 Thread Thomas 'PointedEars' Lahn
Peter Otten wrote: > Shambhu Rajak wrote: >> I have a string that I get as an output of a command as: >> > '\x01\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x0010232ae8944a\x02\x00\x00\x00\x00\x00\x00\x00\n' >> >> I want to fetch '10232ae8944a' from the above string. >> >> I want to find a re patt

Re: what would be the regular expression for null byte present in a string

2015-01-14 Thread Thomas 'PointedEars' Lahn
Thomas 'PointedEars' Lahn wrote: > Peter Otten wrote: >> Shambhu Rajak wrote: >>> I want to find a re pattern that could replace all the \x01..\x0z to be >>> replace by empty string '', so that I can get the desired portion of >>> string

xmlrpc: problems with socket handling, close, shutdown of server, TIME_WAIT, ...

2014-05-06 Thread thomas . lehmann . private
Hi, taking the xml-rpc derived from standard example is working - basically - but with following scenario I do not understand the problem. Maybe you can help: - one Unittest that does create the xmlrpc server in a thread in "setUp" and shutdown of it in tearDown. The xml-rcp server does s

REG: Interactive Python (ipython notebook) Tutorial for Beginners

2013-11-08 Thread Anoop Thomas Mathew
Hi All, Lately, I've been working on a ipython notebook tutorial for beginners. The idea is that, those who have basic idea about computers should be able to pick up python very easily. https://bitbucket.org/atmb4u/python-live/ I have completed 25 chapters. Would love some reviews, suggestions a

Re: Pexpect idea - but can I handle curses?

2015-03-13 Thread Thomas 'PointedEars' Lahn
Skip Montanaro wrote: > I have this tweak I'd like to make to the top command (Linux only is > fine). Most of the time I want to see just one user or all users. Every > now and again though, I'd like to see all users except another. Top > doesn't support this functionality, Yes, it (top(1) from

Re: Pexpect idea - but can I handle curses?

2015-03-13 Thread Thomas 'PointedEars' Lahn
Skip Montanaro wrote: > Thomas 'PointedEars' Lahn […] wrote: >> Yes, it (top(1) from procps-ng 3.3.9) does. Either run >> >> top -u '!root' >> >> or type “o” (for case-insensitive filter), then e.g. “!USER=root” to show >> processes st

Re: regex help

2015-03-13 Thread Thomas 'PointedEars' Lahn
Larry Martell wrote: > I need to remove all trailing zeros to the right of the decimal point, > but leave one zero if it's whole number. For example, if I have this: > > 14S,5.,4.5686274500,3.7272727272727271,3.3947368421052630,5.7307692307692308,5.7547169811320753,4.94230769

Re: Pexpect idea - but can I handle curses?

2015-03-14 Thread Thomas 'PointedEars' Lahn
Skip Montanaro wrote: > Let's just let this thread die, shall we? So far, nobody seems interested > in attempting to answer my original question. That might have to do with , specifically

Re: Pexpect idea - but can I handle curses?

2015-03-15 Thread Thomas 'PointedEars' Lahn
Skip Montanaro wrote: >> That might have to do with >> , specifically >> . > > Thanks, but not really helpful. I'm well aware of Eric Raymond's > contributions to the open source world. I

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-18 Thread Thomas 'PointedEars' Lahn
Laurent Pointal wrote: > Laurent Pointal wrote: >> Take care of indent: >> >> def f(x): >> a = 5 >> """an correctly indented expression to be >> inside the function""" >> return a * x > > Here only the first indent of """ at beginning of the string to be aligned > to function blo

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-18 Thread Thomas 'PointedEars' Lahn
Thomas 'PointedEars' Lahn wrote: > […] standalone multi-line string literals in Python code serve a specific > purpose when at the beginning of a function, method or class clock: they ^ block¹ > constitute *d

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-18 Thread Thomas 'PointedEars' Lahn
Aditya Raj Bhatt wrote: > I always do single line comments with # but just for the sake of it I > tried it with ''' ''' and it gives me a syntax error. > > In both the interpreter, and the source code text file, doing - > > a = 5 '''a comment''' > > results in a syntax error, with the very last

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-21 Thread Thomas 'PointedEars' Lahn
Denis McMahon wrote: > However, you can't have multiple expressions on a line without some sort > of operand or separator between them. String concatenation is implicit in Python, but only with string *literals*: | $ python | Python 2.7.9 (default, Mar 1 2015, 12:57:24) | [GCC 4.9.2] on linux2

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-21 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Sun, Mar 22, 2015 at 2:14 PM, Thomas 'PointedEars' Lahn > wrote: >> Denis McMahon wrote: >>> However, you can't have multiple expressions on a line without some sort >>> of operand or separator between them. >> String

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-25 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Sun, Mar 22, 2015 at 2:49 PM, Thomas 'PointedEars' Lahn > wrote: >>> Implicit concatenation is part of the syntax, not part of the expression >>> evaluator. >> Reads like nonsense to me. > > What do you mean? As I sho

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-26 Thread Thomas 'PointedEars' Lahn
Ian Kelly wrote: > […] Thomas 'PointedEars' Lahn […] wrote: >> Chris Angelico wrote: >>> […] Thomas 'PointedEars' Lahn […] wrote: >>>>> Implicit concatenation is part of the syntax, not part of the >>>>> expression evaluator.

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-26 Thread Thomas 'PointedEars' Lahn
Dave Angel wrote: [Fixed quotation] > On 03/26/2015 01:09 AM, Ian Kelly wrote: >>>>> Thomas 'PointedEars' Lahn wrote: >>>>>> <https://docs.python.org/3/reference/lexical_analysis.html#string->>>>>> >>>>>> li

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-26 Thread Thomas 'PointedEars' Lahn
Thomas 'PointedEars' Lahn wrote: > multiple-string = STRING *STRING > […] > in ABNF. JFTR: ABNF allows for multiple-string = 1*STRING to be equivalent to the above. <http://en.wikipedia.org/wiki/Augmented_Backus%E2%80%93Naur_Form> pp. -- PointedEars Twitter: @P

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-26 Thread Thomas 'PointedEars' Lahn
Ian Kelly wrote: > On Thu, Mar 26, 2015 at 12:29 PM, Ian Kelly wrote: >> On Thu, Mar 26, 2015 at 10:45 AM, Thomas 'PointedEars' Lahn >>> No, in the used flavour of EBNF the unquoted “+” following a goal symbol >>> clearly means the occurrence of *at least

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-26 Thread Thomas 'PointedEars' Lahn
Ian Kelly wrote: > […] Thomas 'PointedEars' Lahn […] wrote: >> Ian Kelly wrote: >>> What the grammar that you quoted from shows is that STRING+ is an >>> expression. The individual STRINGs of a STRING+ are not expressions, >>> except to the ex

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-28 Thread Thomas 'PointedEars' Lahn
Gregory Ewing wrote: > Ian Kelly wrote: >> What I mean is that if you construct a parse tree of "foo" "bar" using >> that grammar, it looks like this: >> >> expr >>| >> STRING+ >> / \ >> STRING STRING > > Not quite -- STRING+ is not a symbol in the grammar, it's > a shor

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-28 Thread Thomas 'PointedEars' Lahn
Ian Kelly wrote: > […] Thomas 'PointedEars' Lahn […] wrote: >> Ian Kelly wrote: >>> What I mean is that if you construct a parse tree of "foo" "bar" using >>> that grammar, it looks like this: >>> >>> expr >>&

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-29 Thread Thomas 'PointedEars' Lahn
Ian Kelly wrote: > […] Thomas 'PointedEars' Lahn […] wrote: >> Ian Kelly wrote: >>> […] Thomas 'PointedEars' Lahn […] wrote: >>>> Ian Kelly wrote: >>>>> What I mean is that if you construct a parse tree of "foo"

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-04-02 Thread Thomas 'PointedEars' Lahn
Ian Kelly wrote: > […] Thomas 'PointedEars' Lahn […] wrote: >> Ian Kelly wrote: >>> Within a grammar, the question of "is an X a Y" is nonsensical in >>> isolation. It can only be answered in relation to a parse tree. >>> Consider the

Re: Python regex exercise

2015-04-04 Thread Thomas 'PointedEars' Lahn
Robert Clove wrote: > Do anyone have good links to python regex or other python problems for > beginners but with solution. > > Please mail me.

Re: Generarl programming question.

2015-04-11 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > The 'x' inside each function is completely separate, no matter how > many times they get called. They're usually stored on something called > a "call stack" - you put another sheet of paper on top of the stack > every time you call a function, local variables are all writte

Re: Generarl programming question.

2015-04-11 Thread Thomas 'PointedEars' Lahn
Terry Reedy wrote: > On 4/11/2015 12:23 PM, Thomas 'PointedEars' Lahn wrote: >> Chris Angelico wrote: >>> The 'x' inside each function is completely separate, no matter how >>> many times they get called. They're usually stored on something

Re: Generarl programming question.

2015-04-11 Thread Thomas 'PointedEars' Lahn
Terry Reedy wrote: > On 4/11/2015 3:19 PM, Thomas 'PointedEars' Lahn wrote: >> Terry Reedy wrote: >>> What Chris is describing is one local namespace (sheet of paper) per >>> function *call*. >> I *know* what he is describing: the *call* stack. &g

Re: Let exception fire or return None

2015-04-30 Thread Thomas 'PointedEars' Lahn
Cecil Westerhof wrote: > I have a function to fetch a message from a file: > def get_indexed_message(message_filename, index): > """ > Get index message from a file, where 0 gets the first message > """ > > return open(expanduser(message_filename), > 'r

Re: l = range(int(1E9))

2015-05-01 Thread Thomas 'PointedEars' Lahn
Cecil Westerhof wrote: > By the way: I also see python3.4 and python3.4m. Any idea where the m > stands for? I googled for “python3.4m” and found as second result In a nutshell: python3.4m was buil

Re: IDLE Restoration

2015-05-08 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > Are you hoping to have the IDLE editor restore the fact that you had > files X, Y, and Z open, or are you hoping to have the interactive > interpreter retain your entire history of commands and their results? > The former is reasonably plausible (and may well be possible al

Re: IDLE Restoration

2015-05-08 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > […] Thomas 'PointedEars' Lahn […] wrote: >> Chris Angelico wrote: >>> Are you hoping to have the IDLE editor restore the fact that you had >>> files X, Y, and Z open, or are you hoping to have the interactive >>> interpreter re

Re: Minimising stack trace

2015-05-15 Thread Thomas 'PointedEars' Lahn
Cecil Westerhof wrote: > While playing with recursion I get: > RuntimeError: maximum recursion depth exceeded in comparison > > But then I get a very long stack trace. Is there a way to make this a > lot shorter. Now I ‘lose’ interesting information because of the length of > the stack trace

Re: Rule of order for dot operators?

2015-05-16 Thread Thomas 'PointedEars' Lahn
C.D. Reimer wrote: Who? > Noobie What? > question regarding a single line of code that transforms a URL > slug ("this-is-a-slug") into a title ("This Is A Slug"). > > title = slug.replace('-',' ').title() > > This line also works if I switched the dot operators around. > > title = slug.t

Re: Rule of order for dot operators?

2015-05-17 Thread Thomas 'PointedEars' Lahn
C.D. Reimer wrote: > On 5/16/2015 12:40 PM, Thomas 'PointedEars' Lahn wrote: >> However, for greater efficiency, in general you should call .replace() >> in such a way that the length of the string it operates on is >> minimized. For example, if feasible,

Re: Rule of order for dot operators?

2015-05-17 Thread Thomas 'PointedEars' Lahn
Tim Chase wrote: > On 2015-05-16 12:20, C.D. Reimer wrote: >> Does python perform the dot operators from left to right or >> according to a rule of order (i.e., multiplication/division before >> add/subtract)? > > Yes, Python evaluates dot-operators from left to right. “.” is _not_ an operator i

Re: Rule of order for dot operators?

2015-05-19 Thread Thomas 'PointedEars' Lahn
Denis McMahon wrote: > On Sun, 17 May 2015 11:45:02 +1000, Steven D'Aprano wrote: >> On Sun, 17 May 2015 05:40 am, Thomas 'PointedEars' Lahn wrote: >>> C.D. Reimer wrote: >>> >>> Who? >> Don't be a dick, Thomas. > > Thoma

Re: Best way to rewrite Popen

2015-05-19 Thread Thomas 'PointedEars' Lahn
Cecil Westerhof wrote: > At the moment I am playing with things like: > p = subprocess.Popen('ls -l', shell = True, stdout = subprocess.PIPE) > > I think that most of the times this are the values I want. So it would > be nice to overrule the defaults. What is the best way to do this? > So cr

Re: Best way to rewrite Popen

2015-05-19 Thread Thomas 'PointedEars' Lahn
Cecil Westerhof wrote: > At the moment I am playing with things like: > p = subprocess.Popen('ls -l', shell = True, stdout = subprocess.PIPE) > > I think that most of the times this are the values I want. So it would > be nice to overrule the defaults. What is the best way to do this? > So cr

Re: Rule of order for dot operators?

2015-05-19 Thread Thomas 'PointedEars' Lahn
Ned Batchelder wrote: > On Tuesday, May 19, 2015 at 6:33:46 PM UTC-4, Thomas 'PointedEars' Lahn > wrote: >> Denis McMahon wrote: >> > On Sun, 17 May 2015 11:45:02 +1000, Steven D'Aprano wrote: >> >> On Sun, 17 May 2015 05:40 am, Thomas &#

Re: Ah Python, you have spoiled me for all other languages

2015-05-23 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > […] My hobby-horse, Unicode, is a notable flaw in many languages - if you > ask the user for information (in the most obvious way for whatever > environment you're in, be that via a web browser request, or a GUI widget, > or text entered at the console), can it cope equa

Re: OpenCV with Python (cv or cv2)

2015-05-26 Thread Thomas 'PointedEars' Lahn
Markos wrote: ^^ Please append your last name. > I want to use OpenCV with Python. > > I installed version 2.4.9 > (http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip/) > in debian Squeeze running Python 2.6.6. Using the tutorial: > http://indranilsinharoy.

Re: OpenCV with Python (cv or cv2)

2015-05-26 Thread Thomas 'PointedEars' Lahn
Rustom Mody wrote: > On Tuesday, May 26, 2015 at 9:19:35 PM UTC+5:30, Thomas 'PointedEars' Lahn > wrote: >> Markos wrote: >> ^^ >> Please append your last name. > > No more required than an affidavit proving PointedEars is your legal name In addi

Re: Ah Python, you have spoiled me for all other languages

2015-06-07 Thread Thomas 'PointedEars' Lahn
Ned Batchelder wrote: > On Saturday, May 23, 2015 at 9:01:29 AM UTC-4, Steven D'Aprano wrote: >> On Sat, 23 May 2015 10:33 pm, Thomas 'PointedEars' Lahn wrote: >> > If only characters were represented as sequences UTF-16 code units in >> > ECMAScript im

Re: Testing random

2015-06-07 Thread Thomas 'PointedEars' Lahn
Cecil Westerhof wrote: > I wrote a very simple function to test random: > def test_random(length, multiplier = 1): > number_list = length * [0] > for i in range(length * multiplier): > number_list[random.randint(0, length - 1)] += 1 > minimum = min(numbe

Re: Testing random

2015-06-07 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Sun, Jun 7, 2015 at 8:40 PM, Thomas 'PointedEars' Lahn > wrote: >> Cecil Westerhof wrote: >>> I wrote a very simple function to test random: >>> def test_random(length, multiplier = 1): >>> number_list

Re: Testing random

2015-06-07 Thread Thomas 'PointedEars' Lahn
Peter Otten wrote: > Steven D'Aprano wrote: >>> I wrote a very simple function to test random: >>> def test_random(length, multiplier = 1): >>> number_list = length * [0] >>> for i in range(length * multiplier): >>> number_list[random.randint(0, length - 1)] +=

Re: Testing random

2015-06-07 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Mon, Jun 8, 2015 at 1:51 AM, Thomas 'PointedEars' Lahn > wrote: >> Chris Angelico wrote: >> >>> On Sun, Jun 7, 2015 at 8:40 PM, Thomas 'PointedEars' Lahn >>> wrote: >>>> Cecil Westerhof wrote

Re: Testing random

2015-06-07 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Mon, Jun 8, 2015 at 2:36 AM, Thomas 'PointedEars' Lahn > wrote: >>> The greater the multiplier, the lower the chance that any element will >>> have no hits. >> Wrong. >> >>> [ex falso quodlibet] > > Huh.

Re: Testing random

2015-06-07 Thread Thomas 'PointedEars' Lahn
Jussi Piitulainen wrote: > Thomas 'PointedEars' Lahn writes: >> 8 3 6 3 1 2 6 8 2 1 6. > > There are more than four hundred thousand ways to get those numbers in > some order. > > (11! / 2! / 2! / 2! / 3! / 2! = 415800) Fallacy. Order is irreleva

Re: Testing random

2015-06-07 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Mon, Jun 8, 2015 at 4:23 AM, Thomas 'PointedEars' Lahn > wrote: >> If the set to choose from is integer numbers from 1 to 9, then *each* of >> those sequences has *the same* probability (1∕9)¹¹ ≈ 3.1866355 × 10⁻¹¹. >> >> AISB, th

Re: Testing random

2015-06-07 Thread Thomas 'PointedEars' Lahn
[email protected] wrote: > On Sun, Jun 7, 2015, at 15:29, Thomas 'PointedEars' Lahn wrote: >> Jussi Piitulainen wrote: >> > Thomas 'PointedEars' Lahn writes: >> >> 8 3 6 3 1 2 6 8 2 1 6. >> > >> > There are more tha

Re: Testing random

2015-06-07 Thread Thomas 'PointedEars' Lahn
Peter Otten wrote: > Thomas 'PointedEars' Lahn wrote: >> Peter Otten wrote: >>> Steven D'Aprano wrote: >>>>> I wrote a very simple function to test random: >>>>> def test_random(length, multiplier = 1): >>>&

Re: Testing random

2015-06-07 Thread Thomas 'PointedEars' Lahn
[email protected] wrote: > On Sun, Jun 7, 2015, at 16:09, Thomas 'PointedEars' Lahn wrote: >> No. AISB, those sequences all have the same probability: > > Yes and the probability of getting _any_ of the sequences, is the sum of > the probabilities for each one o

Re: Testing random

2015-06-07 Thread Thomas 'PointedEars' Lahn
[email protected] wrote: > On Sun, Jun 7, 2015, at 16:09, Thomas 'PointedEars' Lahn wrote: >> No. AISB, those sequences all have the same probability: > > Yes and the probability of getting _any_ of the sequences, is the sum of > the probabilities for each one o

Re: Testing random

2015-06-10 Thread Thomas 'PointedEars' Lahn
Jussi Piitulainen wrote: > Thomas 'PointedEars' Lahn writes: >> Jussi Piitulainen wrote: >>> Thomas 'PointedEars' Lahn writes: >>>> 8 3 6 3 1 2 6 8 2 1 6. >>> >>> There are more than four hundred thousand ways to get th

Re: Testing random

2015-06-12 Thread Thomas 'PointedEars' Lahn
Ian Kelly wrote: > The probability of 123456789 and 1 are equal. The probability > of a sequence containing all nine numbers and a sequence containing > only 1s are *not* equal. There is a contradiction in that statement. Can you find it? -- PointedEars Twitter: @PointedEars2 Please d

Re: Testing random

2015-06-12 Thread Thomas 'PointedEars' Lahn
Ian Kelly wrote: > […] Thomas 'PointedEars' Lahn […] wrote: >> Ian Kelly wrote: >>> The probability of 123456789 and 1 are equal. The probability >>> of a sequence containing all nine numbers and a sequence containing >>> only 1s are *no

Re: Testing random

2015-06-16 Thread Thomas 'PointedEars' Lahn
Ned Batchelder wrote: > You aren't agreeing because you are arguing about different things. > Thomas is talking about the relative probability of sequences of digits. There is no such thing as “relative probability”, except perhaps in popular- scientific material and bad translations.

Re: Testing random

2015-06-16 Thread Thomas 'PointedEars' Lahn
Ned Batchelder wrote: > […] > This is done empirically, by producing `nseq` sequences of > `nrolls` rolls of the die. Each sequence is examined to > see if it has a zero. The total number of no-zero > sequences divided `nseq` is the probability. No, it is not. It is the relativ

Re: Testing random

2015-06-16 Thread Thomas 'PointedEars' Lahn
Ned Batchelder wrote: > On Tuesday, June 16, 2015 at 6:01:06 PM UTC-4, Thomas 'PointedEars' Lahn > wrote: >> Your programmatic "proof", as all the other intuitive-empirical "proofs", >> and all the other counter-arguments posted before in this thr

Re: Testing random

2015-06-17 Thread Thomas 'PointedEars' Lahn
MRAB wrote: > On 2015-06-17 00:45, Thomas 'PointedEars' Lahn wrote: >> Learn probability theory, and use a dictionary in Python when you want to >> count random hits. >> > I think that different people are talking about different things in > this thread. I

Re: How to check in script if Python or Jython is used

2015-06-21 Thread Thomas 'PointedEars' Lahn
Cecil Westerhof wrote: > I installed Jython and will start playing with it. There probably will > be differences between Python and Jython. Is there a way to determine > if a script is run by Python or Jython? Then different execution paths > could be taken. With sys.version(_info) you do not get

Re: scalar vs array and program control

2015-07-25 Thread Thomas 'PointedEars' Lahn
Laura Creighton wrote: > […] You really cannot make your code 'more functional' and 'more object- > oriented' at the same time -- more in one style implies less in the other. How did you get that idea? -- PointedEars Twitter: @PointedEars2 Please do not cc me. / Bitte keine Kopien per E-Mail.

Re: scalar vs array and program control

2015-07-25 Thread Thomas 'PointedEars' Lahn
Laura Creighton wrote: > […] "Thomas 'PointedEars' Lahn" [writes]: >> Laura Creighton wrote: >>> […] You really cannot make your code 'more functional' and 'more >>> object-oriented' at the same time -- more in one style implie

Re: scalar vs array and program control

2015-07-25 Thread Thomas 'PointedEars' Lahn
Thomas 'PointedEars' Lahn wrote: > # > class A: > def __init__ (self, v=0): > self._value = v > > def foo (self, f, b): > return f(f, self._value, b) I mean

Re: scalar vs array and program control

2015-07-26 Thread Thomas 'PointedEars' Lahn
Laura Creighton wrote: > […] "Thomas 'PointedEars' Lahn" writes: >> Laura Creighton wrote: >>> […] "Thomas 'PointedEars' Lahn" [writes]: >>>> Laura Creighton wrote: >>>>> […] You really cannot make your code &#x

Re: scalar vs array and program control

2015-07-26 Thread Thomas 'PointedEars' Lahn
Thomas 'PointedEars' Lahn wrote: > Laura Creighton wrote: >> and to create a class where none was before to make it more object- >> oriented. > > I did not need to, but, again, it was more obvious that way. I could also > have used an existing class, and

Re: Python launcher problem

2015-07-30 Thread Thomas 'PointedEars' Lahn
ElChino wrote: > If I in a cmd-shell (actually it is 4NT), do: >c:>py -3 -V & python3 -V > > I get: >Requested Python version (3) not installed << ! from py -3 -V >Python 3.5.0b2 << ! from the 2nd cmd. > > What nonsense is this? I DO HAVE Python3 in my %PATH. > A Registry setting

Re: How to rearrange array using Python?

2015-07-30 Thread Thomas 'PointedEars' Lahn
Mark Lawrence wrote: > On 30/07/2015 21:31, Martin Schöön wrote: >> I am just back from visiting my sisters and the younger of them >> was busy planning a youth orchestra summer camp. For some reason >> the kids are allowed to wish with whom they want to share rooms >> and my sister spent several

Convert between timezones (was: How to re-write this bash script in Python?)

2015-07-31 Thread Thomas 'PointedEars' Lahn
[X-Post & F'up2 comp.unix.shell] Chris Angelico wrote: > On Fri, Jul 31, 2015 at 6:15 PM, Cameron Simpson wrote: >> Actually, bash has no timezone support but the date command _does_, and >> probably neither better nor worse than Python. All one has to do is set >> the TZ environment variable, e

Re: Linux script to get most expensive processes

2015-08-05 Thread Thomas 'PointedEars' Lahn
Cecil Westerhof wrote: > Under Linux I like to get the most expensive processes. The two most > useful commands are: > ps -eo pid,user,pcpu,args --sort=-pcpu > and: > ps -eo pid,user,pcpu,args --sort=-vsize > > In my case I am only interested in the seven most expensive processes. > For t

Re: Uninstall

2015-08-05 Thread Thomas 'PointedEars' Lahn
Mark Lawrence wrote: > On 04/08/2015 19:31, [email protected] wrote: >> I really fucking hate how pedantic some of the people on this mailing >> list are. >> >> milos wasn't wrong. You just chose to take his message too literally. I >> thought it was pretty clear that when milos said "can't"

Re: Installation Successful, but pythonw and idle doesn't function

2015-08-05 Thread Thomas 'PointedEars' Lahn
Rick Smith wrote: > However pythonw.exe did not and does not work. I was simply returned to > the command prompt, without ANY interaction or error. > >prompt>pythonw > >prompt> Works as designed. You are proceeding from a false assumption. pythonw.exe is not meant to provide an inter

Re: Installation Successful, but pythonw and idle doesn't function

2015-08-05 Thread Thomas 'PointedEars' Lahn
Thomas 'PointedEars' Lahn wrote: > <http://stackoverflow.com/questions/9705982/pythonw-exe-or-python-exe> > > (First hit for “pythonw” on Google with my account. I have never visited > that site before or can remember to have searched for “pythonw”.) JFTR: s/site/qu

Re: Installation Successful, but pythonw and idle doesn't function

2015-08-06 Thread Thomas 'PointedEars' Lahn
Terry Reedy wrote: > On 8/5/2015 6:09 PM, Thomas 'PointedEars' Lahn wrote: >> Rick Smith wrote: >>> I also attempted to run "idle", with the following results: >>> >>> C: >> \Users\judy\AppData\Local\Programs\Python\Python

Re: Is Django the way to go for a newbie?

2015-08-09 Thread Thomas 'PointedEars' Lahn
Michael Torrie wrote: > Web development is very a very hard problem, largely because it involves > quite a few different domain-specific languages that you have to be > proficient in. I, professional Web developer, will not comment on that :) > It's not just a matter of Python and Django. You mu

Re: Is Django the way to go for a newbie?

2015-08-10 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > There's another thing you absolutely have to know when you do web > development, and that's i18n. This is why I don't recommend Node.js > for server-side work - because Python's Unicode support is better than > JS's. Your posting shows again that your knowledge of "JS" is

Re: Need Help w. PIP!

2015-09-05 Thread Thomas 'PointedEars' Lahn
Cody Piersall wrote: > Please respond to the list as well as the person you're actually talking > to. It works out better for everyone that way. (You should just have to > "reply all" instead of "reply"). “Better” as in “getting/reading/downloading the same message *twice*”? The rule of thumb

Re: failure in installing

2015-09-30 Thread Thomas 'PointedEars' Lahn
Sagar Joshi wrote: > hey, there is a failure installing python3.5.0 in my PC can u help -- PointedEars Twitter: @PointedEars2 Please do not cc me. / Bitte keine Kopien per E-Mail. -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about math.pi is mutable

2015-11-06 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Sat, Nov 7, 2015 at 6:30 AM, Bartc wrote: >> Is there no way then in Python to declare: >> >>pi = 3.141519 # etc >> >> and make it impossible to override? > > Nope. Even in C++, where classes can define certain things as const, > private, and other such restric

Re: Question about math.pi is mutable

2015-11-06 Thread Thomas 'PointedEars' Lahn
Bartc wrote: ^ Please fix. > On 06/11/2015 02:33, [email protected] wrote: >> As you can see in the attachment, why i can modify "math.pi"? >> (in "mathmodule.c" "pi" is a "static const double") > > Python isn't C. > > Your attachment isn't visible, but it can be demonstrated eas

Re: Question about math.pi is mutable

2015-11-06 Thread Thomas 'PointedEars' Lahn
Thomas 'PointedEars' Lahn wrote: > In theory, it should be possible to substitute “math” with a reference to > an object that acts as a proxy for the original “math” module object but > whose base class declares the attributes for all the constants read-only. #!/

Re: Question about math.pi is mutable

2015-11-12 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > […] Ben Finney […] wrote: >> I recommend you ignore that request; “Bartc” is fine as a name here, >> IMO. > > Given that LARTC means Linux Advanced Routing and Traffic Control, I'm > guessing Bartc is all about *BSD networking? :) I thought LART were the Luser Attitude Re

Re: pyinstaller and Python 3.5 on Windows?

2015-11-18 Thread Thomas 'PointedEars' Lahn
Ulli Horlacher wrote: > To run my Python programs on other Windows systems without a Python > installation I must create standalone Windows executables. > > pyinstaller runs without any problems with Python 2.7.10 on Windows 7, but > with Python 3.5 I get: > > [b0rked stack trace] > > Is there

Re: Create an index from a webpage

2011-09-08 Thread Thomas 'PointedEars' Lahn
Simon Cropper wrote: > I am after a way of pointing a python routine to my website and have it > create a tree, represented as a hierarchical HTML list in a webpage, of > all the pages in that website (recursive list of internal links to HTML > documents; ignore images, etc.). > > It is essential

Re: String performance regression from python 3.2 to 3.3

2013-03-13 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Wed, Mar 13, 2013 at 9:11 PM, rusi wrote: >> Uhhh.. >> Making the subject line useful for all readers > > I should have read this one before replying in the other thread. > > jmf, I'd like to see evidence that there has been a performance > regression compared against

Re: String performance regression from python 3.2 to 3.3

2013-03-15 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > Thomas 'PointedEars' Lahn […] wrote: >> Chris Angelico wrote: >>> jmf, I'd like to see evidence that there has been a performance >>> regression compared against a wide build of Python 3.2. You still have >>> never a

Re: String performance regression from python 3.2 to 3.3

2013-03-15 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Sat, Mar 16, 2013 at 1:44 PM, Thomas 'PointedEars' Lahn > wrote: >> Chris Angelico wrote: >>> The ECMAScript spec says that strings are stored and represented in >>> UTF-16. >> >> No, it does not (which Edition?). I

Re: problem with sys import argv

2013-03-26 Thread Thomas 'PointedEars' Lahn
Dave Angel wrote: > Since the script takes a mandatory argument, run it with one. > > python myscript.py Dave > > Better would be to change the script to check len(argv) for exactly 2, > and tell the user how he should have run it. I would use argparse.ArgumentParser instead.

Re: Question about start using ZServerSSL on win box...

2005-12-13 Thread Thomas G. Apostolou
After reading and searching for a while i found that all about running ZService as service start from C:\Program Files\Plone 2\Data\bin\zopeservice.py But still i cannot fully understand where the server is called so that i replace it with z2s.py or what ever needed... Any ideas? "Tho

Re: Xah's Edu Corner: Examples of Quality Technical Writing

2005-12-18 Thread Thomas G. Marshall
Lars Rune Nøstdal said something like: > hi, > everyone thinks youreoay faggot and that youreh stupid .. now go > fugkght yourselfes > > peasse out .. yo! Idiot. -- http://mail.python.org/mailman/listinfo/python-list

gdesklets __import__ problem

2006-01-03 Thread Thomas Dybdahl Ahle
Hi, I'm writing a gdesklets control, that dynamicly uses __import__ and getattr to get the right classes based on userinput. The problem is, that my control is somehow being run from somewhere unknown. This means that __import__ can't find the modules. I tried putting an os.chdir("~/.gdesklets/Cont

Getting module location

2006-01-04 Thread Thomas Dybdahl Ahle
Is it possible for an imported module to find its own location? -- Programmers should realize their critical importance and responsibility in a world gone digital. They are in many ways similar to the priests and monks of Europe's Dark Ages; they are the only ones with the training and insight to

Re: Getting module location

2006-01-05 Thread Thomas Dybdahl Ahle
Den Thu, 05 Jan 2006 14:53:40 +0800. skrev limodou: > 2006/1/5, Thomas Dybdahl Ahle <[EMAIL PROTECTED]>: >> Is it possible for an imported module to find its own location? > > you can access __file__(missing for built-in modules) or __path__(used > for a package) attr

Python daemon process

2006-08-26 Thread Thomas Dybdahl Ahle
stop gnuchess, as you are 100% sure, that it'll stop. Can you do this with popen? -- Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Python daemon process

2006-08-29 Thread Thomas Dybdahl Ahle
nly run when the parrentprocess is still running. I know this is called a daemon thread in java. > 2006/8/26, Thomas Dybdahl Ahle <[EMAIL PROTECTED]>: >> Hi, I'm writing a program, using popen4(gnuchess), >> The problem is, that gnuchess keeps running after program exit.

[no subject]

2006-01-31 Thread Thomas McGrath III
nd type 'python' and still get the error. - not good. However if I execute the python.exe as found in the download folder I get python in a command line looking window. But not at the regular c prompt. If I drag the python.exe to the command line C:\DOCUME~1\THOMAS~1> it then g

Re: do design patterns still apply with Python?

2006-03-02 Thread Thomas G. Willis
get the message that patterns apply a lot differently in python as compared to the {...;} languages. Details here.http://mindview.net/Books/Python/ThinkingInPython.html-- Thomas G. Willis--- http://i-see-sound.comhttp://tomwillis.sonicdiscord.comAmerica, still more rights than North Korea -- http://mail.python.org/mailman/listinfo/python-list

Re: What are OOP's Jargons and Complexities?

2005-05-23 Thread Thomas G. Marshall
Paul McGuire coughed up: > Is this supposed to be some sort of wake-up call or call-to-arms to > all the CS lemmings who have been hoodwinked by Sun into the realm of > jargon over substance? ...[rip]... > You certainly seem to have a lot of energy and enthusiasm for these > topics. It would be

<    30   31   32   33   34   35   36   37   38   39   >