Re: Handling 3 operands in an expression without raising an exception

2013-09-26 Thread Denis McMahon
') is false or Άγνωστη Προέλευση )[0] The you try and get the host name from the ip address Άγνωστη Προέλευση, but Άγνωστη Προέλευση is not an ip address, so you get an error. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Handling 3 operands in an expression without raising an exception

2013-09-26 Thread Denis McMahon
to have. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Handling 3 operands in an expression without raising an exception

2013-09-26 Thread Denis McMahon
: except socket.gaierror as e: city = host = UnKnown Origin To: except socket.gaierror as e: city = Unknown City host = Unknown Host -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Denis McMahon
protocols issue that has nothing whatsoever to do with python. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Help with python functions?

2013-09-24 Thread Denis McMahon
which takes the same params as comp do: def f( t1, u1, t2, u2 ): if u1 == u2: return t2 else: return temp( t2, u2, u1 ) -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Help with python functions?

2013-09-24 Thread Denis McMahon
if they're in different units (2 lines), and then do his comparison (5 lines). -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Help with python functions?

2013-09-24 Thread Denis McMahon
On Tue, 24 Sep 2013 14:51:31 +, Denis McMahon wrote: Question, given the original temp function as previously described by yourself, what does the following function f which takes the same params as comp do: def f( t1, u1, t2, u2 ): if u1 == u2: return t2 else

Re: Help with python functions?

2013-09-23 Thread Denis McMahon
value is the input value. Then to compare T1 in u1 and T2 in u2, convert them both to a common scale (which might be u1 or u2 or some other scale) using your temp function, and then compare the resulting values. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman

Re: Tryign to send mail via a python script by using the local MTA

2013-09-17 Thread Denis McMahon
] The ip address that it is sending ack packets to as part of the smtp session, so unless you're using a proxy somewhere, this will be your system's ip address. Can't fake it. If the other system doesn't know your ip address, it can't send acks, and the tcp session fails. -- Denis McMahon

Re: Tryign to send mail via a python script by using the local MTA

2013-09-17 Thread Denis McMahon
until you understand how tcp/ip networks function. This NG is not a networking for dummies course. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Tryign to send mail via a python script by using the local MTA

2013-09-16 Thread Denis McMahon
to prove communication works, he might be better off using a message subject of test and a message body of this is a test message. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Tryign to send mail via a python script by using the local MTA

2013-09-16 Thread Denis McMahon
IN comp.lang.python -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Tryign to send mail via a python script by using the local MTA

2013-09-16 Thread Denis McMahon
to their spf score. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Am I not seeing the Error?

2013-08-13 Thread Denis McMahon
. -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Using sudo to write to a file as root from a script

2013-08-08 Thread Denis McMahon
/sudoers you must set the permissions back to 440 -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python script help

2013-07-30 Thread Denis McMahon
? Just: wget -m url -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: python adds an extra half space when reading from a string or list

2013-07-02 Thread Denis McMahon
that you're more interested in having arguments and slinging insults than you are in discussing python. I'm here to discuss python. -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing Text file

2013-07-02 Thread Denis McMahon
of pythonic manner, rather than actual python code - also because some newsreaders may break indenting etc, I've used ; as line terminators and {} to group blocks) -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Need explanation of this error

2013-07-01 Thread Denis McMahon
that provides some function that you're trying to use. -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: python adds an extra half space when reading from a string or list

2013-07-01 Thread Denis McMahon
On Mon, 01 Jul 2013 21:18:26 +0200, Antoon Pardon wrote: I am not baiting Nikos. Your opinion, mine differs. all I have done in the last two weeks that involves Nikos as a subject is the Don't feed the troll thread Calling him a troll is baiting. Please stop. -- Denis McMahon

Re: python adds an extra half space when reading from a string or list

2013-07-01 Thread Denis McMahon
On Mon, 01 Jul 2013 20:42:48 +0200, Antoon Pardon wrote: How about the following comprimise. Let me know what you think about this. How about you just ignore him. -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: python game

2013-06-19 Thread Denis McMahon
On Wed, 19 Jun 2013 13:18:49 -0700, jacksonkemp1234 wrote: windowSurface.blit(playerImage, player) for bear in bears: windowSurface.blit(bearImage, bear) Try changing this to draw the bears first, then the player. -- Denis McMahon, denismfmcma...@gmail.com

