On Mon, Feb 11, 2013 at 11:27 PM, richard kappler wrote:
> I've read the socket docs and admit I find them quite confusing. Can someone
> point me to a/some good beginner tutorials on sockets/networking for me to
> look at?
Try Doug Hellmann's Python Module of the Week:
http://www.doughellmann.c
I want to be able to communicate between a raspberry pi and a laptop
running ubuntu, transferring text from the pi to the laptop. Specifically
the Pi would be running poscketsphinx speech rec and would send the
generated text through the crossover between the two ethernet ports to a
python program
On 12/02/13 01:34, Steven D'Aprano wrote:
If the class keeps a list of all instances, then the class method
could walk the list and operate on each instance in turn. (But why
would you do that?)
Because its how classes work in some languages (like smalltalk).
The class object represents all in
On 12/02/13 10:16, Alan Gauld wrote:
On 11/02/13 22:49, neubyr wrote:
is right approach to implement 'list_by_author' function as a class
method is typically used as an alternative constructor.
Not at all that is only one use case for class methods.
A class method is *any* method that operate
On Mon, Feb 11, 2013 at 6:58 PM, Steven D'Aprano wrote:
> On 11/02/13 16:14, neubyr wrote:
>
>> I have a text file with each line in following format:
>>
>> Book Name, Author Name, Genre, Publication Date
>>
>> I would like to perform following queries on this file:
>> * Get all books written by
On 11/02/13 16:14, neubyr wrote:
I have a text file with each line in following format:
Book Name, Author Name, Genre, Publication Date
I would like to perform following queries on this file:
* Get all books written by an author
* Remove all books of an author
* Get information about a bo
On Mon, Feb 11, 2013 at 5:16 PM, Alan Gauld wrote:
> On 11/02/13 22:49, neubyr wrote:
>
> is right approach to implement 'list_by_author' function as a class
>> method is typically used as an alternative constructor.
>>
>
> Not at all that is only one use case for class methods.
> A class method
On 11/02/13 20:07, Pravya Reddy wrote:
def conversion(inch,cm):
"""returns the value in cm and in."""
return (2.54 * float(inches))
return (float(cm) / 2.54)
return exits the function so the second return statement never gets
executed.
def GetInt(prompt):
"""Returns a n
On 11/02/13 22:49, neubyr wrote:
is right approach to implement 'list_by_author' function as a class
method is typically used as an alternative constructor.
Not at all that is only one use case for class methods.
A class method is *any* method that operates on the whole class of
objects - i.e
On Mon, Feb 11, 2013 at 12:36 PM, Dave Angel wrote:
> On 02/11/2013 01:19 PM, Alan Gauld wrote:
>
>> On 11/02/13 05:14, neubyr wrote:
>>
>>>
>>>
>>>
>>>
>> * How do I associate/relate Book and Author classes so that it will help
>>> me in getting information like 'get list of books written by a
Thank you for your inputs Dave. That's really helpful. Reply in-line below:
On Sun, Feb 10, 2013 at 11:56 PM, Dave Angel wrote:
> On 02/11/2013 12:14 AM, neubyr wrote:
>
>> I have a text file with each line in following format:
>>
>> Book Name, Author Name, Genre, Publication Date
>>
>> I would
Hello,
I used regular expression module of python. I checked binary and denary
numbers. If input is invalid i ask again. I edited your code. Code is below
follow as .
import re
def show_menu():
print("===")
print("1-binary to denary")
print("2-denary to binary")
print("3-e
On 02/11/2013 03:07 PM, Pravya Reddy wrote:
Can you please complete the code.
#!/usr/bin/env python
""" One function receives a value in inches and returns the equivalent
value in
cms like cm = 2.54 * in.The other function receives a value in cms and
returns
the equivalent value in inches like i
Can you please complete the code.
#!/usr/bin/env python
""" One function receives a value in inches and returns the equivalent
value in
cms like cm = 2.54 * in.The other function receives a value in cms and
returns
the equivalent value in inches like in = cm / 2.54."""
def conversion(inch,cm):
On 02/11/2013 01:19 PM, Alan Gauld wrote:
On 11/02/13 05:14, neubyr wrote:
* How do I associate/relate Book and Author classes so that it will help
me in getting information like 'get list of books written by an author'?
Data attribute?
I woudn't have a separate Author class but, if you
On 11/02/13 05:14, neubyr wrote:
I have a text file with each line in following format:
Book Name, Author Name, Genre, Publication Date
I would like to perform following queries on this file:
* Get all books written by an author
* Remove all books of an author
* Get information about a b
Please always provide a meaningful subject line, it helps us find
related posts more easily in future and will stimulate more focused
responses than a no subject message (which implies we are dealing
with a newbie with no net experience and therefore requiring a lot of
time/effort to help)...
On 11/02/13 01:14, Steven D'Aprano wrote:
exit() and quit() (as added by the site.py module) are for interactive use.
aha!
They're mostly there for the benefit of newbies. Experienced developers (at
least in the Unix/Linux world) usually know to exit interactive terminal
apps with Ctrl-D. I
On 11/02/13 04:25, Pai, Yogesh M wrote:
Hi Alan,
Here are the additional details:
Python version: 2.7.3
OS version: Windows 7 -64 bit
I have an application that has a automation layer built in python.
During every subsequent runs, I want to log the process threads and GDI objects
> ( the one y
On Mon, Feb 11, 2013 at 9:06 AM, Pravya Reddy wrote:
> Can you please help me with the code.
>
> #!/usr/bin/env python
> """
> inchtocm.py
>
> """
>
> def Inchtocm(inches):
> """Returns 2.54 * inches"""
> return (2.54 * float(inches_number1))
I don't know if your curriculum talks about w
On 02/11/2013 11:06 AM, Pravya Reddy wrote:
Can you please help me with the code.
#!/usr/bin/env python
"""
inchtocm.py
"""
First, remove that try/except until the code is free of obvious bugs.
It's masking where the error actually occurs. Alternatively, include a
variable there, and print
On 02/11/2013 09:31 AM, Jim Byrnes wrote:
On 02/10/2013 01:10 PM, Joel Goldstick wrote:
On Sun, Feb 10, 2013 at 1:53 PM, Timo wrote:
Op 10-02-13 17:01, Jim Byrnes schreef:
On 02/09/2013 05:46 AM, Albert-Jan Roskam wrote:
- Original Message -
From: Jim Byrnes To: tutor@python
First, pick a good subject header.
By having caught excep ValueError in your mainline code you lose the
opportunity to find out where it came from. If you comment it out you will
see that the function inchtocm(inches) uses inches_number1 in its code. So
you are ignoring the inches that you passe
Can you please help me with the code.
#!/usr/bin/env python
"""
inchtocm.py
"""
def Inchtocm(inches):
"""Returns 2.54 * inches"""
return (2.54 * float(inches_number1))
inches = None
while True:
try:
inches_number1 = input(input("How many inches you want to convert:
"))
Can you please help me with the code.
#!/usr/bin/env python
"""
inchtocm.py
"""
def Inchtocm(inches):
"""Returns 2.54 * inches"""
return (2.54 * float(inches_number1))
inches = None
while True:
try:
inches_number1 = input(input("How many inches you want to convert:
"))
Can You Plaese help me with the code.
#converts temperature to fahrenheit or celsius
def print_options():
print ("Options:")
print (" 'p' print options")
print (" 'c' convert from celsius")
print (" 'f' convert from fahrenheit")
print (" 'q' quit the program")
def celsius_to_
On 02/10/2013 01:10 PM, Joel Goldstick wrote:
On Sun, Feb 10, 2013 at 1:53 PM, Timo wrote:
Op 10-02-13 17:01, Jim Byrnes schreef:
On 02/09/2013 05:46 AM, Albert-Jan Roskam wrote:
- Original Message -
From: Jim Byrnes To: tutor@python.org Cc:
Sent: Saturday, February 9, 2013
On Mon, Feb 11, 2013 at 10:00 AM, Válas Péter wrote:
> 2013/2/11 Dave Angel
>
>> I'd suggest splitting that expression into two separate statements, one
>> that does the read, and the other that decodes. Then you can print the
>> byte-string, and see if it also is truncated, or whether that hap
2013/2/11 Dave Angel
> I'd suggest splitting that expression into two separate statements, one
> that does the read, and the other that decodes. Then you can print the
> byte-string, and see if it also is truncated, or whether that happened
> during the decoding.
>
> Also, if you use print( repr
On 02/11/2013 05:58 AM, Válas Péter wrote:
Hi tutors,
aboard again after a long time.
Welcome back.
http://..._export.php?mehet=1 is a link which exports me some data in CSV
correctly when I click on it in my browser. (It contains personal data,
that's why I dotted.) I want to process it dir
On Sun, Feb 10, 2013 at 11:25 PM, Pai, Yogesh M
wrote:
> I want to log the process threads and GDI objects (the one you see in
> the Windows task manager) in my python code- The idea is to use this
> data to generate a plot to check if the application leaks memory in a
> long run. Although I can u
Hi tutors,
aboard again after a long time.
http://..._export.php?mehet=1 is a link which exports me some data in CSV
correctly when I click on it in my browser. (It contains personal data,
that's why I dotted.) I want to process it directly from Python, excluding
the browser phase.
The following
32 matches
Mail list logo