[Tutor] http.server -- stuck at binding [windows8]

2013-08-19 Thread shanmukhateja
Hello,
   I am developing a simple http media streamer with the help of simple 
http server of http.server and I have a problem in binding the server. I get 
the “the address is not valid in it’s content error” and I KNOW that it can be 
solved by socket.INADDR_ANY but the problem is my router has assigned me 
192.168.1.*** and my ISP has given me a ip like 119.*.*.* which is causing the 
problem.. I find this 119.*.*.* IP nowhere in ipconfig [neither with the /all 
flag]

How can I solve this puzzle???

Kindly help me out___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Error :SyntaxError: 'break' outside loop

2013-08-19 Thread Zoya Tavakkoli
Hi everyone

I write this code for color segmentation ,but after Run I recived this
error:

SyntaxError: 'break' outside loop

I could not resolve that ,could you please help me?

python.2.7.5

import cv2
import numpy as np

cap = cv2.VideoCapture("C:\Users\Zohreh\Desktop\Abdomen.MST")

while (1):
 _, frame = cap.read()
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)

lower_blue = np.array([110,50,50])
upper_blue = np.array([130,255,255])

mask = cv2.inRange(hsv, lower_blue, upper_blue)
res = cv2.bitwise_and(frame,frame, mask= mask)

cv2.imshow("frame",frame)
cv2.imshow("mask",mask)
cv2.imshow("res",res)


k = cv2.waitkey(5) & 0xFF
if k == 27:

 break


cv2.destroyWindow()
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Error :SyntaxError: 'break' outside loop

2013-08-19 Thread Chris Down
On 2013-08-18 10:18, Zoya Tavakkoli wrote:
> if k == 27:
>
>  break

Well, you're not in a function here, so break doesn't make any sense. What is
it that you want to do?


pgpYkuuMtY52T.pgp
Description: PGP signature
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Error :SyntaxError: 'break' outside loop

2013-08-19 Thread Chris Down
On 2013-08-19 10:55, Chris Down wrote:
> On 2013-08-18 10:18, Zoya Tavakkoli wrote:
> > if k == 27:
> >
> >  break
>
> Well, you're not in a function here, so break doesn't make any sense. What is
> it that you want to do?

s/function/loop/


pgpV6iNWSeUjo.pgp
Description: PGP signature
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] http.server -- stuck at binding [windows8]

2013-08-19 Thread Chris Down
Hello,

On 2013-08-18 10:40, shanmukhat...@gmail.com wrote:
> I am developing a simple http media streamer with the help of simple http
> server of http.server and I have a problem in binding the server. I get the
> “the address is not valid in it’s content error” and I KNOW that it can be
> solved by socket.INADDR_ANY but the problem is my router has assigned me
> 192.168.1.*** and my ISP has given me a ip like 119.*.*.* which is causing
> the problem.. I find this 119.*.*.* IP nowhere in ipconfig [neither with the
> /all flag]

Your problem is that your computer is behind a NAT provided by your router.
Essentially, to provide access to multiple devices on your network while still
only using a single external IP address, your router uses network(s) that are
private to your LAN and then attempts to map calls from the outside to IPs on
the inside.

The usual way to handle it would be to bind to your local WAN-facing interface
and then port forward on your router, however this is off-topic for this list.
This is fairly facile though, if you google for "port forward" and your router
model, you should find instructions on how to do so.

Best,

Chris


pgpRTYYd_LzeW.pgp
Description: PGP signature
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Error :SyntaxError: 'break' outside loop

2013-08-19 Thread Steven D'Aprano
Hello Zoya, and welcome!


On Sun, Aug 18, 2013 at 10:18:06AM -0700, Zoya Tavakkoli wrote:
> Hi everyone
> 
> I write this code for color segmentation ,but after Run I recived this
> error:
> 
> SyntaxError: 'break' outside loop
> 
> I could not resolve that ,could you please help me?

Is the error message not clear enough? You have a 'break' command 
outside of a loop. If the error message is not clear enough, please 
suggest something that would be more clear. Also, you should read the 
entire traceback, which will show you not just the error, but the exact 
line causing the problem.

For example, these two are legal:

# Legal
while x > 100:
if y == 0:
break
...


# Also legal
for i in range(1000):
if x > 20:
break
...


But not this:

# Not legal
if x > 20:
break


You can't break out of a loop, if you aren't inside a loop to begin 
with.


> while (1):
>  _, frame = cap.read()

You have a while loop with only one line. It loops forever, and never 
exits. Are you sure that's what you want?

By the way, it is much, much, much easier to see indentation when you 
make it four spaces or eight. Good programmer's editors let you set 
indentation to four or eight spaces. Even Notepad, which is *not* a 
programmer's editor, lets you hit the Tab key and indent. 


> hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)

Because this line is not indented, it is not inside the loop.


> if k == 27:
> 
>  break

Again, because the "if" line is not indented, it is outside the loop, 
and so the break is illegal.


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


Re: [Tutor] I need a good resource for python Django

