Re: [Tutor] Finding Hostname-IP DNS mappings and if machine is dead or alive

2014-05-12 Thread Emile van Sebille
How far have you gotten? Post your code to show us where you're at and we can point you in the right direction. Emile On 5/12/2014 2:44 PM, KIRAN D.S. wrote: Hi, I have a UNIX shell script that: a. lists out the Hostname-IP DNS mappings b. checks whether the machine is pingable

Re: [Tutor] (no subject)

2014-05-15 Thread Emile van Sebille
grade = "C" elif curraverage >= 60: grade = "D" else: grade = "F" lettergrades.append(grade) HTH, Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How does one construct a module for import?

2014-06-02 Thread Emile van Sebille
e. so you've likely done something like: import xyz xyz(a,b,c,d,e...,rationvtorc) when you should be doing something like: import xyz xyz.callable(a,b,c,d,e...,rationvtorc) HTH, Emile 528 529 plotDataV2(cycles, AdvancedCapital, lnAdvancedCapital, RealisedCapital,

Re: [Tutor] What are your favourite unofficial resources

2014-06-30 Thread Emile van Sebille
ff finally. >sigh< Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] What are your favourite unofficial resources

2014-06-30 Thread Emile van Sebille
ff finally. >sigh< Hi Emile, I do not know what you are referring to. Can you be more specific? Are you referring to comp.lang.python, or a different newsgroup, or something else entirely? Are you talking about a particular mailing list? See http://en.wikipedia.org/wiki/Google_Groups fo

Re: [Tutor] What are your favourite unofficial resources

2014-06-30 Thread Emile van Sebille
obably of similar quality. Well, in that case I'd put forward effbot's guide to the python standard library, particularly for python 2.x, but most of the examples are still valid. I paid for it back in the day, but now it's available on-line at http://effbot.org/librarybook/ Emile

Re: [Tutor] Why is Quick Search at docs.Python.org so useless?

2014-07-06 Thread Emile van Sebille
On 7/5/2014 11:40 AM, Deb Wyatt wrote: I'd be using a news reader if accessing news was still free. Try news.gmane.org. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/ma

Re: [Tutor] Python Socket Error: Connection refused

2014-07-07 Thread Emile van Sebille
he options tab of the cmd.exe properties. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] subprocess.call not formatting date

2014-07-08 Thread Emile van Sebille
e must be an integer") TypeError: bufsize must be an integer Any suggestions, please? Pass in the formatted string using the python datetime module. datetime.datetime.today().strftime("%y-%m-%d_%H-%M") see https://docs.python.org/2/library/datetime.html for more details. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Security and Reliability of Python

2014-07-24 Thread Emile van Sebille
#x27;s as secure and reliable as we need it to be. :) Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Read a file, Load a dictionary

2014-07-24 Thread Emile van Sebille
Comma Separated Value (CSV) files... and then load it into a dictionary. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Using subprocess on a series of files with spaces

2014-07-31 Thread Emile van Sebille
You might try using '"%s"' % filename so that the name is within quotes for the shell environment. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] import values, calculate distance

2014-08-21 Thread Emile van Sebille
I think would be to call these things: > id, x, y > Minor nit: better still would be: code, x, y so as not to shadow the builtin id Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] import values, calculate distance

2014-08-21 Thread Emile van Sebille
I think would be to call these things: > id, x, y > Minor nit: better still would be: code, x, y so as not to shadow the builtin id Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Shorter way for a little program

2014-08-24 Thread Emile van Sebille
On 8/23/2014 7:16 AM, Mimi Ou Yang wrote: age = input("K") age = int(age) if (age == 1) or (age == 2) or (age == 3) or (age == 4): print ("LOL") else: print ("K") Is there a shorter way to do this program??? print ('LOL','K')[int(input("k"))>4] ___

Re: [Tutor] How to count vehicle? I'm trying but my code don't increasing..

2014-09-03 Thread Emile van Sebille
On 9/2/2014 7:01 AM, Whees Northbee wrote: If all of these confusing, I'll simplify the problem, I need to know if a point (x,y) exactly at a line where line is (ax1,ay) to (ax2,ay).. Can someone tell me how?? if ax1https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Problem understanding the asarray function of numpy

2014-09-11 Thread Emile van Sebille
ameter for the sum builtin -- this sum function comes from numpy. See http://docs.scipy.org/doc/numpy/reference/generated/numpy.sum.html for details. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https

Re: [Tutor] Learning python scripts for practical linux activities.

2015-01-15 Thread Emile van Sebille
ython scripts that incorporate "LAME" for modifying audio files. Anything of that nature. As I learn Python, I would like to create Python utilities. I'm hoping there is some learning material that might lead me in that direction. Sincere thanks d Check out http://it-ebooks.i

Re: [Tutor] Why is an instance smaller than the sum of its components?

2015-02-03 Thread Emile van Sebille
On 2/3/2015 1:12 PM, Jugurtha Hadjar wrote: Hello, I was writing something and thought: Since the class had some 'constants', and multiple instances would be created, I assume that each instance would have its own data. So this would mean duplication of the same constants? If so, I thought why n

Re: [Tutor] Topic focus of ‘python-tutor’

2015-02-19 Thread Emile van Sebille
On 2/19/2015 1:51 AM, James Chapman wrote: No one should *_EVER_ *be discouraged to ask a question they do not know have not found the answer to. Learning where to look and how to ask are likely more important skills for a programmer than learning any one specific language. Emile

Re: [Tutor] (no subject)

2015-02-19 Thread Emile van Sebille
On 2/19/2015 9:23 AM, rakesh sharma wrote: Greetings !! Hi all, what the meaning of the line at the start of the python file __author__ = "user" Googling __author__ provides lots of relevant info. Emile ___ Tutor maillist - Tutor@pyt

Re: [Tutor] updating a dictionary

2015-02-19 Thread Emile van Sebille
dict['Cell'] = site dict[band] = dl_prb_utl inFileOne.close(); Perhaps if you provide a sample of what the contents of inFileOne look like and what you want dict to look like after each iteration we'd get a better idea of what you're trying to accomplish. As it is, it'd likely take someone who recognizes the problem domain to shed light on this. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] updating a dictionary

2015-02-19 Thread Emile van Sebille
On 2/19/2015 3:10 PM, Alan Gauld wrote: On 19/02/15 22:50, Emile van Sebille wrote: if cell.endswith(suffix, 14, 16) is False: ... so they'll never end with numeric values. Further, "".endswith() accepts only one argument so you ought to get an error on this line. Sorr

Re: [Tutor] Request review: A DSL for scraping a web page

2015-04-02 Thread Emile van Sebille
On 4/2/2015 4:22 AM, Dave Angel wrote: There was somewhere in one of the books a list of 'good practice,' including an item something like: Solve the right problem. There's a world of wisdom in that one alone. +1 Emile ___

Re: [Tutor] Matrix bug

2015-04-05 Thread Emile van Sebille
>> a[1][1]=1 >>> a [[0, 0, 0], [0, 1, 0], [0, 0, 0]] >>> hth, Emile a [[0, 0, 0], [0, 0, 0], [0, 0, 0]] a[0][0]=1 a [[1, 0, 0], [1, 0, 0], [1, 0, 0]] The code assigned to "1" a(0,0), a(1,0) and a(2,0). It was expected: [[1, 0, 0], [0, 0, 0], [0, 0,

Re: [Tutor] Why is it invalid syntax to have a particular dictionary value as an argument?

2015-04-06 Thread Emile van Sebille
pass a particular dictionary value in a function? Or does it require a different form to do so? Maybe this form helps: Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information.

Re: [Tutor] Why is it invalid syntax to have a particular dictionary value as an argument?

2015-04-07 Thread Emile van Sebille
On 4/6/2015 12:42 PM, Dave Angel wrote: On 04/06/2015 03:20 PM, Emile van Sebille wrote: Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> d = {

<    1   2   3   4   5   6