Re: [Tutor] mySQL and Python

2015-02-18 Thread Mark Lawrence
On 18/02/2015 23:43, Beatrice Perez wrote: Don't worry, thanks everyone for the reply. I realize that the question was very general but I was looking for pointers which is exactly what you guys have given me. Now I know what to read, where to start. --Beatrice On Wed, Feb 18, 2015 at 9:14 PM, D

Re: [Tutor] mySQL and Python

2015-02-18 Thread Beatrice Perez
Don't worry, thanks everyone for the reply. I realize that the question was very general but I was looking for pointers which is exactly what you guys have given me. Now I know what to read, where to start. --Beatrice On Wed, Feb 18, 2015 at 9:14 PM, Danny Yoo wrote: > >> I recommend using the

Re: [Tutor] Suggestions on pyserial for RS232 com monitor?

2015-02-18 Thread Ben Finney
dw writes: > I have a project where I'm sending serial data to a Ten-Tec RX320 radio > receiver. You will likely get a better response on our general Python discussion forum https://www.python.org/community/lists/#comp-lang-python>. This forum is focussed on tutoring newcomers in programming Py

Re: [Tutor] mySQL and Python

2015-02-18 Thread Alan Gauld
On 18/02/15 15:24, James Chapman wrote: One of my pet hates about this list... "This is a tutor list, your question is out of scope". Sure there might be better places to seek answers, and sure maybe the first responder doesn't know the answer, but that's not a reason to respond with that phrase.

Re: [Tutor] Suggestions on pyserial for RS232 com monitor?

2015-02-18 Thread Raúl
I have never worked with serial ports on python, but have you taken a look on http://pyserial.sourceforge.net Regards, Raúl > On 18 Feb 2015, at 16:18, dw wrote: > > Hi Python Gang. > I have a project where I'm sending serial data to a Ten-Tec RX320 radio > receiver. > I'm using COM2 @1200 bau

[Tutor] Suggestions on pyserial for RS232 com monitor?

2015-02-18 Thread dw
Hi Python Gang. I have a project where I'm sending serial data to a Ten-Tec RX320 radio receiver. I'm using COM2 @1200 baud(standard N,8,1 parameters). I have a need to verify the data that I'm sending to the device. It occurred to me that python installed on a laptop might be a great idea. I c

Re: [Tutor] mySQL and Python

2015-02-18 Thread Danny Yoo
>> I recommend using the official MySQL connector because it's supported by >> MySQL and it's continuously developed, which means it won't stop working >> when you change Python versions, or MySQL versions, and it's documented. >> I've tried some other MySQL libs in the past that worked OK but were

Re: [Tutor] unittest for: Raises an exception

2015-02-18 Thread Ben Finney
Sydney Shall writes: > My test code is the following: > > def test_func_getSurplusLabourTime_Exc(self): > > self.assertRaises(ValueError,self.cwp.getSurplusLabourTime(self.cwp.ww,self.cwp.uvc)) > > > [This last line should indented, but it refuses to do so!] What is “it” which refuses to inden

[Tutor] Topic focus of ‘python-tutor’ (was: mySQL and Python)

2015-02-18 Thread Ben Finney
James Chapman writes: > One of my pet hates about this list... "This is a tutor list, your > question is out of scope". Sure there might be better places to seek > answers, and sure maybe the first responder doesn't know the answer, > but that's not a reason to respond with that phrase. You're r

Re: [Tutor] mySQL and Python

2015-02-18 Thread Danny Yoo
On Wed, Feb 18, 2015 at 7:24 AM, James Chapman wrote: > One of my pet hates about this list... "This is a tutor list, your question > is out of scope". Sure there might be better places to seek answers, and > sure maybe the first responder doesn't know the answer, but that's not a > reason to resp

Re: [Tutor] unittest for: Raises an exception

2015-02-18 Thread Raúl Cumplido
Hi, When using self.assertRaises like this you should pass a callable (the function you are going to call), but not call the function on the test. The problem is when the function takes arguments. At this point you need to create a callable with the two arguments. That can be done with functools b

[Tutor] unittest for: Raises an exception

