Re: MemoryError and Pickle

2016-11-21 Thread John Gordon
oesn't use pickle format, so your reader program would have to be modified to read this format. And you'll run into the same problem if the reader expects to keep all the data in memory. -- John Gordon A is for Amy, who fell down the st

Re: Python while loop

2016-11-30 Thread John Gordon
name; you could have called it "hamburger" and python would treat it just the same. -- 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 json.dumps create multiple lines

2016-12-01 Thread John Gordon
", > "with several strings", > "as a demo" > ]' json.dumps() has an 'indent' keyword argument, but I believe it only enables indenting of each whole element, not individual members of a list. Perhaps somet

Re: Error In querying Genderize.io. Can someone please help

2016-12-01 Thread John Gordon
(r.content) You're using http: instead of https:, and you're using ?katty instead of ?name=katty, and therefore the host does not recognize your request as an API call and redirects you to the normal webpage. -- John Gordon A is for Amy, who fell down the

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-05 Thread John Gordon
ERROR No file named '$HOME/file.txt' vi $(grep -l foo *.txt) ERROR No file named '$(grep -l foo *.txt)' None of these commands would work if bash didn't "alter the input going to another program". -- John Gordon A is for Amy, who fell

Re: calling a program from Python batch file

2016-12-07 Thread John Gordon
responding to expected patterns in their output. Pexpect allows your script to spawn a child application and control it as if a human were typing commands. https://pexpect.readthedocs.io/en/stable/ -- John Gordon A is for Amy, who fell down the stairs gor...@pa

Re: The right way to 'call' a class attribute inside the same class

2016-12-12 Thread John Gordon
ever one you prefer. self.class_attr may be more convenient because you don't have to provide a specific class name. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey,

Re: Install Problem

2016-12-13 Thread John Gordon
Python. How can this problem be fixed? When does the error occur? During installation? Or after installation when you're trying to run a python program? What version of Windows do you have? -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B

Re: OT - "Soft" ESC key on the new MacBook Pro

2016-12-14 Thread John Gordon
In Gregory Ewing writes: > Once you're in the clutches of Apple, there is no Escape. Ha! -- 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: Using python to start programs after logging in

2017-01-19 Thread John Gordon
lt-in facilities for starting programs would be better. Why are you using Python instead? -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashl

Re: Using python to start programs after logging in

2017-01-20 Thread John Gordon
hen all > programs will be started on the same virtual desktop and I want to > start them on different ones. The window manager doesn't allow you to specify a target desktop? That seems like a pretty heinous feature omission. -- John Gordon A is for Amy, who fell down the s

Re: Python3 using requests to grab HTTP Auth Data

2017-02-01 Thread John Gordon
e interactive, you could require that the user supply a file in the current directory containing the username and password. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edw

Re: Target WSGI script cannot be loaded as Python module.

2018-05-23 Thread John Gordon
led successfully. Is your web server using Python 2 or Python 3 to execute WSGI? -- 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&quo

Python System Error

2018-06-09 Thread deon gordon
Greetings, confirm 1b131414ca21eea0843469f76454389f1e9ceebe I am using Window 7 Professional (32bit). I downloaded and installed python-3.6.5.exe and have an error after several attempts to install and repair. Python-system error api-mis-win-crt-runtime-l1-1-0.dll is missing from your computer

Re: Pyscripter Issues

2016-03-31 Thread John Gordon
bit version. -- 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

Promoting Python

2016-04-05 Thread Gordon( Hotmail )
at downloading the relevant software was blocked by AVG software as risky. Gordon Liberty Basic for n = 32 to 255: print n;chr$(n) : next n REM BBC Basic FOR c = 1 TO 15 : COLOUR c PRINT "Color ";c NEXT c REM BBC Basic c = 0 FOR x = 80 TO 2000 STEP 96 GCOL c: CIRCLE FILL x,500,

Re: Python path and append

2016-04-25 Thread John Gordon
en rename it afterwards, instead of rewriting the original file. import os f_in = open('win.txt', 'r') f_out = open('win_new.txt', 'w') for line in f_in.read().splitlines(): f_out.write(line + " *\n") f_in.close() f_

Re: Simplest way to locate a string in a column and get the value on the same row in another column

2016-04-28 Thread John Gordon
ething else? -- 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: web facing static text db