2013-08-19 Thread Russel Winder
On Sat, 2013-08-17 at 21:29 +0530, Arun Kumar wrote:
> Hi,
> 
> Can anyone suggest me a good resource for python Django. I've gone through
> the official website of Django but it is of limited use to me. Any help on
> this would be highly appreciated.

You have given no indication as to why you consider the website not to
have given you what you need so we have no information to try and direct
you to useful material.

Others have provided so URL of other material, but, for me, the best
"Let's Learn Django" website has to be Harry Percival's Test-Driven
Django Tutorial, it emphasizes TDD and tests where the Django site
rarely mentions them in the introductory material (a gross oversight).
http://www.tdd-django-tutorial.com/

-- 
Russel.
=
Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder


signature.asc
Description: This is a digitally signed message part
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] . http.server -- stuck at binding [windows8]

2013-08-19 Thread Engineering
Since you are behind a router , ipconfig will only show the address of your
machine which has been given by the router. Ipconfig cannot see beyond the
router. 

If you work within your own LAN , the IP address of your machine is
sufficient for the socket. 

If you want to access from outside , there should be port forwarding enabled
on your router.

 

One of my personal interest . I have done an HTTP server on Python using
twisted and autobahn to control my arduino micro controller. But , I want to
stream media using it for my OpenCV to access it. 

 

How are you streaming  videos?

 

 

 

CLEANTECH SOLUTION

www.cleantechsolution.in

 

SAVE PAPER , SAVE EARTH

 

 

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


[Tutor] Coursera Python Course starts today

2013-08-19 Thread Leam Hall

Hey all,

In case I'm not the absolute last person to know, the newest edition of 
the Coursera "Learn to Program" course started today. It is Python 
based, free, lasts 7 weeks, and pretty fun. I didn't get a certificate 
last time as life got in the way. Hope to succeed this time.


https://class.coursera.org/programming1-002/class/index

Leam


--
http://31challenge.net
http://31challenge.net/insight
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] [OT] Replies go to individuals, not the list?

2013-08-19 Thread Leam Hall

All,

Am I more confused than normal or if I click "Reply" should it go just 
to the sender instead of the list?


Leam

--
http://31challenge.net
http://31challenge.net/insight
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] [OT] Replies go to individuals, not the list?

2013-08-19 Thread Steven D'Aprano

On 20/08/13 10:18, Leam Hall wrote:

All,

Am I more confused than normal or if I click "Reply" should it go just to the 
sender instead of the list?



Ah, the perennial argument about From address munging! Google for "From address munging 
considered helpful" and "From address munging considered harmful" for more 
information.

https://duckduckgo.com/html/?q=from+address+munging+considered+helpful
https://duckduckgo.com/html/?q=from+address+munging+considered+harmful

In a nutshell, when you send an email to a mailing list, some mailing lists 
leave the From address to your email address, while others edit the From 
address to be the mailing list itself. This mailing list performs no munging, 
so on this list:


Reply -> sender only
Reply All -> sender, and the list CCed
Reply To List (if your email program supports this command) -> list only



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


Re: [Tutor] Coursera Python Course starts today

2013-08-19 Thread Anung Ariwibowo
This should go to the list

Let's discuss our progress then, if it is allowed by list rules. I was
just retake the course as well.

Regards,
Anung


On 8/20/13, Leam Hall  wrote:
> Hey all,
>
> In case I'm not the absolute last person to know, the newest edition of
> the Coursera "Learn to Program" course started today. It is Python
> based, free, lasts 7 weeks, and pretty fun. I didn't get a certificate
> last time as life got in the way. Hope to succeed this time.
>
> https://class.coursera.org/programming1-002/class/index
>
> Leam
>
>
> --
> http://31challenge.net
> http://31challenge.net/insight
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Coursera Python Course starts today

2013-08-19 Thread Anung Ariwibowo
Just started today before catching bus to work. I will start this evening.

Regards,
Anung


On 8/20/13, Leam Hall  wrote:
> A little cooperation is motivating. I have finished up Week 1 but I was
> a few minutes late for work this morning!  :)
>
> You?
>
> Leam
>
> On 08/19/2013 08:12 PM, barli...@gmail.com wrote:
>> Let's discuss our progress then, if it is allowed by list rules. I was
>> just retake the course as well.
>>
>> Regards,
>> Anung
>>
>> Sent from my BlackBerry® smartphone from Sinyal Bagus XL, Nyambung
>> Teruuusss...!
>>
>> -Original Message-
>> From: Leam Hall 
>> Sender: "Tutor" Date: Mon, 19
>> Aug 2013 20:02:25
>> To: 
>> Subject: [Tutor] Coursera Python Course starts today
>>
>> Hey all,
>>
>> In case I'm not the absolute last person to know, the newest edition of
>> the Coursera "Learn to Program" course started today. It is Python
>> based, free, lasts 7 weeks, and pretty fun. I didn't get a certificate
>> last time as life got in the way. Hope to succeed this time.
>>
>> https://class.coursera.org/programming1-002/class/index
>>
>> Leam
>>
> --
> http://31challenge.net
> http://31challenge.net/insight
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor