Rivka Miller rivkaumil...@gmail.com writes:
On Oct 25, 2:27 pm, Danny dann90...@gmail.com wrote:
Why you just don't give us the string/input, say a line or two, and
what you want off of it, so we can tell better what to suggest
no one has really helped yet.
Really? I was going to reply but
Rivka Miller rivkaumil...@gmail.com writes:
Thanks everyone, esp this gentleman.
Kind of you to single me out, but it was Janis Papanagnou who first
posted the solution that you say works best for you.
snip
--
Ben.
--
http://mail.python.org/mailman/listinfo/python-list
E.D.G. edgrs...@ix.netcom.com writes:
E.D.G. edgrs...@ix.netcom.com wrote in message
news:jckdnqiu1zxguxvpnz2dnuvz_qmdn...@earthlink.com...
E.D.G. edgrs...@ix.netcom.com wrote in message
news:ro-dnch2dptbrhnpnz2dnuvz_rsdn...@earthlink.com...
Etgtab FORTRAN project
Perl speed comparison
subhabrata.bane...@gmail.com writes:
I am trying to read a list of files as
list_of_files = glob.glob('C:\Python27\*.*')
Now I am trying to read each one of them,
convert into list of words, and append to a list
as.
list1=[]
for file in list_of_files:
print file
Dr. John Q. Hacker zonderv...@gmail.com writes:
I'm thinking how interesting it would be to add code blocks to Python,
so that arbitrary strings of code can be passed around. It would open
up some interesting possibilities for self-modifying code and generic
programming.
Since Python has
Cecil Westerhof ce...@decebal.nl writes:
I have a file where I used a lot of {0}, {1} and {2}. Most but not all
are changed to {0:.3E}, {1:.3E} and {2:.3E}. But when I want to change
the format I come in dependency hell.
I could do something like:
format = ':.3E'
fmt0 = '{0' +
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes:
On Fri, 17 Apr 2015 07:15 am, Seymore4Head wrote:
I am guessing that a few here might find this program interesting.
http://video.pbs.org/video/2365464997/
For the sake of those of us with limited access to the Internet at the
Ian Kelly ian.g.ke...@gmail.com writes:
On Tue, Apr 7, 2015 at 12:55 PM, Terry Reedy tjre...@udel.edu wrote:
On 4/7/2015 1:44 PM, Ian Kelly wrote:
def to_base(number, base):
... digits = []
... while number 0:
... digits.append(number % base)
... number //= base
Chris Angelico ros...@gmail.com writes:
On Fri, Apr 10, 2015 at 4:46 AM, Ben Finney ben+pyt...@benfinney.id.au
wrote:
Travis Griggs travisgri...@gmail.com writes:
Here’s 3 examples:
if k + ‘_@‘ in documents:
timeKey = k + ‘_@‘
historyKey = thingID + ‘_’ + k
In addition
Laura Creighton l...@openend.se writes:
In a message of Mon, 01 Jun 2015 19:45:31 +1000, Chris Angelico writes:
On Mon, Jun 1, 2015 at 5:58 PM, Laura Creighton l...@openend.se wrote:
If you are giving a talk about Decimal -- and trying to stamp out the
inappropriate use of floats you have to
MRAB pyt...@mrabarnett.plus.com writes:
On 2015-08-18 22:55, Ben Bacarisse wrote:
Neal Becker ndbeck...@gmail.com writes:
Trying regex 2015.07.19
I'd like to match recursive parenthesized expressions, with groups such that
'(a(b)c)'
would give
group(0) - '(a(b)c)'
group(1) - '(b
Neal Becker ndbeck...@gmail.com writes:
Trying regex 2015.07.19
I'd like to match recursive parenthesized expressions, with groups such that
'(a(b)c)'
would give
group(0) - '(a(b)c)'
group(1) - '(b)'
but that's not what I get
import regex
#r = r'\((?[^()]|(?R))*\)'
r =
Ian Kelly ian.g.ke...@gmail.com writes:
On Mon, Jun 29, 2015 at 4:56 PM, Ian Kelly ian.g.ke...@gmail.com wrote:
On Mon, Jun 29, 2015 at 4:39 PM, jonas.thornv...@gmail.com wrote:
http://jt.node365.se/baseconversion8.html
snip
By the way, I think you have a bug. I did my time testing by
Christian Gollwitzer aurio...@gmx.de writes:
On 21.07.2015 04:55, Chris Angelico wrote:
On Tue, Jul 21, 2015 at 12:49 PM, ryguy7272 ryanshu...@gmail.com wrote:
[...] Every time I paste in any kind of code, it seems
like everything is immediately left-justified, and then nothing
works.
snip
Robert writes:
> I find below code snippet on line:
>
> //
> m = 10
> theta_A = 0.8
> theta_B = 0.3
> theta_0 = [theta_A, theta_B]
>
> coin_A = bernoulli(theta_A)
> coin_B = bernoulli(theta_B)
>
> xs = map(sum, [coin_A.rvs(m), coin_A.rvs(m), coin_B.rvs(m),
>
Rustom Mody writes:
> Kernghan/Thomson/Ritchie (dont remember which) actually admitted to the
> fact that these precedences are wrong
> The mistake that C creators made was to treat bitwise operators as
> *logical* rather than as *arithmetic*
It was more that they did
Ian Kelly writes:
> On Tue, May 31, 2016 at 8:22 AM, Fillmore wrote:
>>
>> My problem. I have lists of substrings associated to values:
>>
>> ['a','b','c','g'] => 1
>> ['a','b','c','h'] => 1
>> ['a','b','c','i'] => 1
>> ['a','b','c','j'] => 1
Steven D'Aprano writes:
> On Wed, 22 Jun 2016 04:01 am, Pierre-Alain Dorange wrote:
>> I do not know under what circumstance atan2 can return NAN, atan2 taks 2
>> argument (y and x) and return the angle corresponding to y/x.
>> If x is 0.0, atan2 return 0.0 (do not try to
Steven D'Aprano <st...@pearwood.info> writes:
> On Thu, 23 Jun 2016 05:17 am, Ben Bacarisse wrote:
>
>> pdora...@pas-de-pub-merci.mac.com (Pierre-Alain Dorange) writes:
>>
>>> Ben Bacarisse <ben.use...@bsb.me.uk> wrote:
>>>
>>>> >
Steven D'Aprano writes:
> On Thursday 23 June 2016 14:40, Dan Sommers wrote:
>
>>> Since x == y, the answer should be the same as for any other pair of x == y.
>>
>> When x == y == 0, then atan2(y, x) is 0.
I see just added noise by making the same comment
pdora...@pas-de-pub-merci.mac.com (Pierre-Alain Dorange) writes:
> Ben Bacarisse <ben.use...@bsb.me.uk> wrote:
>
>> >>> math.atan2(INF, INF)
>> 0.7853981633974483
>>
>> I would have expected NaN since atan2(INF, INF) could be thought of as
>>
alister <alister.w...@ntlworld.com> writes:
> On Thu, 23 Jun 2016 15:39:43 +0100, Ben Bacarisse wrote:
>
>> Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> writes:
>>
>>> On Thursday 23 June 2016 14:40, Dan Sommers wrote:
>>>
>>>
Marko Rauhamaa writes:
> Ben Finney :
>
>> As for how solved it is, that depends on what you're hoping for as a
>> solution.
>>
>> [...]
>>
>> Hopefully your operating system has a good input method system, with
>> many input methods available to
Marko Rauhamaa writes:
> "Charles T. Smith" :
>
>> Actually, I saw a study some years ago that concluded that python
>> could be both slower and faster than perl, but that perl had much less
>> deviation than python. I took that and accepted it, but
alister writes:
>
> the design of qwerty was not to "Slow" the typist bu to ensure that the
> hammers for letters commonly used together are spaced widely apart,
> reducing the portion of trier travel arc were the could jam.
> I and E are actually such a pair which
Ben Bacarisse <ben.use...@bsb.me.uk> writes:
> alister <alister.w...@ntlworld.com> writes:
>
>>
>> the design of qwerty was not to "Slow" the typist bu to ensure that the
>> hammers for letters commonly used together are spaced widely apart,
&g
Rustom Mody <rustompm...@gmail.com> writes:
> On Saturday, April 9, 2016 at 7:14:05 PM UTC+5:30, Ben Bacarisse wrote:
>> The problem with that theory is that 'er/re' (this is e and r in either
>> order) is the 3rd most common pair in English but have been placed
>> toge
Ian Kelly <ian.g.ke...@gmail.com> writes:
> On Mon, Mar 21, 2016 at 2:03 PM, Ben Bacarisse <ben.use...@bsb.me.uk> wrote:
>> For experts here: why can't I write a lambda that has a statement in it
>> (actually I wanted two: lambda l, i: l[i] += 1; return l)?
>
&
Rustom Mody writes:
> On Sunday, March 20, 2016 at 10:32:07 AM UTC+5:30, Steven D'Aprano wrote:
>> Unicode (the character set part of it) is a set of abstract 23-bit numbers,
>
> 23? Or 21?
It's 21. The reason being (or at least part of the reason being) that
21 bits
Maurice writes:
> Hello, hope everything is okay. I think someone might have dealt with
> a similar issue I'm having.
>
> Basically I wanna do the following:
>
> I have a list such [6,19,19,21,21,21] (FYI this is the item of a
>certain key in the dictionary)
>
>
Cousin Stanley writes:
>
>> Occasionally I have to make forays into Javascript,
>> can anyone recommend a place similar to this list
>> where Javascript questions can be asked ?
>
>
> Several years back I found
> the newsgroup comp.lang.javascript
> to
Steven D'Aprano writes:
> On Sun, 27 Mar 2016 05:13 pm, Paul Rubin wrote:
>
>> Steven D'Aprano writes:
>>> For example, would you consider that this isolated C code is
>>> "meaningless"?
>>> int i = n + 1;
>>
>> It's meaningful as long as n is in a
Richard Riehle writes:
> Several months ago, I posted a question regarding how to create a list
> of functions.
> I realize that this seems trivial to many experience Pythonistas. But
> it might prove useful for those who are relative newcomers to the
> language. In any case,
Steven D'Aprano <st...@pearwood.info> writes:
> On Mon, 28 Mar 2016 06:51 pm, Jussi Piitulainen wrote:
>
>> Ben Bacarisse writes:
>>
>>> It's shame that anonymous functions (for that's what's being returned
>>> here -- a function with no name) were born
Dennis Lee Bieber writes:
> On Tue, 29 Mar 2016 20:14:02 -0700 (PDT), Rustom Mody
> declaimed the following:
>
>
>>Pascal ? C ? Python is a slide down because
>>Pascal had the clear distinction of procedure and function
>
> That goes back to
BartC writes:
> On 28/03/2016 01:54, Steven D'Aprano wrote:
>> What should be the return value of this statement?
>>
>> while True:
>> x += 1
>> if condition: break
>
> Many statements such as loops just returned 'void' in A68. The
> interesting statements were if,
Ian Kelly writes:
> On Mon, May 23, 2016 at 2:09 AM, Steven D'Aprano
> wrote:
>> Are you saying that the Egyptians, Babylonians and Greeks didn't know how to
>> work with fractions?
>>
>>
Chris Angelico <ros...@gmail.com> writes:
> On Tue, May 24, 2016 at 12:29 AM, Ben Bacarisse <ben.use...@bsb.me.uk> wrote:
>> Right, but this is to miss the point. Let's say that 4000 years have
>> defined 1/3 to be one third, but Python 3 (as do many programmin
Mark Dickinson <mdickin...@enthought.com> writes:
> Ben Bacarisse bsb.me.uk> writes:
>> [1] Not being a Python expert I don't know how you show that actual
>> value of a float. What is the Pythonic way to do that?
>
> I don't know about Pythonic, but here ar
Steven D'Aprano <st...@pearwood.info> writes:
> On Tue, 24 May 2016 12:29 am, Ben Bacarisse wrote:
>
>> Ian Kelly <ian.g.ke...@gmail.com> writes:
>>
>>> On Mon, May 23, 2016 at 2:09 AM, Steven D'Aprano
>>> <steve+comp.lang.pyt...@pearwood.
Chris Angelico <ros...@gmail.com> writes:
> On Tue, May 24, 2016 at 2:51 AM, Ben Bacarisse <ben.use...@bsb.me.uk> wrote:
>> Chris Angelico <ros...@gmail.com> writes:
>>
>>> On Tue, May 24, 2016 at 12:29 AM, Ben Bacarisse <ben.use...@bsb.me.uk>
>
Jon Ribbens writes:
> No, in Python integers are closed under the standard arithmetic
> operators (+ - * / % **) - except, since Python 3, for "/", which
> is now a special case.
2 ** -1 is 0.5 even in Python 2[*].
I agree with your general point (that floats
DFS writes:
> Have:
> '584323 Fri 13 May 2016 17:37:01 - (UTC) 584324 Fri 13 May 2016
> 13:44:40 -0400 584325 13 May 2016 17:45:25 GMT 584326 Fri 13 May 2016
> 13:47:28 -0400'
>
> Want:
> [('584323', 'Fri 13 May 2016 17:37:01 - (UTC)'),
> ('584324', 'Fri 13 May 2016
Jussi Piitulainen writes:
> Cai Gengyang writes:
>
>> I am trying to understand the boolean operator "and" in Python. It is
>> supposed to return "True" when the expression on both sides of "and"
>> are true
>>
>> For instance,
>>
>> 1 < 3 and 10 < 20 is True ---
zljubi...@gmail.com writes:
> in python3 my variable looks like this:
>
> a = b'{"uuid":"5730e8666ffa02.34177329","error":""}'
> str(a) = 'b\'{"uuid":"5730e8666ffa02.34177329","error":""}\''
>
> If I execute the following command I get the error:
>
json.loads(str(a))
> Traceback (most recent
Oscar Benjamin <oscar.j.benja...@gmail.com> writes:
> On 15 April 2016 at 11:10, Ben Bacarisse <ben.use...@bsb.me.uk> wrote:
>> Oscar Benjamin <oscar.j.benja...@gmail.com> writes:
>>
>>> On 15 April 2016 at 10:24, Robin Becker <ro...@reportlab.com&
Dennis Lee Bieber writes:
> I still miss the Amiga -- in which one could /push/ a window to the
> back of the stack while still retaining input focus! Made it nice for
> transcribing stuff from a visible window to a text input region while it
> was obscured.
That
Chris Angelico <ros...@gmail.com> writes:
> On Sun, Apr 17, 2016 at 9:25 AM, Ben Bacarisse <ben.use...@bsb.me.uk> wrote:
>> Dennis Lee Bieber <wlfr...@ix.netcom.com> writes:
>>
>>> I still miss the Amiga -- in which one could /push/ a windo
Oscar Benjamin writes:
> On 15 April 2016 at 10:24, Robin Becker wrote:
>> yes indeed summation is hard :(
>
> Not with Fraction it isn't:
>
> from fractions import Fraction
>
> def exact_sum(nums):
> return sum(map(Fraction, nums))
>
> This
Chris Kaynor <ckay...@zindagigames.com> writes:
> On Thu, Jul 21, 2016 at 4:54 PM, Ben Bacarisse <ben.use...@bsb.me.uk> wrote:
>
>> Steven D'Aprano <st...@pearwood.info> writes:
>>
>> > Or you might be using a language like Javascript, which intention
Steven D'Aprano writes:
> Or you might be using a language like Javascript, which intentionally has
> only floats for numbers. That's okay, you can still perform exact integer
> arithmetic, so long as you stay within the bounds of ±2**16.
Small point: it's 2**52.
--
Ben.
Rustom Mody writes:
> For a long time the re → dfa transformation went and was taught the laborious
> route:
> re → nfa-with-ε-transitions → nfa-without-ε-transitions → dfa
>
> https://en.wikipedia.org/wiki/Thompson's_construction
>
TUA writes:
> Calls to my REST api may either return a dict (for single results) or
> a list of dicts (for multiple results).
I think John's answer missed this part.
> I receive these results using the requests library.
>
> I want to retrieve the value for a key 'ID' but
Ben Finney writes:
> Ethan Furman writes:
>
>> I will readily admit to not having a maths degree, and so of course to
>> me saying the integer 123 has a precision of 5, 10, or 99 digits seems
>> like hogwash to me.
>
> Precision is not a property
dieter writes:
>> Lawrence D’Oliveiro wrote:
>>> I don’t know why this fear and suspicion of lambdas is so widespread among
>>> Python users ... former Java/C# programmers, perhaps?
By replying I'm not accepting the premise -- I have no idea if there is
widespread fear and
Jussi Piitulainen writes:
> BartC writes:
>
>> On 17/08/2016 07:39, Steven D'Aprano wrote:
>>> Rather than ask why Python uses `trueval if cond else falseval`, you
>>> should ask why C uses `cond ? trueval : falseval`. Is that documented
>>> anywhere?
>>
>> I'm not
MRAB writes:
> On 2016-08-17 18:19, Jussi Piitulainen wrote:
>> MRAB writes:
>>
>>> On 2016-08-17 12:24, Jussi Piitulainen wrote:
BartC writes:
> On 17/08/2016 07:39, Steven D'Aprano wrote:
>> Rather than ask why Python uses `trueval if cond else
Chris Angelico writes:
> ... I teach JavaScript as well as Python, and I've seen some
> pretty horrendous indentation flaws (examples available if people ask
> privately, but I will anonymize them because I'm not here to shame
> students) - but there have been nearly as many
Chris Angelico <ros...@gmail.com> writes:
> On Wed, Jan 25, 2017 at 2:51 AM, Ben Bacarisse <ben.use...@bsb.me.uk> wrote:
>> Chris Angelico <ros...@gmail.com> writes:
>>
>>> ... I teach JavaScript as well as Python, and I've seen some
>>> pret
Chris Angelico <ros...@gmail.com> writes:
> On Wed, Jan 25, 2017 at 3:21 AM, Ben Bacarisse <ben.use...@bsb.me.uk> wrote:
>> Chris Angelico <ros...@gmail.com> writes:
>>
>>> On Wed, Jan 25, 2017 at 2:51 AM, Ben Bacarisse <ben.use...@bsb.me.uk> wrot
BartC <b...@freeuk.com> writes:
> On 24/01/2017 15:51, Ben Bacarisse wrote:
>> Chris Angelico <ros...@gmail.com> writes:
>>
>>> ... I teach JavaScript as well as Python, and I've seen some
>>> pretty horrendous indentation flaws (examples
Steve D'Aprano <steve+pyt...@pearwood.info> writes:
> On Wed, 25 Jan 2017 03:21 am, Ben Bacarisse wrote:
>
>> Chris Angelico <ros...@gmail.com> writes:
>>
>>> On Wed, Jan 25, 2017 at 2:51 AM, Ben Bacarisse <ben.use...@bsb.me.uk>
>>> wrote:
&g
"Deborah Swanson" writes:
>> -Original Message-
>> From: Erik [mailto:pyt...@lucidity.plus.com]
>> Sent: Thursday, February 23, 2017 2:09 AM
>> To: pyt...@deborahswanson.net; python-list@python.org
>> Subject: Re: Namedtuples problem
>>
>>
>> Hi,
>>
>> On
spiess.benja...@googlemail.com writes:
> I've got a problem which I would really like to solve.
> I got a cloud of points (in the simplest example its a 2-dimensional
> cloud of points).
> First, I want to set one of the points as the initial (or middle)
> point. Starting from there, the next
Tim Chase writes:
> On 2016-08-21 04:53, Rustom Mody wrote:
>> 2. Basic computing theory shows that re-s and dfas are equivalent.
>> Which would one prefer to write/debug? [Thats not a rhetorical
>> question]
>
> I'm curious where REs and DFAs are shown to be
Gregory Ewing writes:
> Steve D'Aprano wrote:
>
>> And (shamelessly using Python syntax) if I have a function:
>>
>> def spam(x):
>> print(x)
>> print(x+1)
>>
>> spam(time.sleep(60) or 1)
>
> You can't write that in Haskell, because Haskell's
> equivalent of
BartC <b...@freeuk.com> writes:
> On 05/10/2016 11:03, Ben Bacarisse wrote:
>> Gregory Ewing <greg.ew...@canterbury.ac.nz> writes:
>>
>>> Steve D'Aprano wrote:
>>>
>>>> And (shamelessly using Python syntax) if I have a function:
&g
Steve D'Aprano <steve+pyt...@pearwood.info> writes:
> On Tue, 4 Oct 2016 11:27 pm, Ben Bacarisse wrote:
>
>> Haskell defines let (it's version of multiple mutually recursive
>> bindings) in terms of the least fix point of a lambda function whose
>> (pattern) p
Marko Rauhamaa writes:
> dieter :
>> The concept "assignment" comes from an operational semantics based on
>> some form of "RAM" machine. Such a machine has storage cells where you
>> can assign values to which remain there until overridden with a new
>>
Cai Gengyang writes:
> I'm moving on to chapter 9
> (http://programarcadegames.com/index.php?lang=en=lab_functions)
> of programarcadegames for the time being and going back to chapter 8
> later (its just fucking frustrating and doesn't seem to work for the
> time being
Steve D'Aprano writes:
> On Mon, 29 Aug 2016 10:31 pm, Chris Angelico wrote:
>
>> On Mon, Aug 29, 2016 at 10:13 PM, BartC wrote:
>>> In C, you can write this:
>>>
>>> int x;
>>>
>>> x = 5;
>>> x = "hello";
>>>
>>> With certain compilers (eg. gcc)
Steve D'Aprano writes:
> On Sun, 6 Nov 2016 04:10 am, Mr. Wrobel wrote:
>
>> Hi,
>>
>> Some skeptics asked my why there is a reason to use Python against of
>> any other "not interpreted" languages, like objective-C.
>
> Here's the "Hello World" program in Python:
>
Steve D'Aprano <steve+pyt...@pearwood.info> writes:
> On Sun, 6 Nov 2016 08:17 am, Ben Bacarisse wrote:
>
>> Steve D'Aprano <steve+pyt...@pearwood.info> writes:
>
>>> Here's the same program in Objective C:
>>>
>>> --- cut ---
>>
"Mr. Wrobel" writes:
> ... However the most important is second part of my question.
>
> What do you think about using GPU processing or pypy?
Sorry, I don't have enough experience of them to offer any useful advice.
--
Ben.
--
guy asor writes:
> this is my code:
>
> word=raw_input()
> print word*3
>
>
> with this code im getting - wordwordword.
> what changes i need to make to get - word word word - instead?
Two hints:
What does ['a']*3 give you?
What about '/'.join(['a', 'b', 'c'])?
Can you
Nune9 writes:
> I have a list is
>
> land = [10,20,30,40,110,50,18,32,5]
>
> and I want to find each values of summation (don't sorted values in
> list) as It has highest possible
>
> example.
>
> I want to dividing N=3 part from list as above and divieded each part
> has
BartC writes:
> [...] But remember:
>
> cp *.c
>
> There might be some irate users out there if it can't detect a simple
> user error like that.
There might be. They are ill-served by current Unix shells. But,
oddly, the flow has gone the other way. People have wanted Unix
BartC <b...@freeuk.com> writes:
> On 07/12/2016 15:25, Ben Bacarisse wrote:
>> BartC <b...@freeuk.com> writes:
>>
>>> [...] But remember:
>>>
>>> cp *.c
>>>
>>> There might be some irate users out there if it can't detec
Steven D'Aprano writes:
> Suppose you have an expensive calculation that gets used two or more times in
> a
> loop. The obvious way to avoid calculating it twice in an ordinary loop is
> with
> a temporary variable:
>
> result = []
> for x in data:
>
BartC writes:
> On 18/12/2016 10:59, Paul Götze wrote:
>> there is a nice short article by E. W. Dijkstra about why it makes sense
>> to start numbering at zero (and exclude the upper given bound) while
>> slicing a list. Might give a bit of additional understanding.
>>
>>
Jussi Piitulainen <jussi.piitulai...@helsinki.fi> writes:
> Ben Bacarisse writes:
>
>> BartC writes:
>>
>>> You need to take your C hat off, I think.
>>
>> It's a computing hat. Indexes are best seen as offsets (i.e. as a
>> measured distances
"Frank Millman" writes:
> ... Here are my thoughts on improving this.
>
> 1. Generate a 'salt' for each password. There seem to be two ways in
> the standard library to do this -
>import os
>salt = os.urandom(16)
>
>import secrets
>salt =
BartC <b...@freeuk.com> writes:
> On 19/12/2016 01:10, Ben Bacarisse wrote:
>> BartC <b...@freeuk.com> writes:
>>
>>> On 18/12/2016 10:59, Paul Götze wrote:
>>>> there is a nice short article by E. W. Dijkstra about why it makes sense
>>>
Steve D'Aprano writes:
> On Wed, 12 Apr 2017 03:39 am, Paul Rubin wrote:
>
>> I still do my everyday stuff in Python and I'd like to get more
>> conversant with stuff like numpy, but it feels like an old-fashioned
>> language these days.
>
> "Old fashioned"? With
James McMahon writes:
> Hello. Am a Python newbie. I have researched and found examples how we can
> check existence, readability, and write-ability on a given fully-qualified
> filename for the current python script user. Evidently os.access is the way
> to go, wrapped in
bartc writes:
> 'do', in the original Algol 68 syntax, was part of its 'for'
> statement, where you could leave out the parts you don't need. The
> full syntax is something like:
>
> for var := a to b by c while d do body od
FOR name FROM e1 BY e2 TO e3 WHILE cond DO body
Steve D'Aprano writes:
> I don't remember the language, but I remember seeing one generalisation of
> the repeat/do loop that puts the test in the middle, rather than at the
> start or end of the loop. If I remember it was something like:
>
> DO
> setup code #
Marko Rauhamaa writes:
> Terry Reedy :
>
>> On 4/17/2017 3:11 AM, Marko Rauhamaa wrote:
>>> Here's statistics from a medium-sized project of mine:
>>>
>>>while True:34
>>>while : 39
>>>for ... in ...: 158
>>
>> As I posted
Marko Rauhamaa <ma...@pacujo.net> writes:
> Ben Bacarisse <ben.use...@bsb.me.uk>:
>
>> Marko Rauhamaa <ma...@pacujo.net> writes:
>>> What I notice in my numbers is that about one half of my while loops
>>> are "while True", and
Paul Rubin <no.email@nospam.invalid> writes:
> Ben Bacarisse <ben.use...@bsb.me.uk> writes:
>> c = sys.stdin.read(1)
>> while c == ' ':
>> c = sys.stdin.read(1)
(for the record: I was not suggesting this was how you'd do it but how
you'd be forced
r...@zedat.fu-berlin.de (Stefan Ram) writes:
> I wrote my first Python quiz question!
>
> It goes like this:
>
> Can you predict (without trying it out) what the Python
> console will output after the following three lines have
> been entered?
>
> def f(i): print(i); return i;
>
>
Steve D'Aprano writes:
> Every few years, the following syntax comes up for discussion, with some
> people
> saying it isn't obvious what it would do, and others disagreeing and saying
> that it is obvious. So I thought I'd do an informal survey.
>
> What would you
Steve D'Aprano <steve+pyt...@pearwood.info> writes:
> On Wed, 16 Aug 2017 11:38 pm, Ben Bacarisse wrote:
>
>> r...@zedat.fu-berlin.de (Stefan Ram) writes:
>>
>>> I wrote my first Python quiz question!
>>>
>>> It goes like this:
>
Xristos Xristoou writes:
> i have create an image processing python function.
>
> my system have 4 cores + 4 threads.
>
> i want to use multiprocessing to speed up my function,but anytime to
> use multiprocessing packages my function is not faster and is 1 minute
> slowly. any
r...@zedat.fu-berlin.de (Stefan Ram) writes:
> Ben Bacarisse <ben.use...@bsb.me.uk> writes:
>>Steve D'Aprano <steve+pyt...@pearwood.info> writes:
>>>"Java is call by value, dammit!"
>>I don't think this is a fair point. You will run out of ideas i
John Nagle writes:
> I'm cleaning up some data which has text description fields from
> multiple sources. Some are are in UTF-8. Some are in WINDOWS-1252.
> And some are in some other character set. So I have to examine and
> sanity check each field in a database dump,
Steve D'Aprano writes:
> On Thu, 17 Aug 2017 10:14 am, Ned Batchelder wrote:
>> For some reason, students have been taught that things can be either
>> call-by-reference or call-by-value. But those are not the only two
>> possibilities, and neither completely
Steve D'Aprano <steve+pyt...@pearwood.info> writes:
> On Thu, 17 Aug 2017 11:37 pm, Ben Bacarisse wrote:
>
>> What goes wrong when someone thinks of Python as passing by value but
>> the value of an expression is an object reference?
This seems to be a hot-button topic so
BT writes:
> I am fairly new to programming. I was just trying to understand how
> this group works. Am i allowed to ask any questions that I may have
> when i get stuck? I mean is this group for new programmers as well..?
Welcome. Yes, it's for pretty much any questions
Bhaskar Dhariyal writes:
> I am doing a project on data science. I need to convert sentences to
> vectorial form.
That's not a term I am familiar with. If it's standard, that's my
fault, but you can still help people like me by explaining what you
mean. And if it is
1 - 100 of 265 matches
Mail list logo