2016-04-30 Thread Gordon Levi
"Fetchinson ." wrote: >Hi folks, > >I have a very specific set of requirements for a task and was >wondering if anyone had good suggestions for the best set of tools: > >* store text documents (about 10 pages) >* the data set is static (i.e. only lookups are performed, no delete, >no edit, no

Re: Python 3.5.1 Not Working

2016-05-13 Thread John Gordon
ion 3.4.3 if you are using Windows XP. -- 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: Program prints questions for user input, but won't show the answer output

2016-05-18 Thread John Gordon
ounter < 7: > if (pints[counter] < lowPints): > lowPints = pints[counter] > counter = counter + 1 > return lowPints And getLow() has a very similar problem. I suspect you want to unindent the 'counter = counter + 1' statement so that it is NOT insid

Re: ZipImportError: can't find module

2016-05-24 Thread John Gordon
ob? Are the permissions on the zipfile correct, and all parent directories? How, specifically, are you importing the module? Are you doing something like this: zipfile = zipimport.zipimporter('file.zip') zipfile.load_module('mymodule') -- John Gordon

Re: Unit test a class with xml elements

2016-05-24 Thread John Gordon
here. > Share if any examples available. Create your own sample XML illustrating each desired combination. Then write test cases for each. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for B

Re: why it is like stop running after a 3 seconds

2016-06-09 Thread John Gordon
he function, but the recursive calls aren't inside that if block. DFS keeps calling itself with smaller and smaller values of deep. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears

Re: how to solve memory

2016-06-10 Thread John Gordon
In <4f853aa2-cc00-480b-9fd7-79b05cbd4...@googlegroups.com> meInvent bbird writes: > https://drive.google.com/file/d/0Bxs_ao6uuBDULVNsRjZSVjdPYlE/view?usp=sharing I already responded to your earlier post about this program. Did you read it? -- John Gordon A is for

Re: how to solve memory

2016-06-10 Thread John Gordon
ur name changed in previous post? My comment was that the recursive calls weren't indented in the "if deep > 0" block, therefore DFS was being called infinitely with smaller and smaller values of deep. But it appears you have fixed that issue. -- John Gordon

Re: log file.

2016-06-14 Thread John Gordon
g for help with logging, or communicating with the pump? -- 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.py

Re: how to for loop append a list [] when using parallel programming

2016-06-15 Thread John Gordon
In meInvent bbird writes: > how to for loop append a list [] when using parallel programming items = [] for item in parallelized_object_factory(): items.append(item) If you want a more specific answer, ask a more specific question. -- John Gordon A is

Re: while Loops

2016-06-22 Thread John Gordon
ing at 5, and only stop when i is 6. -- 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: Break and Continue: While Loops

2016-06-23 Thread John Gordon
ode prints i and THEN adds one to it. So i is 4, it gets printed, then 1 is added to it, so it becomes 5 and then the loop exits. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears

Re: what the heck this code is doing?

2016-07-01 Thread John Gordon
27;?? It loops through the child items in entry, looking for one with a 'key' value of 'Track ID'. If it finds one, it sets found=True and loops one more time, returning the text of the *next* child element. It depends on the 'key' element being directly followed by the &#

Re: Just starting to learn Python, and encounter a problem

2016-07-22 Thread Gordon Levi
Zagyen Leo wrote: >yeah, it may be quite simple to you experts, but hard to me. > >In one of exercises from the Tutorial it said: "Write a program that asks the >user their name, if they enter your name say "That is a nice name", if they >enter "John Cleese" or "Michael Palin", tell them how yo

Re: Python text file fetch specific part of line

2016-07-28 Thread Gordon Levi
Arshpreet Singh wrote: >I am writing Imdb scrapper, and getting available list of titles from IMDB >website which provide txt file in very raw format, Here is the one part of >file(http://pastebin.com/fpMgBAjc) as the file provides tags like Distribution > Votes,Rank,Title I want to parse titl

Re: Python text file fetch specific part of line

2016-07-29 Thread Gordon Levi
c...@zip.com.au wrote: >On 28Jul2016 19:28, Gordon Levi wrote: >>Arshpreet Singh wrote: >>>I am writing Imdb scrapper, and getting available list of titles from IMDB >>>website which provide txt file in very raw format, Here is the one part of >>>file(http:

Re: JSON result parsing

2016-07-29 Thread John Gordon
return results['ID'] else: return 'something else' -- 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 Tin

Re: Why not allow empty code blocks?

2016-07-31 Thread Gordon Levi
"D'Arcy J.M. Cain" wrote: >On Sat, 30 Jul 2016 16:14:18 +0100 >BartC wrote: >> > By the way, the last time I replied to you it went to the list but >> > your address bounced. Was that a glitch or are you using an >> > invalid address in a mailing list? >> >> Do you mean my email address? That

Re: Why not allow empty code blocks?

2016-08-01 Thread Gordon Levi
"D'Arcy J.M. Cain" wrote: >On Sun, 31 Jul 2016 11:53:47 -0400 >"D'Arcy J.M. Cain" wrote: >> On Mon, 01 Aug 2016 00:25:58 +1000 >> On the other hand I have no throwaway accounts. Every address I use >> is a primary one. I have all sorts of methods to block spam. None of >> those methods involv

Re: Why not allow empty code blocks?

2016-08-03 Thread Gordon Levi
"D'Arcy J.M. Cain" wrote: >On Mon, 01 Aug 2016 00:25:58 +1000 >Gordon Levi wrote: >> "D'Arcy J.M. Cain" wrote: >> >I don't care if you are using carrier pigeon. If you send an email >> >address, make it a valid one. >>

Re: FarPy GUIE v0.1

2005-09-28 Thread Gordon Hennesy
Walter Purvis gmail.com> writes: > > Is there a URL? http://farpy.holev.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-10-04 Thread Gordon Burditt
e some of them install keyloggers. Gordon L. Burditt -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-10-08 Thread Gordon Burditt
do so (that excludes seeing the URL in some SPAM). Oh, yes, and Javascript is turned off. >Some people use email PRIMARILY for sharing photos. And what does sharing photos (attachments) have to do with HTML? USENET text groups are not the appropriate place for photos. Gordon L. Burditt -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-10-09 Thread Gordon Burditt
arts that refer to other files. As far as I know, troff doesn't have any networking references in it. Lots of people probably hate troff, but it's a better start than HTML. Gordon L. Burditt -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-10-12 Thread Gordon Burditt
Links Javascript Forms References to other files you'd have very little left. I suggest that for formatted text, TROFF would be a better start. Gordon L. Burditt -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-10-12 Thread Flash Gordon
Roedy Green wrote: Can all of you please take comp.lang.c out of this thread (and all its sub-threads, since it is totaly off topic and NONE of the people on this thread are posting to anything else on comp.lang.c so I doubt any of you are reading it here. -- Flash Gordon Living in

Re: Jargons of Info Tech industry

2005-10-12 Thread Gordon Burditt
d text". >Even a form is not dangerous. You have to fill it in and hit submit. So where does the submitted data GO? And there's all kind of information in there about what software I'm running. Gordon L. Burditt -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-10-12 Thread Gordon Burditt
files. Reading your email should not generate hits on anything specified by the sender. Gordon L. Burditt -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-10-13 Thread Gordon Burditt
and email from downright hostile correspondents. >> And I consider "web bugs" and similar tracking methods to be a danger >> for something that's supposed to be ONLY "formatted text". Gordon L. Burditt -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-10-13 Thread Gordon Burditt
here's no identification of who "I" is. >Plus, I'm pretty sure that browsers have always allowed us to >disable cookies. I'm not sure that you can disable Javascript from reading cookies from other sites while allowing Javascript to read cookies from the site it came from on all browsers. Gordon L. Burditt -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-10-15 Thread Gordon Burditt
out, and use snail mail. Exploits >in email programs are not happening since HTML was added to them. Yes, they are. Why do you think people put "web bugs" in email? Because they work. >>>I try to explain Java each day both on my website on the plaintext >>>onl

Re: Microsoft Hatred FAQ

2005-10-27 Thread John Gordon
egal when you abuse the power. -- John Gordon"It's certainly uncontaminated by cheese." [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Microsoft Hatred FAQ

2005-10-27 Thread John Gordon
In <[EMAIL PROTECTED]> "David Schwartz" <[EMAIL PROTECTED]> writes: > When you say "it only become illegal", you are just being vague. Nothing > becomes illegal. The abuse is illegal, but it never was legal. You're splitting hairs. B

Generic utility class for passing data

2005-10-28 Thread Gordon Airporte
I'm wondering if this is might be bad practice. Sometimes when I need to pass around several pieces of datum I will put them in a tuple, then when I need to use them in a receiving function I get them out with subscripts. The problem is that the subscript number is completely meaningless and I

Re: O_DIRECT on stdin?

2005-11-07 Thread Gordon Burditt
one with F_SETFL, would do what you want. I'm not sure why you want to do that, though. It's not going to get you character-at-a-time I/O, if that's what you want. Gordon L. Burditt -- http://mail.python.org/mailman/listinfo/python-list

Re: O_DIRECT on stdin?

2005-11-07 Thread Gordon Burditt
>well. > >Any other ideas folks? Does O_DIRECT perhaps invoke some of the restrictions of "raw" device files, where the current offset and transfer size must be a multiple of some block size? (I don't see any mention of that in FreeBSD's documentation.) What is the valu

Returning a value from a Tk dialog

2005-11-07 Thread Gordon Airporte
The dialogs in tkColorChooser, tkFileDialog, etc. return useful values from their creation somehow, so I can do stuff like this: filename = tkFileDialog.askopenfilename( master=self ) I would like to make a Yes/No/Cancel dialog that can be used the same way (returning 1/0/-1), but I just cannot

Type-checking unpickled objects

2005-11-18 Thread Gordon Airporte
I have this class, and I've been pickling it's objects as a file format for my program, which works great. The problems are a.) how to handle things when the user tries to load a non-pickled file, and b.) when they load a pickled file of the wrong class. a. I can handle with a general exception

Re: Type-checking unpickled objects

2005-11-20 Thread Gordon Airporte
isinstance! Now why didn't I know about that? Thanks you. I guess I'll need a throwaway instance of the class to run type() on to get a usable type object for comparison, but I'll work something out. As to the security considerations...this is a small enough program with a limited enough release

Re: Type-checking unpickled objects

2005-11-20 Thread Gordon Airporte
> I guess I'll > need a throwaway instance of the class to run type() on to get a usable > type object for comparison, but I'll work something out. Never mind - I can just pass the name of the class, as it should be. -- http://mail.python.org/mailman/listinfo/python-list

Using MSMQ on Windows (and Navision)

2005-06-26 Thread Andrew Gordon
I'm investigating getting Microsoft Navision to do stuff from a Python script. The recommended way seems to be to use message queues (MSMQ). I can get Navision to send a message to itself fine. I found a couple of code example in an ancient message in this newsgroup. The send.py one I change

Tkinter - Resizing a canvas with a window

2005-07-26 Thread Gordon Airporte
I'm trying to get my canvas to resize to fill its frame within a window, but I can't figure out how to handle the callback data from the window's properly. It has very strange behavior - resizing randomly or growing by itself, shrinking to 0. The following works passably but jumps around at ra

Re: Tkinter - Resizing a canvas with a window

2005-07-27 Thread Gordon Airporte
Thanks you very much. I found something interesting though, the canvas's width and height properties are not updated when it is resized by its packing. Looks like an oversight to me, but I've just demonstrated that I don't have a complete grasp of Tk, so... I can use a Configure callback to kee

Re: Jargons of Info Tech industry

2005-08-25 Thread Gordon Burditt
eatures in the >HTML renderer in your news and mail readers. JavaScript, Java, and any >form of object embedding. Oh yeah, and frames. And links. And cookies. And any kind of external site or local file access. And browser history. Gordon L. Burd

Re: Jargons of Info Tech industry

2005-08-25 Thread Gordon Burditt
d browser history. > >What is the risk with browser history? spyware and viruses (which can come from places other than email) sending it somewhere. Actually, there's not much point in keeping a browser history if all it can contain is mail in YOUR mailbox that may or may not

Re: Jargons of Info Tech industry

2005-08-26 Thread Gordon Burditt
't (usually on different sites). I think I can manually get out of this with the STOP button, but until I do, it likely causes a lot of useless load on the web site. Gordon L. Burditt -- http://mail.python.org/mailman/listinfo/python-list

efficient intersection of lists with rounding

2004-12-02 Thread Gordon Williams
l want to round the second number of closest 0.25 rather than whole number. Would the sets module be more efficient? I'm using python 2.3. Thanks for any ideas. Regards, Gordon Williams -- http://mail.python.org/mailman/listinfo/python-list

Re: efficient intersection of lists with rounding

2004-12-06 Thread Gordon Williams
on W2K, python 2.3.2, 1GHz Athlon. 1K, 10K and 30K long (seconds per call) t1= 0.009, 0.148, 0.563 t2= 0.015, 0.217, 0.777 t3= 0.008, 0.108, 0.487 t4= 0.016, 0.190, 0.749 t5= 0.015, 0.224, 0.773 The non-set algorithims (t1,t3) came out the winners (maybe due to the conversion of the set to a so

Re: Program Translation - Nov. 14, 2013

2013-11-14 Thread Gordon Sande
On 2013-11-14 17:07:45 +, mecej4 said: On 11/14/2013 8:18 AM, E.D.G. wrote: Posted by E.D.G. on November 14, 2013 In view of the fact that I mentioned the following project in both Perl and Python Newsgroup notes and did not get any hostile responses I am going to take a chance and mentio

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

2013-12-03 Thread John Gordon
/1smv > Please, I need 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.

Re: PIL(Pillow) fails with PNG image

2013-12-05 Thread John Gordon
In tastyminerals 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 Gordon Imagine what it must be like for a

Re: python import error

2013-12-10 Thread John Gordon
> aaa.py > sss.py A python file isn't 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 mu

Re: python import error

2013-12-11 Thread John Gordon
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 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: Downloading multiple files based on info extracted from CSV

2013-12-12 Thread John Gordon
you have the close-parenthesis in the wrong place. The call should look like this: urllib.urlretrieve(f, "%g.csv" % clientname) "%g" returns a floating-point value. Did you 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
so, it really helps 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: Concatenate string list to number list to form title - Logic needed.

2013-12-16 Thread John Gordon
27;] > Note : First 2 values from each list should be ignored. > Could anyone please 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

Re: Question RE urllib

2013-12-16 Thread John Gordon
tion, 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/python-list

Re: python copy selected lines from one file to another using argparse or getopt

2014-01-08 Thread John Gordon
ch - a list of words to search for. args.exclude - a list of words 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/mailman/listinfo/python-list

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

2014-01-10 Thread John Gordon
x27;: para.append(None) else: para.append(item) 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 solve problem with string operation

2014-01-16 Thread John Gordon
3377" > 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(ou

Re: Python solve problem with string operation

2014-01-16 Thread John Gordon
: sys.stdout.write(ch) 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: Separate Address number and name

2014-01-21 Thread John Gordon
York > I have struggled with this for a while and know there must be a simple > 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

Re: Eclipse IDE printing values automatically

2014-01-29 Thread John Gordon
code 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: Unable to Launch Python 2.7 after Windows 8.1 Update

2014-02-02 Thread John Gordon
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.comwatch 'House', o

Re: Finding scores from a list

2015-11-24 Thread John Gordon
back (most recent call last): > File "", line 1, in > print((results["gengyang"])["score"]) > TypeError: list indices must be integers, not str Lists are indexed by number, not by name. You want something like this: for result in results:

Re: if else python

2015-11-26 Thread John Gordon
e in a loop, so perhaps you're seeing the 'if' branch on one loop iteration, anf the 'else' branch on the next iteration? I see that your if and else branches both contain a screen.addstr() call. Are you seeing both of these outputs? -- John Gordon A is fo

Re: Is vars() the most useless Python built-in ever?

2015-12-01 Thread John Gordon
re is almost always *MANY* ways to > achieve the same output.=20 The koan reads: There should be one-- and preferably only one --obvious way to do it. You left out the rather important word "obvious". -- John Gordon A is for Amy, who fell down the stairs gor...

Re: error reading api with urllib

2015-12-16 Thread John Gordon
your Request object. Try doing that. (It works in your browser because it defaults to GET automatically.) -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, &qu

Re: imshow keeps crashhing

2015-12-22 Thread John Gordon
ble SCIPY_PIL_IMAGE_VIEWER. If that variable is not present, it uses 'see' by default. Do you have a suitable image viewing program installed on your computer? If so, try setting the SCIPY_PIL_IMAGE_VIEWER environment variable to the name of that program. -- John Gordon

Re: Why is there difference between cmd line and .py file?

2016-01-05 Thread John Gordon
> IndexError: invalid index to scalar variable. > // The built-in function sum() returns a single value, not a list, so this is a reasonable error. I suspect the code actually intended to call numpy.sum(), which does return a list (or something like a list). -- John Gordon

Re: imshow keeps crashhing

2016-01-06 Thread John Gordon
Do you have any > suggestions? I don't really know much about Macs... Can you run Preview and open the temporary file successfully? When launched from scipy, Does Preview run as a user other than yourself? What are the permissions on the temporary file when it's originally create

Re: imshow keeps crashhing

2016-01-06 Thread John Gordon
it even show up as a choice? Is there something special about the /private directory? -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrum

Re: Question about a class member

2016-01-07 Thread John Gordon
transmat_ = transmat > model.means_ = means > model.covars_ = covars > # Generate samples > X, Z = model.sample(50) > - sample() is a method in the GaussianHMM class. (In this case, it's a method in the _BaseHMM class, from which GaussianHMM inherits.) -- John Gord

Re: Which Python editor has this feature?

2016-01-11 Thread Gordon Levi
jf...@ms4.hinet.net wrote: >It lets you jump between the current cursor position and the line the upper >level indentation start, something like the bracket matching in C editor. >Because of Python use indentation as its code block mark, It might be helpful >if we can jump between different lev

Re: importing: what does "from" do?

2016-01-21 Thread John Gordon
#x27;utilities' module? Does it, in fact, contain something named 'hexdump'? -- 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: importing: what does "from" do?

2016-01-21 Thread John Gordon
contain > > something named 'hexdump'? > Yes In that case, the problem is most likely a circular import issue, as you mentioned. The only way to fix it is to reorganize your modules. How did this error come up? Did the code work previously? If so, what changed? -- Jo

Re: importing: what does "from" do?

2016-01-21 Thread John Gordon
You shouldn't have to rewrite any of the actual code. -- 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: Everything good about Python except GUI IDE?

2016-02-27 Thread Gordon Levi
wrong.addres...@gmail.com wrote: >On Saturday, 27 February 2016 18:08:36 UTC+2, Dietmar Schwertberger wrote: >> On 27.02.2016 12:18, wrong.addres...@gmail.com wrote: >> > Isn't there any good GUI IDE like Visual Basic? I hope there are some less >> > well known GUI IDEs which I did not come acro

Re: Everything good about Python except GUI IDE?

2016-02-28 Thread Gordon Levi
Chris Angelico wrote: >On Sun, Feb 28, 2016 at 9:25 PM, Rustom Mody wrote: >> Code is always the last resort for arbitrary complexity >> Lets keep it the last resort. >> >> If the bottom-line is that python's GUI-builders are so deep into suxland >> that they are best avoided in place of hand-wr

Re: Everything good about Python except GUI IDE?

2016-02-28 Thread Gordon Levi
Rustom Mody wrote: >On Sunday, February 28, 2016 at 6:38:40 PM UTC+5:30, Gordon Levi wrote: >> Chris Angelico wrote: >> >> >On Sun, Feb 28, 2016 at 9:25 PM, Rustom Mody wrote: >> >> Code is always the last resort for arbitrary complexity >> >>

Re: Everything good about Python except GUI IDE?

2016-02-28 Thread Gordon Levi
Marko Rauhamaa wrote: >Rustom Mody : > >> On Sunday, February 28, 2016 at 7:22:08 PM UTC+5:30, Marko Rauhamaa wrote: >>> Rustom Mody : >>> >>> > whereas in fact every significant GUI embeds text (possibly >>> > recursively) >>> > >>> > eg TI inside GUI -- think of text inside gimp GUI inside TI

Re: Everything good about Python except GUI IDE?

2016-03-02 Thread Gordon Levi
Marko Rauhamaa wrote: >Gordon Levi : > >> Nobody likes filling in forms but how do you suggest converting a form >> based app into something loveable. > >Straight HTML does forms just fine without CSS or JavaScript, yet few >can resist. > >> What interf

<    1   2   3   4   5   6   7   >