jlada...@itu.edu wrote:
> On Friday, September 28, 2018 at 11:03:17 AM UTC-7, Chris Green wrote:
>> I have a list created by:-
>>
>> fld = shlex.split(ln)
>>
>> It may contain 3, 4 or 5 entries according to data read into ln.
>> What's the neatest way of setting the fourth and fifth entries
Thanks all, several possible ways of doing it there.
--
Chris Green
ยท
--
https://mail.python.org/mailman/listinfo/python-list
Cameron Simpson wrote:
> On 28Sep2018 20:12, Chris Green wrote:
> >Peter Pearson wrote:
> >> On Fri, 28 Sep 2018 15:01:41 +0100, Chris Green wrote:
> >> > Chris Green wrote:
> >> >> Brian Oney wrote:
> >> >> > Could you please try another tool like `convert'? E.g.
> >> >> >
> >> >> > $ conver
Ben Finney writes:
> You can use a comprehension, iterating over the full range of index you
> want::
>
> words = shlex.split(line)
> padding_length = 5
> words_padded = [
> (words[index] if index < len(words))
> for index in range(padding_length)]
That omits the impo
Ben Finney wrote:
> Ben Finney writes:
>
>> You can use a comprehension, iterating over the full range of index you
>> want::
>>
>> words = shlex.split(line)
>> padding_length = 5
>> words_padded = [
>> (words[index] if index < len(words))
>> for index in range(paddin
Did you actually confirm the PATH variable contains the right path?
echo $env:Path
And look for a path entry that mentions Python. Then, make sure you can
actually find python.exe in that location.
As long as you keep the PATH option checked with the Python installer it
absolutely should wor
On 9/28/18 2:00 PM, Chris Green wrote:
I have a list created by:-
fld = shlex.split(ln)
It may contain 3, 4 or 5 entries according to data read into ln.
What's the neatest way of setting the fourth and fifth entries to an
empty string if they don't (yet) exist? Using 'if len(fld) < 4:' fee
On Fri, 28 Sep 2018 19:00:29 +0100, Chris Green wrote:
> I have a list created by:-
>
> fld = shlex.split(ln)
>
> It may contain 3, 4 or 5 entries according to data read into ln. What's
> the neatest way of setting the fourth and fifth entries to an empty
> string if they don't (yet) exist?
On Sat, Sep 29, 2018 at 12:21 PM Chris Green wrote:
>
> I have a list created by:-
>
> fld = shlex.split(ln)
>
> It may contain 3, 4 or 5 entries according to data read into ln.
> What's the neatest way of setting the fourth and fifth entries to an
> empty string if they don't (yet) exist? Usi
fld = [ ]
data = shlex.split(ln)
for item in data:
fld.append(item)
fld = fld + [0] * (5 - len(data))
On Sat, 29 Sep 2018 at 11:03, Glen D souza wrote:
> i have a approach, it may not be best
>
> fld = [ ]
> for data in shlex.split(ln):
>fld.append(data)
>
>
>
> On Sat, 29 Sep 20
i have a approach, it may not be best
fld = [ ]
for data in shlex.split(ln):
fld.append(data)
On Sat, 29 Sep 2018 at 07:52, wrote:
> On Friday, September 28, 2018 at 11:03:17 AM UTC-7, Chris Green wrote:
> > I have a list created by:-
> >
> > fld = shlex.split(ln)
> >
> > It may co
11 matches
Mail list logo