Re: [Tutor] Read from large text file, find string save 1st string of each line where it appeared.

2015-12-28 Thread Walter Prins
Hi Sutanu,

On 28 December 2015 at 11:20, sutanu bhattacharya <
totaibhattacha...@gmail.com> wrote:

> {'115160371': [45349980, 22477811, 40566595, 26947037, 16178191, 12984002,
> 20087719, 19771564, 61746245, 17467721, 32233776, 31052980, 70768904,
> 16113331, 12414642]} 
>
> suppose 61746245  is my searching string. so o/p will be
> 115160371  (1st string). Area in between third bracket
> ([
> ]) is the searching area...
>

We are not mind readers, and as others have said, you need to provide more
of a description of what you're trying to accomplish and what version of
Python, OS etc you are using.

But, assuming Windows, Python 2.x, and assuming what described as
"searching a string" is in fact more of a looking up id's in lists of id's
held as the values in a Python dict, then simplistically/directly you could
do something as follows:

example.py---
friendsmap1 = {
   115160371: [45349980, 22477811, 40566595, 26947037, 16178191,
12984002,
   20087719, 19771564, 61746245, 17467721, 32233776,
31052980,
   70768904, 16113331, 12414642],
   45349980:  [22477811, 40566595, 26947037, 16178191],
   16178191:  [61746245, 17467721, 32233776, 31052980],
   31052980:  [22477811, 40566595, 32233776, 31052980]
 }

friendsmap2 = {
   16178191:  [61746245, 17467721, 32233776, 31052980],
   31052980:  [22477811, 40566595, 32233776, 31052980]
 }

def friendswith(friendsmap, friendid):
res = [key for key, value in friendsmap.items() if friendid in value]
return res

# Examples:
print friendswith(friendsmap1, 61746245)
print friendswith(friendsmap1, 26947037)
print friendswith(friendsmap2, 61746245)

example.py---

output---
[115160371, 16178191]
[115160371, 45349980]
[16178191]



Walter
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Read from large text file, find string save 1st string of each line where it appeared.

2015-12-28 Thread Cameron Simpson

On 29Dec2015 03:12, Steven D'Aprano  wrote:

On Mon, Dec 28, 2015 at 04:50:05PM +0530, sutanu bhattacharya wrote:

suppose 61746245  is my searching string. so o/p will be

[...]


I don't understand the question.
What is "o/p"?


"output"

Cheers,
Cameron Simpson 
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Read from large text file, find string save 1st string of each line where it appeared.

2015-12-28 Thread sutanu bhattacharya
{'115160371': [45349980, 22477811, 40566595, 26947037, 16178191, 12984002,
20087719, 19771564, 61746245, 17467721, 32233776, 31052980, 70768904,
16113331, 12414642]} 

suppose 61746245  is my searching string. so o/p will be
115160371  (1st string). Area in between third bracket ([
]) is the searching area...


kindly help me to solve this problem..

-- 
Sutanu Bhattacharya
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Can you help me importing the dataset?

2015-12-28 Thread Alan Gauld
On 28/12/15 09:52, Jinwoo Park wrote:

> I am using python for my project and I got stuck on importing a data.
> My data was generated from other program called Madgraph5 and it is .lhe
> file.

Never heard of it can you show us a very small example of
what the data looks like?

> I thought using usecols or skiprows would've worked, but this data is very
> messy and there are many "<...>"s in between the data (numbers) that I need

Have you written any code? Let us see it.
Which module are you using?

> (I attached a screen shot).

It didn't reach us (or not me at least). Tutor is a text based mailing
list, if you want to post the screenshot somewhere you can send a url
link. Better still would be to cut n paste the content into a mail.

> Also, for numbers, I need to separate rows based on beginning numbers.

I don't understand what that means, can you show us
a before/after example?

> Can you help me separating my data based on beginning numbers please?
> Or can you tell me where I can find the answer?

We'd need a lot more information to understand the problem first.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Can you help me importing the dataset?

2015-12-28 Thread Jinwoo Park
Hello!

