Re: Lesson 39 of Learning Python the Hard Way hangs

2015-09-09 Thread John Gordon
us. In any case, I saved your code and ran it, and did not get an error. -- 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: How to decipher error "Nonetype" Error

2015-09-02 Thread John Gordon
ey do not begin with a hash sign. -- 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: Every character of a string becomes a binding

2015-08-21 Thread John Gordon
(). 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 stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey

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

2015-07-29 Thread John Gordon
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, assaulted by bears -- Edward

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

2015-07-27 Thread John Gordon
of the LineLogic 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

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

2015-06-24 Thread John Gordon
- 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: To write headers once with different values in separate row in CSV

2015-06-23 Thread John Gordon
of flatten_dict().) -- 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: What is the difference between list() and list?

2015-06-02 Thread John Gordon
of that function. -- 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: Can Python function return multiple data?

2015-06-02 Thread John Gordon
? 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, The Gashlycrumb

Re: Json Comaprision

2015-05-06 Thread John Gordon
, and compare the two objects. -- 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: seek operation in python

2015-04-29 Thread John Gordon
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 'House', or a real serial killer to watch 'Dexter'. -- https

Re: instance attribute a defined outside __init__

2015-04-01 Thread John Gordon
'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 'House', or a real serial killer to watch 'Dexter

Re: Quick question, if you please

2015-03-31 Thread John Gordon
to update. Should I be able to uninstall the old version each 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

Re: Concatenate list values

2015-02-23 Thread John Gordon
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: cx_Oracle, callfunc and varray

2015-01-09 Thread John Gordon
SIMPLEPACKAGE; / Any ideas 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: Program calling unwanted functions

2014-12-22 Thread John Gordon
it to do. As far as I can 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

Re: problems with Methods in Python 3.4.2

2014-12-18 Thread John Gordon
of _builtins_. -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 be like for a real medical doctor

Re: Is there a way to schedule my script?

2014-12-17 Thread John Gordon
access to your main program's process 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
in the first place...) -- 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: Cherrypy - prevent browser prefetch?

2014-12-02 Thread John Gordon
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

Re: Parsing XML Using XPATH for Python

2014-12-02 Thread John Gordon
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: Dictionary error

2014-11-25 Thread John Gordon
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 like for a real medical doctor

Re: Trouble getting full response content from PATCH request

2014-11-19 Thread John Gordon
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...@panix.comwatch 'House

Re: How do you download and install HTML5TreeBuilder ?

2014-11-18 Thread John Gordon
typing the same command, '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

Trouble getting full response content from PATCH request

2014-11-17 Thread John Gordon
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: Code review

2014-11-04 Thread John Gordon
. Seriously. Every line 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...@panix.com

Re: Building lists

2014-10-20 Thread John Gordon
: # start with an empty list shopping_list = [] # make a 'cheese' item cheese = ('Cheese', { 'Walmart' : 5.00, 'Publix': 5.50, 'Costco': 4.99 } ) # add cheese to the shopping list shopping_list.append(cheese) -- John

Re: How to select every other line from a text file?

2014-10-13 Thread John Gordon
the loop over and read another line. -- 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 on Linux

2014-10-09 Thread John Gordon
In mailman.14733.1412914913.18130.python-l...@python.org Igor Korot ikoro...@gmail.com writes: sys.path.append('~/MyLib') I.e., will '~' sign be expanded correctly? Not as written. Use os.path.expanduser() to get user's home directories. -- John Gordon Imagine what it must be like

Re: how to write a html to automatically display the dictionary?

2014-09-23 Thread John Gordon
. -- 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: Flask and Python 3

2014-09-23 Thread John Gordon
is certainly a typo. I typed everything correct,acessing http://localhost:8000 works, but http://localhost:8000/blog/post/ gives me ' 500 Internal Server Error '. Why? Have you looked in the http server error log for an explanatory error message? -- John Gordon Imagine what it must be like

Re: hashlib suddenly broken

2014-09-18 Thread John Gordon
, but that doesn't seem to be the case: Perhaps hashlib imports some other module which has a local module of the same name? SHA1 has been deprecated for some time. Maybe a recent OS update finally got rid of it altogether? -- John Gordon Imagine what it must be like for a real medical doctor

Re: hashlib suddenly broken

2014-09-18 Thread John Gordon
('unsupported hash type %s' % name) ValueError: unsupported hash type sha1 Could there be two different versions of hashlib.py on your system? -- 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

Re: My backwards logic

2014-09-05 Thread John Gordon
that function within your while loop. -- 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 is going to be hard

2014-09-03 Thread John Gordon
out of range There are fewer than 13 items in steve, so when x reaches 13 this error pops up. -- 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

Re: problem on top-post

2014-08-15 Thread John Gordon
was unaware of that meaning. -- 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: Unicode in cgi-script with apache2

2014-08-15 Thread John Gordon
display exactly where the error occurs within the script. Which line is it? -- 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: problem on top-post

2014-08-14 Thread John Gordon
. -- 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: Need simple Python Script

2014-08-13 Thread John Gordon
anybody have any solution? I use command prompt and gedit to learn python. What is the script supposed to *do* with the image file? -- 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

