Hello,
I want to execute: print('Hello world.') in a file called hello.py
After creating a virtual-env (via PyCharm) I have these directories:
./foo
./foo/venv
./foo/venv/lib
./foo/venv/lib/python3.6
./foo/venv/lib/python3.6/site-packages
./foo/venv/include
./foo/venv/bin
I wa
On Mon, Sep 19, 2011 at 9:20 PM, Sander Sweers wrote:
> On 17/09/11 13:08, lists wrote:
>>
>> I have been trying to learn how to parse XML with Python and learn how
>> to use xml.etree. Lots of the tutorials seem to be very long winded.
>>
>> I'm trying
Thanks Tim,
Will do.
Chris
On Mon, Sep 19, 2011 at 11:05 AM, Tim Golden wrote:
> On 19/09/2011 11:01, Tim Golden wrote:
>>
>> you're more likely to find people familiar with the package (including
>> its maintainer in fact...)
>
> Sorry, I misread your post and thought you were referring lxml.e
Hello again.
So, any xml.etree experts out there who might have missed this over the weekend?
Thanks in advance!
Chris
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Hi Tutors,
I have been trying to learn how to parse XML with Python and learn how
to use xml.etree. Lots of the tutorials seem to be very long winded.
I'm trying to access a UK postcode API at www.uk-postcodes.com to take
a UK postcode and return the lat/lng of the postcode. This is what the
XML
>
>
>
>> In my continuing quest the find the best way of doing this I came across
>> the following method:
>>
>> for thread in threading.enumerate():
>> if thread is not threading.currentThread():
>> thread.join()
>> print 'FINISHED'
>>
>> In my newbie understanding, you
>
>
>> Only really glanced at this, but you seem to be checking only the last
>>> thread *after* the loop? Surely you should be storing all the threads in a
>>> list (or someplace) as you create them, and then check them all for liveness
>>> and if so join them each in turn, to ensure you only pri
> Only really glanced at this, but you seem to be checking only the last
>> thread *after* the loop? Surely you should be storing all the threads in a
>> list (or someplace) as you create them, and then check them all for liveness
>> and if so join them each in turn, to ensure you only print 'FINI
>
> Only really glanced at this, but you seem to be checking only the last
> thread *after* the loop? Surely you should be storing all the threads in a
> list (or someplace) as you create them, and then check them all for liveness
> and if so join them each in turn, to ensure you only print 'FINIS
Hi tutors!
I'm not a hard-core programmer but have used Python in systems
administration (it makes sense to me to use a scripting language which
supports both Windows and Unix).
The code below is an excerpt from a module I have written to collect
information about hosts on my network and populate
>> As I understand it, it makes most sense to set/get the attribute of
>> an object using a method rather than doing it directly.
>
> Heavens no!!! That's backwards!
>
> It might be justified in languages like Java, where you can't easily
> change your mind about direct attribute access. There's al
>
> My opinion - unless there is some verification or translation or action
> required it is better (easier, clearer) to just access and assign the
> attribute directly.
This makes sense. I guess my current way of doing it just reflects my
inexperience. At the moment I'm just fumbling this out so
>> > Currently I'm grappling with the concept of object orientating
>>
>> Oops, just re-read that email. Anyone spot the obvious typo... Ahemmm
>> of course I meant object orientated ;-)
>
>
> Actually I believe you mean object *oriented*.
> -Wayne
Wow, spelling lessons too. And I thought this pla
> Currently I'm grappling with the concept of object orientating
> programming and have a question about setting & getting attributes.
Oops, just re-read that email. Anyone spot the obvious typo... Ahemmm
of course I meant object orientated ;-)
Chris
__
Hi tutors,
I'm trying to each myself programming and come from a background in
system administration with some experience in scripting (so I'm very
new to it).
Currently I'm grappling with the concept of object orientating
programming and have a question about setting & getting attributes.
As I
> On 9/10/2010 5:22 AM, lists wrote:
>>>
>>> you could try random.shuffle and save a lot of time, it takes a mutable
>>> sequence (like a list) and shuffles it
>>
>> Hey there,
>>
>> For the few exercises I've been doing, I think the auth
Ooops, I forgot to send to the list too!
-- Forwarded message --
From: lists
Date: Fri, Sep 10, 2010 at 10:22 AM
Subject: Re: [Tutor] Random list exercise
To: Christopher King
> you could try random.shuffle and save a lot of time, it takes a mutable
> sequence (like
>>> Several small and not so small points:
>>>
>>> 1. you assign wordslen each pass through your loop. While it doesn't
>>> matter in a small loop, it wastes time on the order of the size of your
>>> list. Instead move wordslen = len(... above your while loop. Any time you
>>> put code in a loo
>>>
>>> Hi tutors,
>>>
>>> Still on my Python learning journey! I've just competed an exercise
>>> which asks the student to "Create a program that creates a list of
>>> words in random order. This program should print all the words and not
>>> repeat any." I've printed the list for my own needs. T
>
>
> On Thu, Sep 9, 2010 at 4:51 PM, lists wrote:
>>
>> Hi tutors,
>>
>> Still on my Python learning journey! I've just competed an exercise
>> which asks the student to "Create a program that creates a list of
>> words in random order. Th
Hi tutors,
Still on my Python learning journey! I've just competed an exercise
which asks the student to "Create a program that creates a list of
words in random order. This program should print all the words and not
repeat any." I've printed the list for my own needs. The list
randwords aims to a
>>> Assuming that mytext is "test", I've found that mytext[-1:-4:-1]
>>> doesn't work (as I expected it to) but that mytext[::-1] does.
>>>
>>> While that's fine, I just wondered why mytext[-1:-4:-1] doesn't
>>> work?
>>
>> It does work.
>> But remember that slices give you the first item to one le
>>> Assuming that mytext is "test", I've found that mytext[-1:-4:-1]
>>> doesn't work (as I expected it to) but that mytext[::-1] does.
>>>
>>> While that's fine, I just wondered why mytext[-1:-4:-1] doesn't work?
>>
>> How does it not "work"? What did you expect to happen? What did it do
>> inste
>> Assuming that mytext is "test", I've found that mytext[-1:-4:-1]
>> doesn't work (as I expected it to) but that mytext[::-1] does.
>>
>> While that's fine, I just wondered why mytext[-1:-4:-1] doesn't work?
>
> How does it not "work"? What did you expect to happen? What did it do instead?
>
> Gr
Hi guys,
Continuing my Python learning, I came across an exercise which asks me
to take a string and reverse it.
I understand that there is a function to do this i.e mytext.reverse()
I imagine that the exercise author would rather I did this the hard
way however. ;-)
Assuming that mytext is "te
> On 9/4/2010 10:14 AM, lists wrote:
>>
>> Hi folks,
>>
>> I'm new to Python, I'm working my way through some intro books, and I
>> have a question that I wonder if someone could help me with please?
>>
>> This is my attempt at solving an e
>> if coinToss(1,2) == 1:
>> heads += 1
>> tossNo += 1
>> else:
>> tails += 1
>> tossNo += 1
>
> Looking good. You can hoist "tossNo += 1" out of each branch of your if
> statement too, if you like, to make it even more streamlined (In
> other words, execute
>> On 9/4/10, lists wrote:
>> > Hi folks,
>> >
>> > I'm new to Python, I'm working my way through some intro books, and I
>> > have a question that I wonder if someone could help me with please?
>> >
>> > This is my attempt at
Hi folks,
I'm new to Python, I'm working my way through some intro books, and I
have a question that I wonder if someone could help me with please?
This is my attempt at solving an exercise where the program is
supposed to flip a coin 100 times and then tell you the number of
heads and tails.
AT
Hi Alan,
Alan Gauld wrote:
> "Patrick" <[EMAIL PROTECTED]> wrote
>
>> Can anyone please point me to a document that explains "self" in
>> layman's terms.
>
> Try the OOP topic inmy tutorial...
Thanks will have a look.
>> Or lacking such a doc throw in a much appreciated
>> layman's explanati
Reply to anush badii <[EMAIL PROTECTED]> 06-06-19 08:52:
> Why don't you use the extended ASCII characters where Swedish characters are
> included.
Not to be be picky but "extended ASCII" isn't a character set and have never
been. He should be using ISO-8859-1 (or as it's sometimes called Latin 1
31 matches
Mail list logo