ing to read the docstring? English majors, grammar nazis, wikipedia
editors, programmers, or all 4?
--
Denis McMahon, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
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
On Wed, 22 May 2013 01:15:27 +, [email protected] 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, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
well the language designers and maintainers
explain the need to break the old scripts.
--
Denis McMahon, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
):
t=t+v(d[0][u])
r=t/10.
print "%s C1: %f R1: %f"%(m,c,r)
--
Denis McMahon, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
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
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, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
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?
--
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.
--
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, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
sysadmin why you
need root access.
--
Denis McMahon, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
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.
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
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, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
'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, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
> 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.
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, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
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?
--
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, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
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...@
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, [email protected]
--
http://mail.python.org/mailman/listin
;re missing the dll that provides some function that you're trying to
use.
--
Denis McMahon, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
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
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, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
;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, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
lp,
Why use Python? Just:
wget -m url
--
Denis McMahon, [email protected]
--
http://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
server to a different site
(eg disaster recovery) UTC is still UTC.
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
, I'll post a corrected version next week.
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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
em facing the
public internet upon which python code is executed in response to inputs
from the public internet.
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
x; ]
otherwise [ new x = perform odd number collatz math on x; ]
display new x to the user;
}
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
ncy for assistance
on decoding the codes.
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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
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
code we may be able to help with that bit.
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
rd ) is hash
solved this hash!
load_dictionary( "dictionary file name" )
get_hashes( "http://www.website.tld/path/file.ext"; )
brute_force()
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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, [email protected]
-
//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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
and more likely to happen.
And yes, I can dovetail, mortise and tenon, dowel etc etc etc.
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
test for whether b[x[0]] eists than
trapping keyError.
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
d the preceding 10 lines or so)
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
gramming newsgroup.
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
ur earlier request.
+1
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
;ll help you bypass them.
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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. [...]
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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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
with machines of the pre-pentium era, although I suspect
that might not be quite accurate either.
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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
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
requirements are.
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
of tools out there that
can be used to reset passwords on various operating systems.
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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
(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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
ch for mysql on the python docs website, or perhaps try
googling "python mysql"?
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
+)\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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
t contain a backdoor that sends copies of all the
plaintext to the NSA?
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
roblem, which is probably why the data you expect to be printed isn't
being printed.
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
n either language, that value might need adjusting
otherwise.
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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.
e midnight, and then converting seconds back into hours, minutes and
seconds.
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
"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
ink the while
condition that leads to the function call is ever fulfilled anyway.
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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)))
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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
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
of software that are not advisable to be developed using Python?
OS Kernels. Hardware drivers.
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
) 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, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
point (given by lat and lon) at that time.
--
Denis McMahon, [email protected]
--
https://mail.python.org/mailman/listinfo/python-list
1 - 100 of 454 matches
Mail list logo