Re: python game

2013-06-19 Thread Denis McMahon
On Wed, 19 Jun 2013 13:18:49 -0700, jacksonkemp1234 wrote: if moveDown and player.right WINDOW_WIDTH: player.right += MOVE_SPEED Should this be moveRight instead of moveDown? -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python

Re: A certainl part of an if() structure never gets executed.

2013-06-16 Thread Denis McMahon
location, then makes a point to the same memory location as b points to. b is a pointer to a memory location containing the value 6 a is a pointer to the same memory location Do you understand the difference? -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo

Re: Why 'files.py' does not print the filenames into a table format?

2013-06-16 Thread Denis McMahon
- you could put both code (just append .txt to the filename) and screenshots from your browser there with no difficulty at all and just include links. -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Why 'files.py' does not print the filenames into a table format?

2013-06-16 Thread Denis McMahon
On Sun, 16 Jun 2013 11:35:12 +0300, Nick the Gr33k wrote: TB behaves for me the same way. Any line 80 chars gets a newline. Why this is happening? Why not post up to 256 chars in a single line? Because this is usenet. Read the RFCs if you must know! -- Denis McMahon, denismfmcma

Re: A certainl part of an if() structure never gets executed.

2013-06-16 Thread Denis McMahon
On Sun, 16 Jun 2013 11:07:12 +0300, Nick the Gr33k wrote: On 16/6/2013 9:32 πμ, Denis McMahon wrote: On Sat, 15 Jun 2013 19:18:53 +0300, Nick the Gr33k wrote: In both situations we still have 2 memory units holding values, so hows that different? Consider that each named variable

Re: A certainl part of an if() structure never gets executed.

2013-06-16 Thread Denis McMahon
On Sun, 16 Jun 2013 12:59:00 +0300, Nick the Gr33k wrote: Whats the difference of interpreting to compiling ? OK, I give up! -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: A few questiosn about encoding

2013-06-15 Thread Denis McMahon
what is a byte value Seriously? You don't understand the term byte? And you're the support desk for a webhosting company? -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Don't feed the troll...

2013-06-15 Thread Denis McMahon
On Fri, 14 Jun 2013 12:32:56 +0300, Nick the Gr33k wrote: I'mm not trolling man, i just have hard time understanding why numbers acts as strings. It depends on the context. -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Eval of expr with 'or' and 'and' within

2013-06-15 Thread Denis McMahon
that it works in another fashon(only if the counter-arguments are strong). Then you need to stop trying to write python code, because you refuse to accept how python works, and python is not going to change for you! -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman

Re: Pattern Search Regular Expression

2013-06-15 Thread Denis McMahon
misinterpretation of his terminology. -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Pattern Search Regular Expression

2013-06-15 Thread Denis McMahon
, -1)] middle = sentence.split()[1:-2] -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Pattern Search Regular Expression

2013-06-15 Thread Denis McMahon
On Sat, 15 Jun 2013 13:41:21 +, Denis McMahon wrote: first_and_last = [sentence.split()[i] for i in (0, -1)] middle = sentence.split()[1:-2] Bugger! That last is actually: sentence.split()[1:-1] It just looks like a two. -- Denis McMahon, denismfmcma...@gmail.com -- http

Re: Creating a Super Simple WWW Link, Copy, Paste into Spreadsheet Program

2013-06-14 Thread Denis McMahon
for such things in ms office? A quick google finds me vb code to download a url into a string - presumably once you've done that you can find the value you want to scrape into your spreadsheet. -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: A certainl part of an if() structure never gets executed.

2013-06-14 Thread Denis McMahon
on your own, perhaps the really important question you need to be asking yourself right now is should I even be trying to code this in python when my basic knowledge of python coding is so poor? -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: A certainl part of an if() structure never gets executed.

2013-06-12 Thread Denis McMahon
, =) test(=, x, x) test(x, =, =) test(x, =, x) test(x, x, =) test(x, x, x) -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Redirecting to a third party site with injected HTML

2013-06-10 Thread Denis McMahon
back at the host server, or some script on your server that can obtain and serve the appropriate resources. Alternatively, how about displaying the third party website in an iframe within your own document? Although that's not really pythonic, just htmlic. -- Denis McMahon, denismfmcma

Re: Sorting a set works, sorting a dictionary fails ?

2013-06-10 Thread Denis McMahon
() ): print thing Prints 1, 2, 3 for thing in sorted( things.keys() ): print thing Prints a, b, c Now although things[b] is a valid reference because b is a key in a key - value pair, things[3] is not a valid reference, because 3 is not a key in a key - value pair. -- Denis McMahon

Re: AES 128 bits

2013-06-03 Thread Denis McMahon
On Tue, 04 Jun 2013 07:52:17 +0800, usman mjoda wrote: Good day everyone, I need assistance for python codes of aes 128 bits key that can be run on SAGE Application. Thanks google pycrypto -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Create a file in /etc/ as a non-root user

2013-06-01 Thread Denis McMahon
need root access. -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create new python file with increament number, if doesn't exist?

2013-05-27 Thread Denis McMahon
(untested) with the relevant imports etc: nfn=data0.0.+str(max([int(f[8:])for f in os.listdir(p)if re.match ('^data0.0.[0-9]+$',f)])+1) -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: how to compare two json file line by line using python?

2013-05-27 Thread Denis McMahon
On Sun, 26 May 2013 21:32:40 -0700, Avnesh Shakya wrote: how to compare two json file line by line using python? Actually I am doing it in this way.. Oh what a lot of homework you have today. Did you ever stop to think what the easiest way to compare two json datasets is? -- Denis

Re: Reading *.json from URL - json.loads() versus urllib.urlopen.readlines()

2013-05-27 Thread Denis McMahon
line? Your code at (1) creates a single list of all the json objects The code you replied to loaded each object, assumed you did something with it, and then over-wrote it with the next one. As for (2) - either inspection, or errors from the json parser. -- Denis McMahon, denismfmcma

Re: Future standard GUI library

2013-05-27 Thread Denis McMahon
named Foo? The same way. How do you represent an empty dict/mapping named Foo? Lemme look up my documentation... ah, the same way. Does this seem right to you?/JubalEarly Foo type=list / Foo type=mapping / Foo type=string / -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org

Re: file I/O and arithmetic calculation

2013-05-23 Thread Denis McMahon
On Thu, 23 May 2013 07:17:58 -0700, Keira Wilson wrote: Dear all who involved with responding to my question - Thank you so much for your nice code which really helped me. Hold on a sec? Someone posted code that gave the correct answer to a homework question? -- Denis McMahon, denismfmcma

Re: Myth Busters: % this old style of formatting will eventually be removed from the language

2013-05-22 Thread Denis McMahon
scripts. -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: file I/O and arithmetic calculation

2013-05-22 Thread Denis McMahon
) -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: A computer programmer, web developer and network admin resume

2013-05-21 Thread Denis McMahon
On Wed, 22 May 2013 01:15:27 +, i...@databaseprograms.biz wrote: If you would like this in text format instead, please let me know. What if we don't want it at all? -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: in need of some help regarding my rock paper scissors game

2013-05-13 Thread Denis McMahon
as if bWater is an integer value and doesn't have a .clicked attribute. Where is bWater assigned, and what is it assigned to? If you have a clickable water widget of some sort in your gui, what is the click handler for that widget defined as? -- Denis McMahon, denismfmcma...@gmail.com -- http

Re: Style question -- plural of class name?

2013-05-08 Thread Denis McMahon
to change the spelling of the class name to make it plural. I wouldn't use an apostrophe for pluralisation. The Normal pluralisation of FooEntry would be FooEntries. Who are you expecting to read the docstring? English majors, grammar nazis, wikipedia editors, programmers, or all 4? -- Denis

Re: repeat program

2013-04-29 Thread Denis McMahon
it is probably your homework task, so I really shouldn't tell you any more than that. Also, I might not be right about where you need to make the change, but hey, this is the internet, it must be right, yeah? -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo

Re: Pythonic way to count sequences

2013-04-25 Thread Denis McMahon
) ) and isinstance( thing[1], ( int, long) ): if thing in bits: bits[thing] += 1 else: bits[thing] = 1 -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Lists and arrays

2013-04-23 Thread Denis McMahon
] + arr1[2:4] + arr1[5:] print arr2 # output is: ['a', 1, 3] print arr3 # output is: ['a', 'c', 1, 3] -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5