On 04Oct2020 02:56, pascal z wrote:
>On Thursday, September 24, 2020 at 4:37:07 PM UTC+2, Terry Reedy wrote:
>> Read
>> https://docs.python.org/3/faq/programming.html#what-is-the-most-efficient-way-to-concatenate-many-strings-together
>
>Thanks for this tip. I do think it's better to use lists tha
On Thursday, September 24, 2020 at 4:37:07 PM UTC+2, Terry Reedy wrote:
> On 9/23/2020 7:24 PM, pascal z via Python-list wrote:
> > Please advise if the following is ok (i don't think it is)
> >
> > #!/usr/bin/env python3
> > # -*- coding: utf-8 -*-
> >
> > import os
> >
> > csv_contents = ""
>
On 9/23/2020 7:24 PM, pascal z via Python-list wrote:
Please advise if the following is ok (i don't think it is)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
csv_contents = ""
output_file = '/home/user/Documents/csv/output3csv.csv'
Lpath = '/home/user/Documents/'
csv_contents = "F
ok, i came up with
if os.path.isfile(path)
following
path = os.path.join(Lpath, f)
and it seems to be ok, no dupplicates or wrong sizes...
thanks
--
https://mail.python.org/mailman/listinfo/python-list
Please advise if the following is ok (i don't think it is)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
csv_contents = ""
output_file = '/home/user/Documents/csv/output3csv.csv'
Lpath = '/home/user/Documents/'
csv_contents = "FOLDER PATH;Size in Byte;Size in Kb;Size in Mb;Size in Gb
On 23Sep2020 13:24, pascal z wrote:
>Hello, I'm working on a script where I want to loop into folders somehow
>recursively to get information but I want to limit the infos for the files on
>a certain level of folders for example:
>
>/home/user/Documents/folder1
>/home/user/Documents/folder2
>/ho
Hello, I'm working on a script where I want to loop into folders somehow
recursively to get information but I want to limit the infos for the files on a
certain level of folders for example:
/home/user/Documents/folder1
/home/user/Documents/folder2
/home/user/Documents/folder3/folder1/file1
/hom
On 12/10/2013 12:03 PM, Asemaneh Allame wrote:
thanks for your attention
my mean is obvios
i cont get any graph of vpython
I am fairly expert with python but know almost nothing about vpython. I
have no idea what 'graph of python' or 'graph of vpython' means. I
suggest that you find a vpytho
On 10.12.2013 18:03, Asemaneh Allame wrote:
my mean is obvios
i cont get any graph of vpython
it shows me a maseage in this form:
" pythonw.exe has stopped working"
i m sure that have a good & perfect install and i dont khnow what s problem
is that enouph??
No, that's not enough. You need t
در دوشنبه 9 دسامبر 2013، ساعت 23:04:43 (UTC+3:30)، Asemaneh Allame نوشته:
> hi everybody
>
> i recently install python & vpython(v:2.6.7) in my windows(32bit)
>
> it install succesfully but dont show some of graphes that involved their
> code in the lib.python ,
>
> i dont know what s problem
On 09/12/2013 19:34, Asemaneh Allame wrote:
hi everybody
i recently install python & vpython(v:2.6.7) in my windows(32bit)
it install succesfully but dont show some of graphes that involved their code
in the lib.python ,
i dont know what s problem...
please giude me
thanks
By an amazing coi
hi everybody
i recently install python & vpython(v:2.6.7) in my windows(32bit)
it install succesfully but dont show some of graphes that involved their code
in the lib.python ,
i dont know what s problem...
please giude me
thanks
--
https://mail.python.org/mailman/listinfo/python-list
In message , Peter Otten wrote:
> Lawrence D'Oliveiro wrote:
>
>> In message , Gilles Ganault
>> wrote:
>>
>>> test = "t...@gmail.com"
>>> isp = ["gmail.com", "yahoo.com"]
>>> for item in isp:
>>> if test.find(item):
>>> print item
>>> === output
>>> gmail.com
>>> yahoo.com
>>> ===
>>
>
On Apr 10, 2:36 am, John Posner wrote:
> Hrvoje Niksic wrote:
>
> > if test.contains(item) # would return a Boolean value
> >
>
> >> That's a string method, not a function in the string module.
>
> Oops, of course.
>
> import operator
> operator.contains('foo', 'o')
>
> That's
> Peter Otten wrote:
>> Could you explain why you prefer 'contains(belly, beer)'
>> or 'belly.contains(beer)' over 'beer in belly'? The last form may be
a bit
>> harder to find in the documentation, but once a newbie has learned about
>> it he'll find it easy to remember.
andrew cooke wrote:
Peter Otten wrote:
> John Posner wrote:
>
>> Given how common string maniuplations are, I guess I'm surprised that
>> Python hasn't yet made "contains()" into both a "string"-module function
>> *and* a string-object method.
>
> Could you explain why you prefer 'contains(belly, beer)'
> or 'belly.co
John Posner wrote:
> Given how common string maniuplations are, I guess I'm surprised that
> Python hasn't yet made "contains()" into both a "string"-module function
> *and* a string-object method.
Could you explain why you prefer 'contains(belly, beer)'
or 'belly.contains(beer)' over 'beer in be
Hrvoje Niksic wrote:
> if test.contains(item) # would return a Boolean value
>
>> That's a string method, not a function in the string module.
Oops, of course.
import operator
operator.contains('foo', 'o')
That's pretty good, and IMHO a bit better than John Machin's suggestion
John Posner writes:
> Q: Has anyone on the python-dev list ever proposed a "string"-module
> function that does the job of the "in" operator? Maybe this:
>
> if test.contains(item) # would return a Boolean value
That's a string method, not a function in the string module. If you
want a fun
2009/4/9 Miles :
> Clearly, any comparison with a boolean literal should be illegal. ;)
Hey, we could have strict type checking at compile time of /all/
operations, couldn't we? Anybody care to join me over at the Ada list?
;-)
--
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 10, 12:35 am, John Posner wrote:
> Lawrence D'Oliveiro wrote:
>
> > Fine if it only happened once. But it's a commonly-made mistake. At some
> > point you have to conclude that not all those people are stupid, there
> > really is something wrong with the design.
>
> I think "something wr
Lawrence D'Oliveiro wrote:
> Fine if it only happened once. But it's a commonly-made mistake. At some
> point you have to conclude that not all those people are stupid, there
> really is something wrong with the design.
I think "something wrong with the design" is overstating the case a bit,
an
Lawrence D'Oliveiro wrote:
In message , Gilles Ganault
wrote:
test = "t...@gmail.com"
isp = ["gmail.com", "yahoo.com"]
for item in isp:
if test.find(item):
print item
=== output
gmail.com
yahoo.com
===
This is why conditional constructs should not accept any values other than
True a
In message <7e7a386f-d336-4186-822d-
c6af0a581...@e38g2000vbe.googlegroups.com>, John Machin wrote:
> On Apr 9, 4:53 pm, Lawrence D'Oliveiro central.gen.new_zealand> wrote:
>
>> This is why conditional constructs should not accept any values other
>> than True and False.
>
> An alternative viewp
On Thu, 09 Apr 2009 18:53:13 +1200, Lawrence D'Oliveiro wrote:
> This is why conditional constructs should not accept any values other
> than True and False.
I once tried this:
for i in alist.sort():
and got an error I didn't understand because I failed to read the docs.
Clearly for loops shou
On 9 Apr, 09:49, Miles wrote:
> On Thu, Apr 9, 2009 at 2:59 AM, Peter Otten wrote:
> > Lawrence D'Oliveiro wrote:
> >> This is why conditional constructs should not accept any values other than
> >> True and False.
>
> > So you think
>
> > if test.find(item) == True: ...
>
> > would have been bett
On Apr 9, 4:53 pm, Lawrence D'Oliveiro wrote:
> In message , Gilles Ganault
> wrote:
>
> > test = "t...@gmail.com"
> > isp = ["gmail.com", "yahoo.com"]
> > for item in isp:
> > if test.find(item):
> > print item
> > === output
> > gmail.com
> > yahoo.com
> > ===
>
> This is why conditional
On Thu, Apr 9, 2009 at 2:59 AM, Peter Otten wrote:
> Lawrence D'Oliveiro wrote:
>> This is why conditional constructs should not accept any values other than
>> True and False.
>
> So you think
>
> if test.find(item) == True: ...
>
> would have been better?
Clearly, any comparison with a boolean l
Lawrence D'Oliveiro wrote:
> In message , Gilles Ganault
> wrote:
>
>> test = "t...@gmail.com"
>> isp = ["gmail.com", "yahoo.com"]
>> for item in isp:
>> if test.find(item):
>> print item
>> === output
>> gmail.com
>> yahoo.com
>> ===
>
> This is why conditional constructs should not acc
In message , Gilles Ganault
wrote:
> test = "t...@gmail.com"
> isp = ["gmail.com", "yahoo.com"]
> for item in isp:
> if test.find(item):
> print item
> === output
> gmail.com
> yahoo.com
> ===
This is why conditional constructs should not accept any values other than
True and False.
--
Gilles Ganault wrote:
> On Wed, 08 Apr 2009 12:11:55 +0200, Ulrich Eckhardt
> wrote:
>>find() returns the index where it is found or -1 if it is not found. Both
>> an
>>index>0 or a -1 evaluate to True when used as conditional expression.
>
> Thanks everyone. I shouldn't have assumed that "if test
On Wed, 08 Apr 2009 12:11:55 +0200, Ulrich Eckhardt
wrote:
>find() returns the index where it is found or -1 if it is not found. Both an
>index>0 or a -1 evaluate to True when used as conditional expression.
Thanks everyone. I shouldn't have assumed that "if test.find(item):"
was necessarily enou
Remeber the return value of find function of a string is -1 when it
fails, which is True.
Try:
for item in isp:
if item in test:
print item
From: Gilles Ganault
Date: April 8, 2009 5:56:34 PM CST
To: python-list@python.org
Subject: Why does Python show the whole array
Gilles Ganault wrote:
Hello
I'd like to go through a list of e-mail addresses, and extract those
that belong to well-known ISP's. For some reason I can't figure out,
Python shows the whole list instead of just e-mails that match:
=== script
test = "t...@gmail.com"
isp = ["gmail.com", "yah
Gilles Ganault writes:
> I'd like to go through a list of e-mail addresses, and extract those
> that belong to well-known ISP's. For some reason I can't figure out,
> Python shows the whole list instead of just e-mails that match:
>
> === script
> test = "t...@gmail.com"
> isp = ["gmail.com"
On Wed, 2009-04-08 at 12:01 +0200, Peter Otten wrote:
> Gilles Ganault wrote:
>
> > I'd like to go through a list of e-mail addresses, and extract those
> > that belong to well-known ISP's. For some reason I can't figure out,
> > Python shows the whole list instead of just e-mails that match:
> >
Gilles Ganault wrote:
> test = "t...@gmail.com"
> isp = ["gmail.com", "yahoo.com"]
> for item in isp:
> if test.find(item):
> print item
> === output
> gmail.com
> yahoo.com
> ===
>
> Any idea why I'm also getting "yahoo.com"?
find() returns the index where it is found or -1 if it is not
Gilles Ganault wrote:
> I'd like to go through a list of e-mail addresses, and extract those
> that belong to well-known ISP's. For some reason I can't figure out,
> Python shows the whole list instead of just e-mails that match:
>
> === script
> test = "t...@gmail.com"
> isp = ["gmail.com",
Hello
I'd like to go through a list of e-mail addresses, and extract those
that belong to well-known ISP's. For some reason I can't figure out,
Python shows the whole list instead of just e-mails that match:
=== script
test = "t...@gmail.com"
isp = ["gmail.com", "yahoo.com"]
for item in isp:
39 matches
Mail list logo