Re: why i can't copy mail with imaplib?

2014-08-10 Thread John Gordon
In mailman.12821.1407690877.18130.python-l...@python.org luofeiyu elearn2...@gmail.com writes: self.con.select(inbox) self.con.copy(b1,[Gmail]/kc2JgQ-]) why i can not copy the first email into my important mailbox? What happens when you run the above code? Do you get an error? -- John

Re: Ground Up Python/Xpath lessons

2014-08-09 Thread John Gordon
find, only tells you very basic examples, I'm confused -- don't you *want* very basic examples? they don't really teach you assuming you know nothing. Try http://www.w3schools.com/xpath/xpath_intro.asp -- John Gordon Imagine what it must be like for a real medical doctor to gor

Re: how to get the subject of email?

2014-08-09 Thread John Gordon
/19508393/python-email-parsing-issue for a question very similar to yours. Perhaps something in the code will help. -- 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

Re: Newbie needing some help

2014-08-08 Thread John Gordon
nothing happened. # disconnect from server db.close() -- 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: Test for an empty directory that could be very large if it is not empty?

2014-08-07 Thread John Gordon
could try looking at the size of the directory entry itself. On the system I'm writing from, a freshly-created directory is 4K in size, and will grow in 4K chunks as more and more files are created within the directory. However, the directory entry does not shrink when files are removed. -- John

Re: Wikibooks example doesn't work

2014-08-06 Thread John Gordon
it execute, but give unexpected results? -- 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 Classes

2014-08-04 Thread John Gordon
is the lowest-level class. All other classes inherit from Object. Within a class, self is a reference to the current class instance. -- 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

Re: Subtracting two dates in python

2014-07-31 Thread John Gordon
() Subtract the two datetime objects to obtain a timedelta object: mydelta = now_date - user_date Look at the days attribute to get the difference in days: mydelta.days -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House

Re: I am confused about ' and

2014-07-10 Thread John Gordon
without the need to escape them with a backslash, and vice-versa. For example: string2 = It's a beautiful day in the neighboorhood. string1 = 'He said to me, Hello Thomas.' -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House

Re: comtypes

2014-06-21 Thread John Gordon
print gives me return values. I want to access return data (array)and variable. How can I correctly handle it? You can use help() and dir() to display more information about an object. -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch

Re: Not Responding When Dealing with Large Data

2014-06-18 Thread John Gordon
it actually crash? -- 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: Embedding numpy works once, but not twice??

2014-06-04 Thread John Gordon
get some 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 to watch

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 benjaminherna...@gmail.com 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

Re: passing Python assignment value to shell

2014-05-28 Thread John Gordon
=devnull, stderr=subprocess.STDOUT) -- 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: Advice for choosing correct architecture/tech for a hobby project

2014-05-22 Thread John Gordon
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: a href=file:///C:/Users/gordonj/Documents/foo.htmlfoo.html/a -- John Gordon Imagine what it must be like for a real medical doctor to gor

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

2014-05-22 Thread John Gordon
=process_local_bookmark.cgi?filename=/dir/foo.html -- 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: Putting Py 3.4.1 to work.

2014-05-20 Thread John Gordon
? -- 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: New to Python. For in loops curiosity

2014-05-13 Thread John Gordon
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.comwatch 'House', or a real serial killer to watch 'Dexter

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

2014-04-15 Thread John Gordon
In e452de11-1615-4869-8c2a-c2e78a963...@googlegroups.com Nick Mellor thebalance...@gmail.com 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

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

2014-04-15 Thread John Gordon
% [(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 real serial killer to watch

Re: Python, Linux, and the setuid bit

2014-04-14 Thread John Gordon
; char **envp_write; if (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

Re: Retrieve item deep in dict tree?

2014-04-02 Thread John Gordon
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

Re: Dictionaries

2014-03-20 Thread John Gordon
accumulate 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
execution; b. A '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

Re: File Path/Global name issue

2014-03-20 Thread John Gordon
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: Ordering in the printout of a dictionary

2014-03-17 Thread John Gordon
of simply printing it out (which calls 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 Gordon

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

2014-03-13 Thread John Gordon
, but the OP wanted to know how to fetch it from python code. -- 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: Oddity using sorted with key

2014-03-11 Thread John Gordon
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', or a real serial killer to watch 'Dexter

Re: unittest weirdness

2014-03-11 Thread John Gordon
, assertTrue, etc.) instead of raising exceptions. Perhaps 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: beautiful soup get class info

2014-03-06 Thread John Gordon
In e73d29eb-17bb-472e-bdc4-c38ca904c...@googlegroups.com teddyb...@gmail.com writes: span class=dateOctober 22, 2011/span 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

Re: beautiful soup get class info

2014-03-06 Thread John Gordon
occurrences of 'span class=dateMarch 5, 2014/span' 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 gor...@panix.comwatch

Re: How do I process this?

2014-03-03 Thread John Gordon
to grab only the element you want, 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

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

2014-03-01 Thread John Gordon
In G57Pu.24239$th2.4...@tornado.fastwebnet.it mauro ma...@gmail.com 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 -- John Gordon

Re: Error getting REMOTE_USER Environment Variable

2014-02-20 Thread John Gordon
value is doubled is beyond my understanding. 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

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

2014-02-20 Thread John Gordon
(fields[8]) # compute the averages average1 = sum1 / 3.0 average2 = sum2 / 2.0 # display output print '%s %f %f' % (name, average1, average2) -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House

Re: Just For Inquiry

2014-02-20 Thread John Gordon
bug reports and bugfixes. -- 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 to use logging

2014-02-17 Thread John Gordon
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
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()'. -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House

Re: Top down Python

2014-02-11 Thread John Gordon
to sell a generic hammer. 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

Re: Unable to Launch Python 2.7 after Windows 8.1 Update

2014-02-02 Thread John Gordon
? Does anyone know what Windows setting would prevent Py= thon IDLE from opening?=20 Try opening a command window and run Python from there; that way you'll be able to see any error mesages that crop up. -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.com

Re: Eclipse IDE printing values automatically

2014-01-29 Thread John Gordon
here and maybe we can help. Or, if your program is short enough, you can just post the whole thing here. Be sure to give an example of the unwanted output, and tell us exactly how the program is being executed. If the program uses input files, be sure to give us those too. -- John Gordon

Re: Separate Address number and name

2014-01-21 Thread John Gordon
method to achieve this result. for line in input_lines: fields = line.split() farm_id = fields[0] address_num = fields[1] address_name = ' '.join(fields[2:]) -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House

Re: Python solve problem with string operation

2014-01-16 Thread John Gordon
. For example; input : 3443331123377 operation- (3)(44)()(333)(11)(2)(33)(77) output: 34131237 input = 3443331123377 output = [] previous_ch = None for ch in input: if ch != previous_ch: output.append(ch) previous_ch = ch print ''.join(output) -- John

Re: Python solve problem with string operation

2014-01-16 Thread John Gordon
) previous_ch = ch sys.stdout.write('\n') -- 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: Send array back in result from urllib2.urlopen(request, postData)

2014-01-10 Thread John Gordon
) The python csv module might have a better way to do this; have a look. -- 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 copy selected lines from one file to another using argparse or getopt

2014-01-08 Thread John Gordon
to exclude. Can be None. args.input_file - the input file name. args.output_file - the output file name. -- 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

Re: Concatenate string list to number list to form title - Logic needed.

2013-12-16 Thread John Gordon
guide me with best solution without loops ? output_list = [] t = ['Start','End'] a = [[1,2,3,4], [5,6,7,8]] output_list.append('%s - %s, %s - %s' % (t[0], a[0][2], t[1], a[0][3])) output_list.append('%s - %s, %s - %s' % (t[0], a[1][2], t[1], a[1][3])) print output_list -- John Gordon

Re: Question RE urllib

2013-12-16 Thread John Gordon
the print str(e) ? except Exception, e: print site + is down print str(e) -- 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

Re: Downloading multiple files based on info extracted from CSV

2013-12-12 Thread John Gordon
mean %s instead?) -- 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: Need help with file object

2013-12-12 Thread John Gordon
if you post the real code and real error message. Don't type them from memory. -- 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 import error

2013-12-11 Thread John Gordon
sss.py It is having __init__.py as blank in ccc and ddd directories. But it still doesnot work. What directory are you in when you run your python command? As written, your import will only work if you're in the parent directory of ccc (or that directory is in your PYTHONPATH.) -- John Gordon

Re: python import error

2013-12-10 Thread John Gordon
importable unless the directory also contains a file named __init__.py . Try making __init__.py files in the ccc and ddd directories. If you don't know what to put in them, just leave them blank. -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.com

Re: PIL(Pillow) fails with PNG image

2013-12-05 Thread John Gordon
In mailman.3618.1386290317.18130.python-l...@python.org tastyminerals tastyminer...@gmail.com writes: d= Image._getdecoder(self.mode, d, a, self.decoderconfig) AttributeError: 'module' object has no attribute'_getdecoder'||| Do you have your own module named Image.py? -- John

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

2013-12-03 Thread John Gordon
help. You'll have to explain more about your problem. What, exactly, is wrong? If, as you say, the input and output is correct, then why do you say there is a problem? -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real

Re: Help me with this code PLEASE

2013-11-05 Thread John Gordon
TO THOSE LISTS 4. CONVERT 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

Re: Help me with this code PLEASE

2013-11-05 Thread John Gordon
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 'visits' column is NULL. Your next step is track down why. -- John

Re: Help me with this code PLEASE

2013-11-05 Thread John Gordon
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: function got multiple values for keyword argument for value

2013-10-30 Thread John Gordon
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? -- John Gordon Imagine what it must be like for a real medical

Re: Screenshots in Mac OS X

2013-10-22 Thread John Gordon
screen and saves 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

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

2013-10-18 Thread John Gordon
create an object with that name, 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

Re: VERY BASIC HELP

2013-09-30 Thread John Gordon
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 assigned anywhere.) Use a comma instead of a semicolon, like this: print The result is : , x/y -- John Gordon

<    1   2   3   4   5   >