Re: Style question -- plural of class name?

2013-05-08 Thread Denis McMahon
ing to read the docstring? English majors, grammar nazis, wikipedia editors, programmers, or all 4? -- 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
7; appears when i run the module. It looks to me 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 widge

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: Myth Busters: % "this old style of formatting will eventually be removed from the language"

2013-05-22 Thread Denis McMahon
well the language designers and maintainers explain the need to break the old 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
): t=t+v(d[0][u]) r=t/10. print "%s C1: %f R1: %f"%(m,c,r) -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

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, denis

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

2013-05-27 Thread Denis McMahon
he new file name. Something like the following (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? --

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

2013-05-27 Thread Denis McMahon
w many JSON objects are on each 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. --

Re: Future standard GUI library

2013-05-27 Thread Denis McMahon
u represent an empty list 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? -- 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
sysadmin why you need root access. -- Denis McMahon, denismfmcma...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

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: Redirecting to a third party site with injected HTML

2013-06-10 Thread Denis McMahon
s, javascript etc to point them 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.

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

2013-06-10 Thread Denis McMahon
ings = { "a":1, "b":3, "c":2 } for thing in sorted( things.values() ): 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 k

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

2013-06-12 Thread Denis McMahon
x27;, year ): print "branch 2" elif not re.search( '=', year ): print "branch 3" else: print "branch 4" # testing logic for 8 possible input conditions test("=", "=", "=") test("=", "=", "x") test("=", "x", "=") 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: Creating a Super Simple WWW Link, Copy, & Paste into Spreadsheet Program

2013-06-14 Thread Denis McMahon
as the preferred coding environment 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
't work either of these solutions out 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 few questiosn about encoding

2013-06-14 Thread Denis McMahon
nderstood is this line. > First please tell me 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-14 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
> i cant change my mind easily 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.

Re: Pattern Search Regular Expression

2013-06-15 Thread Denis McMahon
t; No need for a regular expression. > > py> sentence = "By the new group" > py> words = sentence.split() > py> words[1:-1] > ['the', 'new'] > > Does that help? I thought OP wanted: words[words[0],words[-1]] But that might be just my caffeine deprived 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
st = (words[0], words[-1]) Or even: first_and_last = [sentence.split()[i] for i in (0, -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 --

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

2013-06-15 Thread Denis McMahon
ory location and points "b" at that memory 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? --

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

2013-06-16 Thread Denis McMahon
e a web server available to you - 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, de

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 differen

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: 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...@

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/listin

Re: Need explanation of this error

2013-07-01 Thread Denis McMahon
;re missing the dll 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

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 adds an extra half space when reading from a string or list

2013-07-02 Thread Denis McMahon
;s quite clear 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
in a sort 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: Python script help

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

Re: datetime question

2013-11-12 Thread Denis McMahon
On Tue, 12 Nov 2013 12:47:58 +, Andy Lawton wrote: > (I think "Europe/Kiev" is Greece but I don't know) I suspect Nick is really in a coding sweatshop in "Asia/Mumbai" -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: datetime question

2013-11-12 Thread Denis McMahon
server to a different site (eg disaster recovery) UTC is still UTC. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Chinese Zodiac - python project

2013-11-12 Thread Denis McMahon
You should be able to automate creating this list. You could then search through the list of tuples with a function such as: yearname( birthdate ): foreach thing in years if birthdate is in the range specified by the thing return the yearname from the thing return "constipated program" (this is obviously not written as python code, you have to do that bit yourself) -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Some python newb help please?

2013-11-12 Thread Denis McMahon
, I'll post a corrected version next week. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Chinese Zodiac - python project

2013-11-13 Thread Denis McMahon
On Wed, 13 Nov 2013 16:44:03 -0800, edmundicon wrote: > Den tisdagen den 12:e november 2013 kl. 23:50:03 UTC+1 skrev Denis > McMahon: >> On Tue, 12 Nov 2013 14:04:08 -0800, edmundicon wrote: >> >> >> >> > Greetings everyone! This is my first post on th

Re: Trying tcompile an use the Python 3.4a

2013-11-13 Thread Denis McMahon
em facing the public internet upon which python code is executed in response to inputs from the public internet. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: understanding someone else's program

2013-11-15 Thread Denis McMahon
on 'x=(x-32)*5/9' is really "convert temp from fahrenheit to centigrade". As you do this add relevant comments to the code. Eventually you'll have code with sensible variable names and comments that hopefully describe what it does. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Question regarding 2 modules installed via 'pip'

2013-11-16 Thread Denis McMahon
ages here and we all laugh at his ineptitude. I would answer his question, but I foreswore helping him days ago now, you just get too much abuse because (in his opinion) your answer includes excessive whitespace. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Newbie - Trying to Help a Friend

2013-11-19 Thread Denis McMahon
x; ] otherwise [ new x = perform odd number collatz math on x; ] display new x to the user; } -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-22 Thread Denis McMahon
ncy for assistance on decoding the codes. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Newbie - Trying to Help a Friend

2013-11-22 Thread Denis McMahon
On Wed, 20 Nov 2013 11:38:14 +, Duncan Booth wrote: > Denis McMahon wrote: >> 1) Find all the numbers less than n that are not divisible by a, b, or >> c. >> ask the user for x; >> assign the value 0 to some other variable i; >> while i is not greater than

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-23 Thread Denis McMahon
On Sat, 23 Nov 2013 02:18:03 +, Steven D'Aprano wrote: > On Sat, 23 Nov 2013 01:55:44 +0000, Denis McMahon wrote: >> On Fri, 22 Nov 2013 18:22:29 +0530, Bharath Kummar wrote: >>> Could you PLEASE provide me with the codes (codes only for the asked >>> que

Re: Cracking hashes with Python

2013-11-26 Thread Denis McMahon
code we may be able to help with that bit. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Cracking hashes with Python

2013-11-26 Thread Denis McMahon
rd ) is hash solved this hash! load_dictionary( "dictionary file name" ) get_hashes( "http://www.website.tld/path/file.ext"; ) brute_force() -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Cracking hashes with Python

2013-11-27 Thread Denis McMahon
he word and the hash. If you have code to get the hash strings from the web url, it is nuts to output them to the screen and then type them back in to the cracking program when you can just add the code to get them from the web to the cracking program. -- Denis McMahon, denismfmcma...@gmail.com -

Re: The input and output is as wanted, but why error?

2013-12-03 Thread Denis McMahon
//txt.do/1smv That's not source code, it's a url. > Please, I need help. As my newsreader isn't a web browser, I can't help. Sorry. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: interactive help on the base object

2013-12-08 Thread Denis McMahon
less the overwhelming smell of pot that has > been drifting around this thread knocks me unconscious. """ The root class for all Python classes. Its methods are inherited by all classes unless overriden. """ -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-10 Thread Denis McMahon
and more likely to happen. And yes, I can dovetail, mortise and tenon, dowel etc etc etc. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: min max from tuples in list

2013-12-12 Thread Denis McMahon
test for whether b[x[0]] eists than trapping keyError. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: accessing a page which request an openID authentication

2013-12-13 Thread Denis McMahon
On Fri, 13 Dec 2013 02:32:49 -0800, uni.mail.2014 wrote: > I have a page that request an openID authentication And your Python question is? -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: want to run proxy in python

2013-12-13 Thread Denis McMahon
On Fri, 13 Dec 2013 03:39:44 -0800, Jai wrote: > hey , will u guide me how to run proxies from python http://lmgtfy.com/?q=ip+address+spoofing -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: New to Python, Help to get script working?

2013-12-15 Thread Denis McMahon
d the preceding 10 lines or so) -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Want guidance to set proxy please help

2013-12-16 Thread Denis McMahon
gramming newsgroup. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Wrapping around a list in Python.

2013-12-16 Thread Denis McMahon
left to right): from collections import deque q = dequeue([]) def add_to_queue( item, q ): if len( q ) is 4: q.pop() q.appendleft( item ) def get_next( q ): if len( q ) > 0: return q.pop() return None To move from position 3

Re: Web Server for Python

2013-12-16 Thread Denis McMahon
On Mon, 16 Dec 2013 19:20:20 -0800, Mura Zalukhu wrote: > Could you give me the best tutorial / web for python. For example how to > make a connection with database. Which database? Which version of Python? Google may help. So will the Python on-line documentation. -- Denis M

Struggling for inspiration with lists

2013-12-17 Thread Denis McMahon
tart_b = 0 max_len = 0 i = 0 while i < len( d ): j = i + 1 while j < len( d ): o = 0 while j+o < len( d ) and d[i+o][1] == d[j+o][1]: o += 1 if o > max_len: max_len = 0 max_start_a = i max_start_b = j j += 1 i += 1 pr

Re: HOW TO HANDLE CAPTCHA WHILE PARSING A WEB SITE

2013-12-18 Thread Denis McMahon
ur earlier request. +1 -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: how to handle captcha through machanize module or any module

2013-12-18 Thread Denis McMahon
;ll help you bypass them. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Variables in a loop, Newby question

2013-12-24 Thread Denis McMahon
ction that it is working with a global (to the program unit) variable. If you want this process to provide data to other processes, you might want to look at using a socket so they can request it as needed. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Variables in a loop, Newby question

2013-12-25 Thread Denis McMahon
On Wed, 25 Dec 2013 16:42:47 +1100, Cameron Simpson wrote: > On 25Dec2013 02:54, Denis McMahon wrote: >> On Tue, 24 Dec 2013 10:27:13 -0800, vanommen.robert wrote: >> > In this script i want to read the temperatures and make them >> > available to other scripts. [...]

Re: Creating a list with holes

2014-01-03 Thread Denis McMahon
s returning None (or any other default value you care to pass it) as long as you use the dict.get(key[,default]) method rather than dict[key] to return the value. See also: http://stackoverflow.com/questions/6130768/return-none-if-dictionary-key- is-not-available -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Creating a list with holes

2014-01-03 Thread Denis McMahon
None, None, None, None, None, 'jim', None, None, None, None, None, 'susan', None, None, None, None, None, None, None, None, None, 'albert', None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, N

Re: Dos cursor and input management.

2014-01-05 Thread Denis McMahon
with machines of the pre-pentium era, although I suspect that might not be quite accurate either. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Send array back in result from urllib2.urlopen(request, postData)

2014-01-10 Thread Denis McMahon
g in the php: echo $para; would become: echo php_json_encoding_function( para ); and in the python: para = result.read() would become: para = python_json_decoding_function( result.read() ) or possibly even: para = json.decode( result.read() ) (I don't know the details, I'm tr

Re: python first project

2014-01-11 Thread Denis McMahon
e system to do, what data they expect to input, and what data they expect to receive as outputs from it. Once you understand this, you may be in a position to start defining the database schema, and only then are you ready to think about the code that will put data into, and get it from, t

Re: Python example source code

2014-01-12 Thread Denis McMahon
requirements are. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: python adsl script

2014-01-14 Thread Denis McMahon
of tools out there that can be used to reset passwords on various operating systems. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Learning python networking

2014-01-15 Thread Denis McMahon
a json encoded string. You might decide that each message is simply going to end with a specific character or character sequence. Whatever you choose, you need some way for the receiving application to distinguish between individual messages in the stream of octets / bytes / characters that i

Re: Python solve problem with string operation

2014-01-16 Thread Denis McMahon
(len(a))if(n==0 or a[n-1]!=a[n])]) output = ''.join(b) If you really want to do it using just 'string' ops: for i in range(len(input)): if (i==0): output=input[0] elif input[i]!=input[i-1]: output+=input[i] -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Process datafeed in one MySql table and output to another MySql table

2014-01-16 Thread Denis McMahon
ch for mysql on the python docs website, or perhaps try googling "python mysql"? -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: python to enable javascript , tried selinium, ghost, pyQt4 already

2014-01-18 Thread Denis McMahon
sn't make a lot of sense (you'll be trading cpu in the client for cpu in the server + network bandwidth and latency). -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: python to enable javascript , tried selinium, ghost, pyQt4 already

2014-01-18 Thread Denis McMahon
basically impossible > without actually executing the JS code, which means largely replicating > the web browser. Oh, you think he meant scrape? I thought he was trying to scrap (as in throw away / replace) an old javascript heavy website with something using python instead. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Help with simple code that has database defined

2014-01-19 Thread Denis McMahon
idea fast. Or ask your lecturers for advice. Or return the advance you were paid on this coding job, because you don't seem to have the skills to do it. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Separate Address number and name

2014-01-22 Thread Denis McMahon
+)\s+(.*) The assumption is that it's not necessary to hold your hand through the whole looping through the input and applying the re to each line, then reading the captured bits and using them process. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Separate Address number and name

2014-01-22 Thread Denis McMahon
of a search, and the results of a split. I'm also assuming you're capable of working out how to use the csv module from the documentation. If you're not, then either go back and ask your lecturer for help, or tell your boss to hire a real programmer for his quick and easy coding jo

Re: Separate Address number and name

2014-01-23 Thread Denis McMahon
On Wed, 22 Jan 2014 17:35:22 +, Denis McMahon wrote: > On Tue, 21 Jan 2014 16:06:56 -0800, Shane Konings wrote: >> The following is a sample of the data. > A mechanism using regexes Just to follow up, using regexes I transformed the sample data that I believe is as follows

Re: Help with my 8-year old son's first program. I'm stuck!

2014-01-25 Thread Denis McMahon
tion a() Ignore the comment about needing to define the type of file on the first line on linux, it's a red herring. You only need to do that (and possibly chmod the file) on a *nix system if you want to execute it directly as a command, rather than by calling the interpreter on it. I suspect that if you remove the line: "def a():" and un-indent the rest of the text, the program will run just fine. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Need Help with Programming Science Project

2014-01-25 Thread Denis McMahon
author ] elif scores[ author ] == x: names.append( [ author ] ) print "the best matching author(s) is/are: ", names Then all you have to do is find enough ways to calculate stats, and the magic coefficients to use in the stat_weightings -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Lists inside dictionary and how to look for particular value

2014-01-26 Thread Denis McMahon
ement at the level you're trying to observe happens for the most part automatically at the ip stack / network hardware level. Do you think this database of which ip maps to which MAC is actually going to have some human use? If so, what? Or is this some sort of homework exercise as part of a programming course? -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Remove unwanted characters from column

2014-01-27 Thread Denis McMahon
en here: http://www.sined.co.uk/tmp/farms.txt http://www.sined.co.uk/tmp/farms.csv http://www.sined.co.uk/tmp/farms.htm -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: ANN: eGenix pyOpenSSL Distribution 0.13.3.1.0.1.6

2014-01-28 Thread Denis McMahon
t contain a backdoor that sends copies of all the plaintext to the NSA? -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Eclipse IDE printing values automatically

2014-01-29 Thread Denis McMahon
roblem, which is probably why the data you expect to be printed isn't being printed. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Large Two Dimensional Array

2014-01-29 Thread Denis McMahon
n either language, that value might need adjusting otherwise. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Help with some python homework...

2014-01-31 Thread Denis McMahon
paragraph describing what each line of the program does, you'll be on your way to understanding a few of the structures, syntaxes and mechanisms of python. Or you could show it to your lecturer or a TA and say it was suggested that you ask her or him to work through it with you.

Re: Help with some python homework...

2014-02-01 Thread Denis McMahon
e midnight, and then converting seconds back into hours, minutes and seconds. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Help with some python homework...

2014-02-01 Thread Denis McMahon
e Hence: discounted_price = list_price - discount_amount 0.6 * list_price = 1.0 * list_price - 0.4 * list_price so discounted_price = ( 1.0 - 0.4 ) * list_price where 0.4 is the decimal fraction of the discount -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Help with some python homework...

2014-02-02 Thread Denis McMahon
"price_per_book == (price_per_book * 1)" so rhs becomes (price_per_book * 1) - (price_per_book * percent_discount) and "(a * x) - (a * y)" == "a * (x - y)" so rhs becomes price_per_book * (1 - percent_discount) hence: discounted_price = price_per_book * (1 - percent_discount

Re: Calculator Problem

2014-02-02 Thread Denis McMahon
ink the while condition that leads to the function call is ever fulfilled anyway. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: [newbie] making rows of table with discrete values for different number systems

2014-02-03 Thread Denis McMahon
s=3 p=s*2 def b(n,x): s=[] while n: s.append(str(n%x)) n=n/x if s==[]: return "0" return ''.join(s[::-1]) for i in range(s**p): r=("{:0"+str(p)+"d}").format(int(b(i,s)))

Re: Calculator Problem

2014-02-03 Thread Denis McMahon
t;>>> That wasn't obtained from running the code you posted. Your code *as you posted it* gives: $ python charlie.py File "charlie.py", line 4 1 = float(input('First Number:')) SyntaxError: can't assign to literal $ -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: [newbie] troubles with tuples

2014-02-03 Thread Denis McMahon
g from the 0th element, up to and including the element preceding the first element Or [m:n] means starting from the mth element, everything up to and including the element preceding the nth element Are you sure you got (2,) for [0:1] and not for [2:3]? Are you sure your initial tuple is what

Re: What are the kinds of software that are not advisable to be developed using Python?

2014-02-08 Thread Denis McMahon
of software that are not advisable to be developed using Python? OS Kernels. Hardware drivers. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Screen scraper to get all 'a title' elements

2015-11-26 Thread Denis McMahon
) if 'class' in p.attrs] Then you can do this for thing in stuff: print thing (Python 2.7) This may be adaptable to your requirement. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: read 4D binary data

2015-11-26 Thread Denis McMahon
point (given by lat and lon) at that time. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   >