2015-02-18 Thread Sydney Shall
I use a MAC OSX 10.9.5 Enthought Canopy Python 2.7.6 I am a learner. I am now trying to learn unittests as is often emphasised on this list. I think that I have understood the simple unit tests such as Equal, Greater etc. But I am struggling with the syntax of a test for Raises an exception.

Re: [Tutor] Python 3 simple socket issue

2015-02-18 Thread Juan C.
The code is fine, the email should have ruined the indentation. Anyway, indeed, I only saw the 403 error and didn't even read the rest as I thought it was only HTML/CSS code, my bad. Tried with other pages and everything is working, thanks. ___ Tutor mai

Re: [Tutor] Python 3 simple socket issue

2015-02-18 Thread Dave Angel
On 02/18/2015 10:48 AM, Juan C. wrote: Code: # !/usr/bin/env python3 # -*- coding: utf-8 -*- import socket def main(): target_host = 'www.google.com' target_port = 80 client = socket.socket() client.connect((target_host, target_port)) client.send(b"GET HTTP/1.1\r\nHost:google.com\r\n\r\n") r

Re: [Tutor] Python 3 simple socket issue

2015-02-18 Thread Zachary Ware
On Wed, Feb 18, 2015 at 9:48 AM, Juan C. wrote: > We\'re sorry.. but your computer or network may be > sending automated queries. To protect our users, we can\'t process your > request right now.See https://support.google.com/websearch/answer/86640";>Google Help for more > information.https://

Re: [Tutor] mySQL and Python

2015-02-18 Thread boB Stepp
On Wed, Feb 18, 2015 at 9:24 AM, James Chapman wrote: > One of my pet hates about this list... "This is a tutor list, your question > is out of scope". Sure there might be better places to seek answers, and > sure maybe the first responder doesn't know the answer, but that's not a > reason to resp

[Tutor] Python 3 simple socket issue

2015-02-18 Thread Juan C.
Code: # !/usr/bin/env python3 # -*- coding: utf-8 -*- import socket def main(): target_host = 'www.google.com' target_port = 80 client = socket.socket() client.connect((target_host, target_port)) client.send(b"GET HTTP/1.1\r\nHost:google.com\r\n\r\n") response = client.recv(4096) print(respons

Re: [Tutor] mySQL and Python

2015-02-18 Thread James Chapman
One of my pet hates about this list... "This is a tutor list, your question is out of scope". Sure there might be better places to seek answers, and sure maybe the first responder doesn't know the answer, but that's not a reason to respond with that phrase. This list is a called python tutor, not p

Re: [Tutor] OT: Preferred email client for sending plain text programming code snippets

2015-02-18 Thread Alan Gauld
On 18/02/15 12:09, Sydney Shall wrote: Could you give us or point us towards some simple instructions as how one uses gmane.comp.python.tutor with Thunderbird. I had a go and I have found it daunting. Create a new news account (File-New-OtherAccount) Enter your details, click next Enter the g

Re: [Tutor] OT: Preferred email client for sending plain text programming code snippets

2015-02-18 Thread Sydney Shall
On 18/02/2015 03:48, Mark Lawrence wrote: On 17/02/2015 23:23, boB Stepp wrote: Hopefully this is not a touchy subject like Emacs vs. Vim. ~(:>)) My home PC uses Win7-64bit. I currently use Chrome, Gmail and have a Nexus 5 phone. The nice thing about all of this is that all of my information us

Re: [Tutor] monkey patching question

2015-02-18 Thread Albert-Jan Roskam
- Original Message - > From: Dave Angel > To: tutor@python.org > Cc: > Sent: Tuesday, February 17, 2015 11:50 PM > Subject: Re: [Tutor] monkey patching question > > On 02/17/2015 04:53 PM, Albert-Jan Roskam wrote: >> Hi, >> >> I would like to monkey patch a function 'decode' that i

Re: [Tutor] text file help

2015-02-18 Thread Alan Gauld
On 18/02/15 07:50, Tihomir Zjajic wrote: How can I get this ; kl_number = 1202, kl_number = 1403, kl_number = 1802, kl_number = 2801, kl_number = 2502, kl_number = 2303, kl_number = 2254, kl_number = 1682, kl_number = 1403 kl_number = 1304, from text file(formular doznake) . I got this on this