I am using python for my project and I got stuck on importing a data.
My data was generated from other program called Madgraph5 and it is .lhe
file.
I thought using usecols or skiprows would've worked, but this data is very
messy and there are many "<...>"s in between the data (numbers) that I need
(I attached a screen shot).
Also, for numbers, I need to separate rows based on beginning numbers.

Can you help me separating my data based on beginning numbers please?
Or can you tell me where I can find the answer?

Thank you!
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Read from large text file, find string save 1st string of each line where it appeared.

2015-12-28 Thread Mark Lawrence

On 28/12/2015 11:20, sutanu bhattacharya wrote:

{'115160371': [45349980, 22477811, 40566595, 26947037, 16178191, 12984002,
20087719, 19771564, 61746245, 17467721, 32233776, 31052980, 70768904,
16113331, 12414642]} 

suppose 61746245  is my searching string. so o/p will be
115160371  (1st string). Area in between third bracket ([
]) is the searching area...


kindly help me to solve this problem..



We will help when you show us the code that you've written.  What OS and 
Python version are you using?


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Read from large text file, find string save 1st string of each line where it appeared.

2015-12-28 Thread Joel Goldstick
On Mon, Dec 28, 2015 at 6:20 AM, sutanu bhattacharya <
totaibhattacha...@gmail.com> wrote:

> {'115160371': [45349980, 22477811, 40566595, 26947037, 16178191, 12984002,
> 20087719, 19771564, 61746245, 17467721, 32233776, 31052980, 70768904,
> 16113331, 12414642]} 
>
> suppose 61746245  is my searching string. so o/p will be
> 115160371  (1st string). Area in between third bracket
> ([
> ]) is the searching area...
>
>
> kindly help me to solve this problem..
>
> --
> Sutanu Bhattacharya
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>

def problem(6174625):
return 115160371

You haven't really described your problem, so above is a solution for what
you asked.  What have you tried so far, and what was your result?

-- 
Joel Goldstick
http://joelgoldstick.com/stats/birthdays
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Read from large text file, find string save 1st string of each line where it appeared.

2015-12-28 Thread Steven D'Aprano
On Mon, Dec 28, 2015 at 04:50:05PM +0530, sutanu bhattacharya wrote:
> {'115160371': [45349980, 22477811, 40566595, 26947037, 16178191, 12984002,
> 20087719, 19771564, 61746245, 17467721, 32233776, 31052980, 70768904,
> 16113331, 12414642]} 
> 
> suppose 61746245  is my searching string. so o/p will be
> 115160371  (1st string). Area in between third bracket ([
> ]) is the searching area...

I don't understand the question.

What is "o/p"?

What do you mean, "searching string"? The string you are searching 
*for*, or the string you are searching *in*?

You have something that looks like a dictionary { } followed by an email 
address. What does that mean?

If you expect any useful answers, you will have to give a more careful 
question. Please show some sample data, and expected result, using 
valid Python syntax.

For example:

text = """This is a large string.
It contains many lines of text.
And some numbers: 22477811, 40566595, 26947037
And more numbers: 32233776, 31052980, 70768904
And lots more text.
"""
target = "233"

expected result: "32233776"





-- 
Steve
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Algorithm

2015-12-28 Thread cicy felix
Hello there!
Thank you for the good work you are doing at helping newbies to python.
Please I'd like clarification with the exercise below:

  Create a function get_algorithm_result to implement the algorithm below
Get a list of numbers L1, L2, L3LN as argument
Assume L1 is the largest,  Largest = L1
Take next number Li from the list and do the following
If Largest is less than Li
   Largest = Li
 If Li is last number from  the list then
  return Largest and come out
 Else repeat same process starting from step 3

This what I've come up with:

def get_algorithm_result( numlist ):
 largest = numlist[0]
 i = 1
 while ( i < len(numlist) ):
   if ( largest < numlist[i]):
 largest = numlist[i]
 i = i + 1
 return largest
 numlist1 = [1,2,3,4,5]
 numlist2 = [10,20,30,40,50]
 largest = get_algorithm_result(numlist1)
 print largest
 largest = get_algorithm_result(numlist2)
 print largest

And I keep getting this error :
  .  test_maximum_number_two
Failure in line 15, in test_maximum_number_twoself.assertEqual(result,
"zoo", msg="Incorrect number") AssertionError: Incorrect number
Using unittest

I look forward to your response,
Thank you!
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Read from large text file, find string save 1st string of each line where it appeared.

2015-12-28 Thread Nnamdi Anyanwu
I think what he's looking for is something similar to
grep 6174625 | awk -F ":" {print $1}

I don't know if there is a more efficient Python built-in used to search
for the line containing 6174625 (grep in python) other than simply
iterating though the entire file, with a for loop, line-by-line. You'd also
need to decide whether you want to print all lines containing the
searched-for string or just the first occurence. You can then use the split
method to return the first string on the line, using the semi-colon as the
delimiter.


for line in open("file.txt"):

if "6174625" in line:

return line.split(":")[0]


On Mon, Dec 28, 2015 at 6:20 AM, sutanu bhattacharya <
totaibhattacha...@gmail.com> wrote:

> {'115160371': [45349980, 22477811, 40566595, 26947037, 16178191, 12984002,
> 20087719, 19771564, 61746245, 17467721, 32233776, 31052980, 70768904,
> 16113331, 12414642]} 
>
> suppose 61746245  is my searching string. so o/p will be
> 115160371  (1st string). Area in between third bracket
> ([
> ]) is the searching area...
>
>
> kindly help me to solve this problem..
>
> --
> Sutanu Bhattacharya
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>

def problem(6174625):
return 115160371

You haven't really described your problem, so above is a solution for what
you asked.  What have you tried so far, and what was your result?

--
Joel Goldstick
http://joelgoldstick.com/stats/birthdays
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Fwd: Read from large text file, find string save 1st string of each line where it appeared.

2015-12-28 Thread sutanu bhattacharya
suppose 115160371 is my facebook id. 6174625 is the id of one of my
friends. If i give an id ,the output will be the id of those people who are
friend of 6174625.


-- Forwarded message --
From: Joel Goldstick 
Date: Mon, Dec 28, 2015 at 9:20 PM
Subject: Re: [Tutor] Read from large text file, find string save 1st string
of each line where it appeared.
To: sutanu bhattacharya 


Please don't write me.  Write to the mailing list

On Mon, Dec 28, 2015 at 10:43 AM, sutanu bhattacharya <
totaibhattacha...@gmail.com> wrote:

> Hi Joel,
>
> suppose 115160371 is my facebook id. 6174625 is the id of one of my
> friends. If i give an id ,the output will be the id of those people who are
> friend of 6174625.
>
> thanking you,
> Sutanu
>
>
>
> On Mon, Dec 28, 2015 at 7:00 PM, Joel Goldstick 
> wrote:
>
>>
>>
>> On Mon, Dec 28, 2015 at 6:20 AM, sutanu bhattacharya <
>> totaibhattacha...@gmail.com> wrote:
>>
>>> {'115160371': [45349980, 22477811, 40566595, 26947037, 16178191,
>>> 12984002,
>>> 20087719, 19771564, 61746245, 17467721, 32233776, 31052980, 70768904,
>>> 16113331, 12414642]} 
>>>
>>> suppose 61746245  is my searching string. so o/p will
>>> be
>>> 115160371  (1st string). Area in between third
>>> bracket ([
>>> ]) is the searching area...
>>>
>>>
>>> kindly help me to solve this problem..
>>>
>>> --
>>> Sutanu Bhattacharya
>>> ___
>>> Tutor maillist  -  Tutor@python.org
>>> To unsubscribe or change subscription options:
>>> https://mail.python.org/mailman/listinfo/tutor
>>>
>>
>> def problem(6174625):
>> return 115160371
>>
>> You haven't really described your problem, so above is a solution for
>> what you asked.  What have you tried so far, and what was your result?
>>
>> --
>> Joel Goldstick
>> http://joelgoldstick.com/stats/birthdays
>>
>
>
>
> --
> Sutanu Bhattacharya
>
>
>


-- 
Joel Goldstick
http://joelgoldstick.com/stats/birthdays



-- 
Sutanu Bhattacharya
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Algorithm

2015-12-28 Thread Joel Goldstick
On Mon, Dec 28, 2015 at 7:34 AM, cicy felix  wrote:

> Hello there!
> Thank you for the good work you are doing at helping newbies to python.
> Please I'd like clarification with the exercise below:
>
>   Create a function get_algorithm_result to implement the algorithm below
> Get a list of numbers L1, L2, L3LN as argument
> Assume L1 is the largest,  Largest = L1
> Take next number Li from the list and do the following
> If Largest is less than Li
>Largest = Li
>  If Li is last number from  the list then
>   return Largest and come out
>  Else repeat same process starting from step 3
>
> This what I've come up with:
>
> def get_algorithm_result( numlist ):
>  largest = numlist[0]
>  i = 1
>  while ( i < len(numlist) ):
>if ( largest < numlist[i]):
>  largest = numlist[i]
>  i = i + 1
>  return largest
>

I believe the code following should not be indented as that makes it part
of your function


>  numlist1 = [1,2,3,4,5]
>  numlist2 = [10,20,30,40,50]
>  largest = get_algorithm_result(numlist1)
>  print largest
>  largest = get_algorithm_result(numlist2)
>  print largest
>
> And I keep getting this error :
>   .  test_maximum_number_two
> Failure in line 15, in test_maximum_number_twoself.assertEqual(result,
> "zoo", msg="Incorrect number") AssertionError: Incorrect number
> Using unittest
>
> Can you show your unittest code?


> I look forward to your response,
> Thank you!
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>



-- 
Joel Goldstick
http://joelgoldstick.com/stats/birthdays
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Algorithm

2015-12-28 Thread Alan Gauld
On 28/12/15 17:32, Joel Goldstick wrote:

> I believe the code following should not be indented as that makes it part
> of your function
> 
> 
>>  numlist1 = [1,2,3,4,5]
>>  numlist2 = [10,20,30,40,50]
>>  largest = get_algorithm_result(numlist1)
>>  print largest

Ah, that makes sense. I couldn't think what the OP was trying
to do with those lines.

If they are outside the function then it all makes perfect sense.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Algorithm

2015-12-28 Thread Alan Gauld
On 28/12/15 12:34, cicy felix wrote:

>   Create a function get_algorithm_result to implement the algorithm below
> Get a list of numbers L1, L2, L3LN as argument
> Assume L1 is the largest,  Largest = L1
> Take next number Li from the list and do the following
> If Largest is less than Li
>Largest = Li
>  If Li is last number from  the list then
>   return Largest and come out
>  Else repeat same process starting from step 3

OK, That seems fairly clear. Although it does
seem to imply a while loop which is maybe not
the best option here.(see below)

> This what I've come up with:

Thanks for showing us the code, but there are several
issues with it

> def get_algorithm_result( numlist ):
>  largest = numlist[0]
>  i = 1
>  while ( i < len(numlist) ):
>if ( largest < numlist[i]):
>  largest = numlist[i]
>  i = i + 1

Notice that you only increase i if the if test is true.
If largest >= numlist[i] then your loop will simply go
round and round forever. The normal way in Python to
process all elements in a list is to use a for loop.

In your case that would look an awful lot simpler.
Try it.

>  return largest
>  numlist1 = [1,2,3,4,5]
>  numlist2 = [10,20,30,40,50]

I've no idea what you think these numbers are for,
they are not mentioned in your problem description.

>  largest = get_algorithm_result(numlist1)

This should(if it worked properly) return 5

>  print largest

So this (should) always print 5

>  largest = get_algorithm_result(numlist2)

and his should(if it worked properly) return 50

>  print largest

and this should print 50.

Two largests - isn't that a bit confusing?
Especially since neither number may be in your
original list of numbers.

> And I keep getting this error :
>   .  test_maximum_number_two
> Failure in line 15, in test_maximum_number_twoself.assertEqual(result,
> "zoo", msg="Incorrect number") AssertionError: Incorrect number
> Using unittest


Since you don't show us any code involving test_maximum_number_two
or even maximum_number_two() we can't help you there.

But it does seem to me that you are over complicating things.
Even if you stick with a while loop, just follow the algorithm
you were given and it should work.

One final point. You are printing the results but your problem states
that you should write a function that *returns* the largest. Not one
that prints it.

In general this is what functions should always do - return
values not print them. It makes them much more reusable and flexible.
You can always print the output later using:

print get_algorithm_result(numlist)


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Fwd: Read from large text file, find string save 1st string of each line where it appeared.

2015-12-28 Thread Mark Lawrence

On 28/12/2015 15:56, sutanu bhattacharya wrote:

suppose 115160371 is my facebook id. 6174625 is the id of one of my
friends. If i give an id ,the output will be the id of those people who are
friend of 6174625.


-- Forwarded message --
From: Joel Goldstick 
Date: Mon, Dec 28, 2015 at 9:20 PM
Subject: Re: [Tutor] Read from large text file, find string save 1st string
of each line where it appeared.
To: sutanu bhattacharya 


Please don't write me.  Write to the mailing list

On Mon, Dec 28, 2015 at 10:43 AM, sutanu bhattacharya <
totaibhattacha...@gmail.com> wrote:


Hi Joel,

suppose 115160371 is my facebook id. 6174625 is the id of one of my
friends. If i give an id ,the output will be the id of those people who are
friend of 6174625.

thanking you,
Sutanu



On Mon, Dec 28, 2015 at 7:00 PM, Joel Goldstick 
wrote:




On Mon, Dec 28, 2015 at 6:20 AM, sutanu bhattacharya <
totaibhattacha...@gmail.com> wrote:


{'115160371': [45349980, 22477811, 40566595, 26947037, 16178191,
12984002,
20087719, 19771564, 61746245, 17467721, 32233776, 31052980, 70768904,
16113331, 12414642]} 

suppose 61746245  is my searching string. so o/p will
be
115160371  (1st string). Area in between third
bracket ([
]) is the searching area...


kindly help me to solve this problem..

--
Sutanu Bhattacharya
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor



def problem(6174625):
 return 115160371

You haven't really described your problem, so above is a solution for
what you asked.  What have you tried so far, and what was your result?

--
Joel Goldstick
http://joelgoldstick.com/stats/birthdays





--
Sutanu Bhattacharya








Suppose that you stop top posting?  Then it would be far easier for 
people to follow the thread.


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] trouble with beautiful soup

2015-12-28 Thread marcus lütolf
Dear Pythonistas
Hi Danny,

I am grateful for your precise instruchtions.
Yes ideed, I tried all of the steps mentioned below which I shoudn't have done 
fumling around with this task now  for hours and days.
I even tried to do it on may laptop using W7 64bit and after deleting and 
reinstalling Python27.
The youtube video  I was referring to was : 
https://www.youtube.com/watch?v=0snOcBQ3I0g.

Now for pip: I found pip in C:\Python27\Lib\site-packages. But if I type in pip 
or pip.exe I get (in german): The command "pip" is  either typed wrong or could 
not be found (I can't cut and paste from the command window).
As you might have noticed English is not my natural language and this can lead 
sometimes to interpretation errors.

Regards, Marcus.
--
-Ursprüngliche Nachricht-
Von: Danny Yoo [mailto:d...@hashcollision.org] 
Gesendet: Samstag, 26. Dezember 2015 22:00
An: marcus lütolf 
Cc: python mail list 
Betreff: Re: [Tutor] trouble with beautiful soup

On Sat, Dec 26, 2015 at 3:23 AM, marcus lütolf  
wrote:
> Hi Walter, dear pythonistas,
>
> thank you !
> replacing „beautifulsoup“ by „bs4“ in my code (2nd line) does not relieve the 
> trace back I get.
>
>
>
> In my directory C:\Python27\Lib I find the folder 
> „beautifulsoup4-4-4-1“ in first place and the file „setup.py“ further 
> down
>
> Upon opening „beautifulsoup4-4-4-1“,  „bs4“ appears as another folder among 
> others and some  .py files.
>
> (C:\Python27\Lib\beautifoulsoup4-4-4-1\bs4\)


Ah.  This looks incorrect.  It appears that somehow the contents of the zip 
file was directly copied into Python27\Lib.  This will not work because the 
directory layout structure of the zip file includes much more than what Python 
needs.  The zip file is structurally organized so that you need to follow a 
specific procedure to install the library.


To be clear: you should *not* be trying to directly copy files into 
Python27\Lib.  Trying to do it by hand is error-prone, as you are finding.


Please respond to Alan Gauld's recent response, where he said:

Which command line are you using? The pip command is not a python command 
but a shell one. You need to run it from the CMD prompt.

Did you try that? and if so what exact message did you get? Can you show us 
a cut n paste of the session please?


Please respond to this, because it is crucial to understand what you have done. 
 I don't think you've actually followed the earlier instructions to run 'python 
setup.py install' at the Windows command prompt.



> 2 days ago I watched a youtube video about installing beautifulsoup. There, 
> the bs4 folder appeared direct in the Lib folder :
>
> C:\Python27\Lib\bs4\.
>
> Could this cause my trouble ?

The structure here is what I would have expected.  I strongly suggest you try 
reinstalling the bs4 library by carefully following the installation 
instructions.


---

By the way, as a meta-comment: please try to refer with explicit hyperlinks if 
you talk about an external resource such as a YouTube video.  When you mention 
"I watched a YouTube video about ...", then it's very helpful if you can 
mention the specific hyperlink to that video.  Here is one reason why it's 
helpful: it allows one of us to confirm your observation.  Perhaps you might 
have misunderstood what the video was showing?

Without references, we're at the mercy of hearsay.  Misinterpreting what we 
observe is a common mistake that all of us humans make.
(This is not limited just in the programming domain, of course.) Rather than 
ignore that human weakness, we can and should try to anticipate and compensate. 
 By pointing with references, we allow others to confirm our observations 
independently.  This is why
references are so important.   Reference-friendly systems like the WWW
are under-appreciated treasures.

---


Hope that makes sense.  Good luck to you!


---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.com/antivirus

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] trouble with beautiful soup

2015-12-28 Thread Alan Gauld
On 28/12/15 17:24, marcus lütolf wrote:
> ... (I can't cut and paste from the command window).
> 

Actually you can :-)

The secret is in the drop down menu from the icon
in the top left corner of the window. You should find
an Edit option which has a sub menu that allows you
to select/copy text.

You can make it even easier by going into the CMD
window options and selecting the QuickEdit option
and applying it to all sessions. That allows you
to select text using the mouse and copy using a
shortcut key(I can't recall which - return maybe?)

You can then paste your copied text into a mail
message (or anything else).

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] trouble with beautiful soup

2015-12-28 Thread Mark Lawrence

On 28/12/2015 17:24, marcus lütolf wrote:

Dear Pythonistas
Hi Danny,

I am grateful for your precise instruchtions.
Yes ideed, I tried all of the steps mentioned below which I shoudn't have done 
fumling around with this task now  for hours and days.
I even tried to do it on may laptop using W7 64bit and after deleting and 
reinstalling Python27.
The youtube video  I was referring to was : 
https://www.youtube.com/watch?v=0snOcBQ3I0g.

Now for pip: I found pip in C:\Python27\Lib\site-packages. But if I type in pip or 
pip.exe I get (in german): The command "pip" is  either typed wrong or could 
not be found (I can't cut and paste from the command window).
As you might have noticed English is not my natural language and this can lead 
sometimes to interpretation errors.

Regards, Marcus.


c:\Python27\Scripts>dir pip*
 Volume in drive C has no label.
 Volume Serial Number is AE77-B408

 Directory of c:\Python27\Scripts

20/09/2015  20:2298,124 pip.exe
20/09/2015  20:2298,124 pip2.7.exe
20/09/2015  20:2298,124 pip2.exe
   3 File(s)294,372 bytes
   0 Dir(s)  869,655,580,672 bytes free

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence



___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor