Re: Continuing indentation

2016-03-03 Thread John Gordon
In <871t7sbkex@elektro.pacujo.net> Marko Rauhamaa writes: > Ethan Furman : > > No, it isn't. Using '\' for line continuation is strongly discouraged. > Why would you discourage valid syntax? Some things that are permissible may not be desirable. -- J

Re: list reversal error

2016-03-03 Thread John Gordon
valuates to j = len(data) which would yield 5 for a five-element list, but the last actual element is in data[4]. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears --

Re: password and username code

2016-03-06 Thread John Gordon
inding out if a name is registered? There are lots of possible ways to do it. Do you have one in mind? -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "Th

Re: from a module return a class

2016-03-18 Thread John Gordon
; > callable. promptUser_PWord() has to be a function or a class. > > > Yes, but I guess the OP's program will run into the SyntaxError when > trying to import the module, i.e., before it ever encounters the > TypeError: 'module' object is not callable. Good poi

Re: from a module return a class

2016-03-18 Thread John Gordon
en't callable. promptUser_PWord() has to be a function or a class. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies" -- htt

Re: from a module return a class

2016-03-19 Thread John Gordon
taxError: 'return' outside function Show us the complete definition of promptUser_PWord(). -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "Th

Re: from a module return a class

2016-03-19 Thread John Gordon
It has to be a function or a class. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies" -- https://mail.python.org/mailman/listinfo/python-list

Re: Not downloading

2016-03-23 Thread John Gordon
P, try using an older 3.4 version of Python. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies" -- https://mail.python.org/mailman/listinfo/python-list

Announcing the release of Yosai: a security framework for python applications

2016-03-27 Thread Darin Gordon
Hey Everyone! I am very glad to announce the first release of Yosai, a security framework for python applications. Details, including link to project: http://www.daringordon.com/introducing_yosai Regards Darin -- https://mail.python.org/mailman/listinfo/python-list

Re: Code review

2014-11-04 Thread John Gordon
or two. Some blank lines wouldn't hurt either. Also it would be nice to define some of the terms you're using. What is a blind? What does "in front" mean? What is a "muck hand"? -- John Gordon Imagine what it must be like for a real medical doctor to gor

Trouble getting full response content from PATCH request

2014-11-17 Thread John Gordon
code: %s' % response.status_code print 'response content:' print response.content -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'. -- https://mail.python.org/mailman/listinfo/python-list

Re: How do you download and install HTML5TreeBuilder ?

2014-11-18 Thread John Gordon
;pip install HTML5', three times, with exactly the same result each time. Did you mean to execute the same command three times over? If so, did you expect to get different results the second or third time? -- John Gordon Imagine what it must be like for a real medical doctor to gor...

Re: Trouble getting full response content from PATCH request

2014-11-19 Thread John Gordon
uot; HTTP header with SOAP requests. It may be that > simple. The API does provide some SOAP calls, but the specific call I'm using is REST. Is there a corresponding header I should use? Thanks. -- John Gordon Imagine what it must be like for a real medical doctor to gor.

Re: Dictionary error

2014-11-25 Thread John Gordon
ng zip on two single items, not sequences, and you can't do that. Glancing over the code it appears that you're saving the cell contents in two lists, x and y. Perhaps you meant to call zip on those lists instead of on keys and values? -- John Gordon Imagine what it must be li

Re: Cherrypy - prevent browser "prefetch"?

2014-12-02 Thread John Gordon
ta modifications, but I thought it was allowed for things like logging out of your session. -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'. -- https://mail.python.org/mailman/listinfo/python-list

Re: Parsing XML Using XPATH for Python

2014-12-02 Thread John Gordon
oringCellRelation'): # print the id's of the serving and neighbor cells print("%s--%s" % (serving_cell.attrib['id'], neighbor.attrib['id'])) -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'. -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to schedule my script?

2014-12-17 Thread John Gordon
given time and stop at another given time, > is that possible? You could write a separate program whose only job is to send a STOP or CONTINUE signal to your main program, and then run that program from a scheduler. The standard system "kill" command would probably work for this purp

Re: Is there a way to schedule my script?

2014-12-17 Thread John Gordon
thing common like that? If you're on Unix, 'kill' and 'cron' are already built-in. If you want to solve your problem entirely within Python, look at the "scheduler" module. (Although even this isn't a complete solution, as you still have to make sure the progr

Re: problems with Methods in Python 3.4.2

2014-12-18 Thread John Gordon
> >>> -3 .abs() > AttributeError: 'int' object has no attribute 'abs' Integer objects don't have a built-in function named abs(). If you want the absolute value of an integer, call abs directly, like so: abs(-3) -- John Gordon Imagine what it must

Re: Program calling unwanted functions

2014-12-22 Thread John Gordon
see, every possible logic branch ends up with a call to cameraman(). The kid function doesn't call instructions, but the last line of your script does call it, unconditionally. -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch &#x

Re: cx_Oracle, callfunc and varray

2015-01-09 Thread John Gordon
what I'm doing wrong? Is RETURN INTEGER; allowed? -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'. -- https://mail.python.org/mailman/listinfo/python-list

Re: Concatenate list values

2015-02-23 Thread John Gordon
Any help appreciated big_string = ', '.join(my_list[1:]) -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'. -- https://mail.python.org/mailman/listinfo/python-list

Re: Top down Python

2014-02-11 Thread John Gordon
Sure, it's a little more work for the user, but it will pound any type of nail though a variety of surfaces. I.e., it's reusable. -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to w

Re: How to use logging

2014-02-17 Thread John Gordon
aspect of logging, like sending the output to a file instead of the default destination? -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'. -- https://mail.python.org/mailman/listinfo/python-list

Re: Why is the interpreter is returning a 'reference'?

2014-02-17 Thread John Gordon
thod upper of str object at 0x02283F58>] > Why doesn't the python interpreter just return > ['HI, 'BOSS'] ? > This isn't a big deal, but I am just curious as to why it does this. Because you typed 'str.upper' instead of 'str.upper()'. -

Re: Error getting REMOTE_USER Environment Variable

2014-02-20 Thread John Gordon
rstanding. Is this a bug in the os package that comes > with Python 3.3? Anybody got a fix for it? If there is a bug, it's much more likely to be in the webserver code that sets the REMOTE_USER value. -- John Gordon Imagine what it must be like for a real medical doctor to

Re: The sum of numbers in a line from a file

2014-02-20 Thread John Gordon
sum1 = int(fields[4]) + int(fields[5]) + int(fields[6]) sum2 = int(fields[7]) + int(fields[8]) # compute the averages average1 = sum1 / 3.0 average2 = sum2 / 2.0 # display output print '%s %f %f' % (name, average1, average2) -- John Gordo

Re: Just For Inquiry

2014-02-20 Thread John Gordon
ipated. Communicate with customers to keep them informed of the project's progress. Schedule meetings with the customer as needed. Ensure that a test plan exists and is carried out. Coordinate project delivery and installation. Coordinate bug reports and bugfixes. -- John Gordon Imagine w

Re: intersection, union, difference, symmetric difference for dictionaries

2014-03-01 Thread John Gordon
In mauro writes: > - Dictionaries and sets are both accessed by key As far as I have used sets, they are not accessed by key. >>> x = set([1, 2, 'buckle my shoe']) >>> x set([1, 2, 'buckle my shoe']) >>> 1 in x True >>> 5 in x False

Re: How do I process this?

2014-03-03 Thread John Gordon
nt, like this: t1 = test1.split(',')[0] t2 = test2.split(',')[0] -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'. -- https://mail.python.org/mailman/listinfo/python-list

Re: beautiful soup get class info

2014-03-06 Thread John Gordon
In teddyb...@gmail.com writes: > October 22, 2011 > date1 = soup.span.text > data=soup.find_all(date="value") Try this: soup.find_all(name="span", class="date") -- John Gordon Imagine what it must be like for a real medical doctor to gor..

Re: beautiful soup get class info

2014-03-06 Thread John Gordon
it twice Are there two occurrences of 'March 5, 2014' in the HTML? If so, then beautifulsoup is doing its job correctly. It might help if you posted the sample HTML data you're working with. -- John Gordon Imagine what it must be like for a real medical doctor to g

Re: Oddity using sorted with key

2014-03-11 Thread John Gordon
s the str.lower() function object, which is a silly thing to sort on. Surely you want to sort on the *result* of that function, which is what your second print does. -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House'

Re: unittest weirdness

2014-03-11 Thread John Gordon
haps that's the issue? -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'. -- https://mail.python.org/mailman/listinfo/python-list

Re: DB API question - where is a stored procedure's return value?

2014-03-13 Thread John Gordon
In Petite Abeille writes: > Alternatively=85 if it=92s really a function=85 wrap it in a select = > statement=85 such as: > select foo() as value from dual That will get the return value into an SQL variable, but the OP wanted to know how to fetch it from python code. -- Jo

Re: Ordering in the printout of a dictionary

2014-03-17 Thread John Gordon
repr()), > explicitly iterate over it, like this: > def display(d): > return '{'+','.join('%r: %r'%(key,d[key]) for key in sorted(d))+'}' You could also use the OrderedDict type, which is subclass of dict that preserves insertion order. -- John

Re: Dictionaries

2014-03-20 Thread John Gordon
ulate any items, matching your observed output. -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'. -- https://mail.python.org/mailman/listinfo/python-list

Re: running python 2 vs 3

2014-03-20 Thread John Gordon
#x27;shebang' entry as the first line in the file which specifies the program that shall be executed; -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'. -- https://mail.python.org/mailman/listinfo/python-list

Re: File Path/Global name issue

2014-03-20 Thread John Gordon
ocation to an influence matrix file by using the '-mf' or '--infmat_file' arguments. There are also -d and -l options that do ... something. -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'. -- https://mail.python.org/mailman/listinfo/python-list

Re: Retrieve item deep in dict tree?

2014-04-02 Thread John Gordon
; I'm using Python 2.7. How about three lines? subtree = tree for key in keys: subtree = subtree.get(key) -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python, Linux, and the setuid bit

2014-04-14 Thread John Gordon
f (envp_write < envp_read) > { > memset(envp_write, 0, ((unsigned int) envp_read - > (unsigned int) envp_write)); > } I think it's complaining about casting the char ** objects to unsigned int. -- John Gordon Imagine what it

Re: random.seed question (not reproducing same sequence)

2014-04-15 Thread John Gordon
In Nick Mellor writes: > No "random" module method is used anywhere else while this code is > executing. Are you sure? How did you verify this? -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House',

Re: random.seed question (not reproducing same sequence)

2014-04-15 Thread John Gordon
ucts is %s" % [(rnd.choice(PRODUCTS), rnd.choice(range(10))) for r in range(rnd.randrange(7))]) Run that code sample and see if the results differ when qty is 4 vs 0. -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a

Re: New to Python. For in loops curiosity

2014-05-13 Thread John Gordon
lay.txt as one long string because 'for line in fin:' tells it to read line-by-line. If you want to read the entire contents, use the read() method: file_content = fin.read() -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.com

Re: Putting Py 3.4.1 to work.

2014-05-20 Thread John Gordon
\\lib\\site-packages', > 'C:\\Python34\\Lib\\site-packages\\PySide'] > >>> --- > import PySide > Traceback (most recent call last): > File "", line 1, in > ImportError: No module named 'PySide' Is there a file named __init__.py in the PyS

Re: Advice for choosing correct architecture/tech for a hobby project

2014-05-22 Thread John Gordon
hat do you mean by saying "webbrowser's won't allow client to open hyperlinks with file protocol"? Of course they do. My web browser works just fine with links such as this: foo.html -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwa

Re: Advice for choosing correct architecture/tech for a hobby project

2014-05-22 Thread John Gordon
. Aha! I didn't know that. Now that I think about it, I suppose it makes sense. Perhaps the OP could write a separate application for handling local files, something like: -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch &#x

Re: need help with this code please fix it or at least tell me what im doing wrong

2014-05-28 Thread John Gordon
In <8bc01036-ee9e-4de9-b569-7039dcc05...@googlegroups.com> funky writes: What do you want the program to do? What is it doing instead? Do you get any error messages? Don't just throw code at us and ask us to fix it... -- John Gordon Imagine what it must be like for a r

Re: passing Python assignment value to shell

2014-05-28 Thread John Gordon
e of freecalc_total here>'], stdout=devnull,stderr=subprocess.STDOUT) > devnull.close() I think you can just include freecalc_total directly as part of the argument list, like this: runCommand = subprocess.call(['stressapptest', freecalc_total], stdout=devnull, std

Re: Embedding numpy works once, but not twice??

2014-06-04 Thread John Gordon
; answers. His post title began with "Re: ", so I assume it was a followup to an (possibly expired) original post that did have context. -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer t

Re: ImportError: No module named appengine.ext

2013-07-31 Thread John Gordon
Has the Google App Engine library been installed on your system? -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies" -- http://mail.python.org/mailman/listinfo/python-list

Re: Am I not seeing the Error?

2013-08-12 Thread John Gordon
Process(write2file('./mem/ENGINE_PID', ENGINEPID); You have too many ('s this line. > write2file(SENTEMPPATH, ''); write2file(INPUTMEM, '')); And too many )'s on this one. -- John Gordon A is for Amy, who fell down the sta

Re: Getting a value that follows string.find()

2013-08-14 Thread John Gordon
In <40816fed-38d4-4baa-92cc-c80cd8feb...@googlegroups.com> englishkevin...@gmail.com writes: > I know the title doesn't make much sense, but I didnt know how to explain my > problem. > Anywho, I've opened a page's source in URLLIB > starturlsource = starturlopen.read() > string.find(starturlsou

Re: Replace blanks with letter

2013-08-21 Thread John Gordon
sly, but we don't know what it's *supposed* to do. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies" -- http://ma

Re: What does sys.stdout.flush() do?

2013-08-23 Thread John Gordon
n't necessarily get written right away. In particular, screen output often waits until it receives a newline before displaying anything. flush() makes sure it all gets written *right now*. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is

Re: Monitor key presses in Python?

2013-09-09 Thread John Gordon
a function that waits for the user to press a key and then returns the key that was pressed? Or are you asking for a function that detects whether a key has been pressed at all? -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Bas

Re: Help please, why doesn't it show the next input?

2013-09-10 Thread John Gordon
ust have left that part out. Anyway, I think you're doing two things wrong: 1. You aren't capturing the user's input. The input() function returns the user's input, but you aren't assigning this to a variable; it's just being thrown away. You should call input() li

Re: TypeError in date_parse.py

2013-09-11 Thread John Gordon
e.fromtimestamp(float(start_timestamp)) > end_datetime = datetime.fromtimestamp(float(end_timestamp)) > duration = end_datetime - start_datetime > = What is the type and value of start_timestamp and end_timestamp? -- John Gordon

Re: TypeError in date_parse.py

2013-09-11 Thread John Gordon
In <3d0038fd-00ec-4560-ab0d-06528f838...@googlegroups.com> pestre...@gmail.com writes: > I think it's a float, I see in the code > if request.method == "POST": > end_timestamp = request.POST.get('end_timestamp', None) > start_timestamp = request.POST.get('start_timestamp', None)

Re: Help please, why doesn't it show the next input?

2013-09-11 Thread John Gordon
= "Hello There" >>> y = x.lower() >>> print y hello there -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycr

Re: Parsing an html line and pulling out only numbers that meet a certain criteria

2013-09-11 Thread John Gordon
27;t want to assign it to self.high0? That's easy; assign it to a temporary variable first, and only assign it to self.high0 if it falls in the desired range. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies" -- https://mail.python.org/mailman/listinfo/python-list

Re: Expected an indented block

2013-09-12 Thread John Gordon
also be caused by using a mix of tabs and spaces on the same line. Don't do that. (And by the way, it's generally better to post errors and code as text instead of a screenshot.) -- John Gordon A is for Amy, who fell down the stairs gor...@panix

Re: Another question about JSON

2013-09-13 Thread John Gordon
> to know I've got it) and I try to use the following code: > returnedJSON = json.loads('https://coinbase.com/api/v1/prices/buy') > print returnedString JSON is a notation for exchanging data; it knows nothing about URLs. It's up to you to connect to the URL and read t

Re: Python GUI?

2013-09-13 Thread John Gordon
In <76784bad-cd6d-48f9-b358-54afb2784...@googlegroups.com> eamonn...@gmail.com writes: > they're making programming easier... by not coding as much. Oh well, > guess coding is dead :( Pressing keys on a keyboard was never the hard part of coding. -- John Gordon

Re: Help please, why doesn't it show the next input?

2013-09-13 Thread John Gordon
max_occurrences = 0 themode = None for i in mylist: thecount = mylist.count(i) if thecount > max_occurrences: max_occurrences = thecount themode = i print(themode) -- John Gordon A is for Amy, who fe

Re: Need help to sort out the below code...

2013-09-14 Thread John Gordon
hoice, ".pizza" elif user_choice == 2: print "You have selected", st, ".Steak" -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies" -- https://mail.python.org/mailman/listinfo/python-list

Re: statsmodels.api

2013-09-16 Thread John Gordon
\interpolate\__init__.py", line > 150, in > from .interpolate import * > File "C:\Python33\lib\site-packages\scipy\interpolate\interpolate.py", line > 12, in > import scipy.special as spec > File "C:\Python33\lib\site-packages\scipy\special\__init__.

Re: Suds and Complex Sequences

2013-09-17 Thread John Gordon
he > WSDL calls for a sequence of SubscriberDataTypes (this application is used > to test an insurance companys' rating service). Contact whomever is providing this data and ask them for documentation. -- John Gordon A is for Amy, who fell down the stairs gor...@panix

Re: django admin.py error

2013-09-19 Thread John Gordon
ysite/mysite', > My admin.py file is: > #Adding this app to the admin page. > from django.contrib import admin > from mysite.models import membership, address, status, audio, video, > photos Does /home/gary/ProgramFiles/mysite/mysite/models.py define an obj

Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it?

2013-09-19 Thread John Gordon
;def'. Post the whole program. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies" -- https://mail.python.org/mailman/listinfo/python-list

Re: django admin.py error

2013-09-19 Thread John Gordon
In Gary Roach writes: > On 09/19/2013 11:15 AM, John Gordon wrote: > > Does /home/gary/ProgramFiles/mysite/mysite/models.py define an object > > named 'membership'? > Yes. The following is the top part of the models.py file: q > class Membership(models.M

Re: building an online judge to evaluate Python programs

2013-09-20 Thread John Gordon
master input file and a master output file for each exercise. If the student program's output matches the master output when run from the master input, then it is correct. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com

Re: building an online judge to evaluate Python programs

2013-09-20 Thread John Gordon
mail access from the judge account too. Not sure how to easily do that. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies"

Re: Print statement not printing as it suppose to

2013-09-20 Thread John Gordon
a statement instead of a function. In other words, it is used like this: name = "Bob" print "Hello ", name Because there are parentheses around the text to be printed, your version of python is interpreting it as a tuple. Remove the parentheses and you should be ok.

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread John Gordon
user types the web address directly into their browser, or clicks on a bookmark, or many other ways. Also, obviously, it's up to the browser to truthfully report HTTP_REFERER; the server itself has no idea what page you were on previously. What browser are you using? -- John Gordon

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread John Gordon
e KeyError? Something else? In any case, I'm surprised that doesn't work. That should be the correct way to do it. You could try this: try: referer = os.environ.get('HTTP_REFERER', 'UnknownRef') except KeyError: referer = None if not ref

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread John Gordon
he problem. You can't arbitrarily break a statement into separate lines. If not, then you'll have to post more of the code; the problem isn't on this line. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assa

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread John Gordon
eb server's environment. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies" -- https://mail.python.org/mailman/listinfo/python-list

Re: VERY BASIC HELP

2013-09-30 Thread John Gordon
use you're using a semicolon after the print statement. This code is really two completely separate statements: print "The result is : ";x/y It prints the message and then, as a separate action, it calculates the value of x/y (and then throws that value away, because it isn't ass

Re: Do I really need a web framework?

2013-09-30 Thread John Gordon
handling from scratch, and frankly it was a nightmare. But it wasn't a small project, so yours might be doable. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- E

Re: Receiving 'NAMEERROR:name' when I try and execute my code in DEBUG mode

2013-10-18 Thread John Gordon
ame, so I'm not surprised that you get that error. This entire block of code is conditionally executed upon __name__ being equal to "main"; perhaps that condition is false when the code is run and thus the error is never triggered. -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'. -- https://mail.python.org/mailman/listinfo/python-list

Re: Screenshots in Mac OS X

2013-10-22 Thread John Gordon
it to the clipboard. For other options (such as taking a screenshot of a window or a specific region on the screen), see http://guides.macrumors.com/Taking_Screenshots_in_Mac_OS_X I wonder what this has to do with Python though. -- John Gordon Imagine what it must be like for a real medic

Re: function got multiple values for keyword argument for value

2013-10-30 Thread John Gordon
uot;search()" got multiple keyword argument for value" > I dont follow why I get it when the number of arguments I am calling with the > function call match the parameters in the definition. What type is "value" expected to be? A single item, a list, a dict, etc? -- Jo

Re: Help me with this code PLEASE

2013-11-05 Thread John Gordon
FROM LISTS TO LONG STRINGS SO I CAN STORE SUCCESSFULLY LIST > PYTHON DATATYPE TO MYSQL SCALAR STRING. > EVERYHTIGN I TRIED FAILED. How did it fail? Error message? No results at all? Different results than you wanted? If so, how did they differ? -- John Gordon Imagine what it must be

Re: Help me with this code PLEASE

2013-11-05 Thread John Gordon
21:52 2013] [error] [client 176.92.96.218] visit = > visit.split() > [Tue Nov 05 23:21:52 2013] [error] [client 176.92.96.218] > AttributeError: 'NoneType' object has no attribute 'split' It appears that in the row you're fetching from the visitors table, the &#

Re: Help me with this code PLEASE

2013-11-05 Thread John Gordon
d just before 'visits'? Are you sure refs is null? According to the sample values you gave, refs is 'Europe/Athens'. -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'. -- https://mail.python.org/mailman/listinfo/python-list

Re: Quick question, if you please

2015-03-31 Thread John Gordon
h time? Yes, assuming you have no other software that depends on the older Python version. -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'. -- https://mail.python.org/mailman/listinfo/python-list

Re: instance attribute "a" defined outside __init__

2015-04-01 Thread John Gordon
bar.add(4, 7). 9 is printed by your statement 'print bar.var'. Your program has those statements in that order, so they are printed in that order. Why did you expect a different order? -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch &

Re: seek operation in python

2015-04-29 Thread John Gordon
stake is. Help.! The seek() function doesn't return any data; it just relocates the file pointer. You still have to do a read operation to get data from the new location. -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch &

Re: Json Comaprision

2015-05-06 Thread John Gordon
In pra devOPS writes: > I wanted to compare two json files ignoring few of the keys in the json > files. > Can anybody suggest me few things? Load each json file into a python object, delete the keys you don't care about, and compare the two objects. -- John Gordon I

Re: Can Python function return multiple data?

2015-06-02 Thread John Gordon
quirement? Python functions can return lists, tuples, dictionaries, or any other container-like object. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "

Re: What is the difference between list() and list?

2015-06-02 Thread John Gordon
eting You will get the output 'Hello'. But, if you just REFER to the function, instead of actually CALLING it: greeting = hello print greeting You will get this output: Because you omitted the double parentheses, you're getting the hello function obje

Re: To write headers once with different values in separate row in CSV

2015-06-23 Thread John Gordon
kerows() handles it? (By the way, if your post had included some sample data that illustrates the problem, it would have been much easier to figure out a solution. Instead, we are left guessing at your XML format, and at the particular implementation of flatten_dict().) -- John Gordon

Re: Why does the unit test fail of the pyPDF2 package?

2015-06-24 Thread John Gordon
dit -> Mark. Then use the mouse to select a rectangular area of text. Then right-click the title bar again and select Edit -> Copy. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears

Re: AttributeError: LineLogic instance has no attribute 'probe'

2015-07-27 Thread John Gordon
c class, one of them lacking the probe attribute. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies" -- https://mail.python.org/mailman/listinfo/python-list

Re: AttributeError: LineLogic instance has no attribute 'probe'

2015-07-29 Thread John Gordon
ll result in LineLogic having the default > initialisation i.e. nothing, as the __init__ function is not part of the > class. Ooh, I like your guess better. :-) -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulte

Re: Every character of a string becomes a binding

2015-08-21 Thread John Gordon
ing *is* a sequence, so technically you're passing the correct sort of object as the second argument to execute(). But the SQL statement only asks for one parameter, so sqlite is wondering where it should put the other 39 items. -- John Gordon A is for Amy, who fell down the s

Re: How to decipher error "Nonetype" Error

2015-09-02 Thread John Gordon
In <6c0af13a-a07d-4c29-b1fd-dd53768e6...@googlegroups.com> kbtyo writes: > https://gist.github.com/ahlusar1989/de2381c1fb77e96ae601 Are you sure this is the actual code you're running? Lines 48 and 49 are clearly meant to be comments, but they do not begin with a hash sign. -

Re: Lesson 39 of Learning Python the Hard Way hangs

2015-09-09 Thread John Gordon
= get_slot(aMap, key) > TypeError: 'NoneType' object is not iterable > Execution Successful! Where does the message "Execution Successful!" come from? It seems like you have other code that you haven't shown us. In any case, I saved your code and ran it, and di

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread John Gordon
may not be your problem, as you haven't told us exactly what is going wrong. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Ti

<    1   2   3   4   5   6   7   >