[Tutor] Next steps after creating virtualenv (new github project)?

2019-03-03 Thread Thomas Güttler Lists
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

Re: [Tutor] Using xml.etree

2011-09-19 Thread lists
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

Re: [Tutor] Using xml.etree

2011-09-19 Thread lists
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

Re: [Tutor] Using xml.etree

2011-09-19 Thread lists
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

[Tutor] Using xml.etree

2011-09-17 Thread lists
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

Re: [Tutor] Waiting until a thread ends

2011-03-19 Thread lists
> > > >> 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

Re: [Tutor] Waiting until a thread ends

2011-03-19 Thread lists
> > >> 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

Re: [Tutor] Waiting until a thread ends

2011-03-17 Thread lists
> 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

Re: [Tutor] Waiting until a thread ends

2011-03-17 Thread lists
> > 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

[Tutor] Waiting until a thread ends

2011-03-17 Thread lists
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

Re: [Tutor] Getting/setting attributes

2010-09-21 Thread lists
>> 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

Re: [Tutor] Getting/setting attributes

2010-09-21 Thread lists
> > 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

Re: [Tutor] Getting/setting attributes

2010-09-21 Thread lists
>> > 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

Re: [Tutor] Getting/setting attributes

2010-09-21 Thread lists
> 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 __

[Tutor] Getting/setting attributes

2010-09-21 Thread lists
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

Re: [Tutor] Random list exercise

2010-09-10 Thread lists
>  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

[Tutor] Random list exercise

2010-09-10 Thread lists
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

Re: [Tutor] Random list exercise

2010-09-09 Thread lists
>>> 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

Re: [Tutor] Random list exercise

2010-09-09 Thread lists
>>> >>> 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

Re: [Tutor] Random list exercise

2010-09-09 Thread lists
> > > 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

[Tutor] Random list exercise

2010-09-09 Thread lists
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

Re: [Tutor] slicing a string

2010-09-07 Thread lists
>>> 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

Re: [Tutor] slicing a string

2010-09-06 Thread lists
>>> 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

Re: [Tutor] slicing a string

2010-09-06 Thread lists
>> 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

[Tutor] slicing a string

2010-09-06 Thread lists
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

Re: [Tutor] Giving a name to a function and calling it, rather than calling the function directly

2010-09-05 Thread lists
>  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

Re: [Tutor] Giving a name to a function and calling it, rather than calling the function directly

2010-09-04 Thread lists
>>     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

Re: [Tutor] Giving a name to a function and calling it, rather than calling the function directly

2010-09-04 Thread lists
>> 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

[Tutor] Giving a name to a function and calling it, rather than calling the function directly

2010-09-04 Thread lists
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

Re: [Tutor] Hello and newbie question about "self"

2008-02-03 Thread Patrick Lists
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

Re: [Tutor] local day names in ascii

2006-06-19 Thread lists
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