Re: Way to get an array of latitude/longitude points (tuples) from a trip
> The problem is not the latitude/longitude. It would be trivial to > compute the great circle, thus the length of the trip between A and B > and divide it in smaller pieces to get 1-mile-distances. Yeah, I am starting to wish we drove in straight lines. > But unless you own an Aircraft & are important enough to take flights > the direct route without air traffic control getting mad at you (aka: > you are George W. Bush or some other bigwig goverment guy), this won't > do you much good. What you needed would be a vectormap of the streets so > that you could do route planning. Which is expensive to get. It just seems odd with all of the map software out there, that this isn't available. > So I guess you are better off trying to find someone who offers that as > part of the service. I wonder how expensive that would beprobably way out of our price range. -- http://mail.python.org/mailman/listinfo/python-list
Way to get an array of latitude/longitude points (tuples) from a trip
I am not sure if this is the right place for this, but I thought it was worth a shot. What I want: Enter a From: street address and a To: street address, and then specify an interval (say every half mile). Then, I click a submit button, and it gives me latitude and longitude points (in order) from the beginning of my trip to the end of my trip in 1/2 mile increments. I can't seem to find anything to simulate this, and I am not sure how to go about coding this either. BTW - I have used Yahoo geocoding service (to my delight), and while it is a good service, I don't see a way to do this unless we knew every street address in 1/2 mile increments. Are there any Python modules that would assist with dealing with latitude and longitude? Can anyone out there help? -- http://mail.python.org/mailman/listinfo/python-list
Re: win32com.client.constants - AttributeError
Wow..I didn't even realize that this existed. Thanks for your help! -- http://mail.python.org/mailman/listinfo/python-list
Re: win32com.client.constants - AttributeError
Please help! Anyone else know? -- http://mail.python.org/mailman/listinfo/python-list
Re: win32com.client.constants - AttributeError
how do I do this? Where is the Word object library? -- http://mail.python.org/mailman/listinfo/python-list
win32com.client.constants - AttributeError
On my machine, this runs fine, but when I try to run it on someone elses machine it blows up with an attribute error: import win32com.client, pythoncom pythoncom.CoInitializeEx(pythoncom.COINIT_APARTMENTTHREADED) myWord = win32com.client.dynamic.Dispatch ("Word.Application") myWord.Visible = True myDoc = myWord.Documents.Open(FileName= "C:\Test.doc") myDoc .SaveAs(FileName = "c:\Test.htm", FileFormat = win32com.client.constants.wdFormatHTML) myDoc.Saved=1 myWord.Quit () del myWord pythoncom.CoUninitialize() It's pretty simple code so I don't understand why it doesn't work. I verified that he has the same pywin32 module as me (build 207) and the same python version (2.4.2). Any ideas? -- http://mail.python.org/mailman/listinfo/python-list
Using pyinstaller to create an .exe, when using win32com
Hi all, I am pretty confused on this? While pyinstaller has a "MakeCOMServer.py" thing, it seems to blow up every time I run it. It keeps complaining that a dictionary that I have has "TypeError: unscriptable object.", but when I run my code normally (outside of trying to make an .exe), it runs perfectly. The dictionary doesn't have any data in it, until I call a method to grab some data from a file. Has anyone else tried to use this? What is the best way to create an .exe when using the win32com module? I found makeExe.py that uses py2exe.py, but I didn't have any luck with that either. I did some searching, too, but to no avail. Please Help! Keith -- http://mail.python.org/mailman/listinfo/python-list
Re: Exception handling....dumb question?
Thanks guys! I appreciate the help. I have a Python book, but it didn't mention this at all. I also tried looking through the online docs to no avail. -- http://mail.python.org/mailman/listinfo/python-list
Exception handling....dumb question?
In Python, When using the default except (like following) try: some code that might blow up except: print "some error message" Is there a way to show what error it is throwing? Like in Java, you can do catch (Exception e){ System.out.println(e); } Or something like that. Is there an equivalent way to do this in Python? -- http://mail.python.org/mailman/listinfo/python-list
Re: Convert Word .doc to Acrobat .pdf files
The question is where is the API? -- http://mail.python.org/mailman/listinfo/python-list
Re: Best IDE for Python?
To me, it just doesn't behave the same way as Eclipse for java. I have used the plug-in, and I usually use it on my home machine ( I am still a student). For example, in Java eclipse, if you import a module like math, then if you want to use a math function, you just type math + period, and then all the functions pop up in a scroll menu. I love this. I am not searching through online documentation...etc just to find some stupid method/function that I know is there. It doesn't seem to behave like this for PythonI wish it did. I still love programming in Python, though. -- http://mail.python.org/mailman/listinfo/python-list
Re: Best IDE for Python?
I have recently been trying out NewEdit, and it is a pretty good "IDE" for Python. The reason that I have it in quotes is because I haven't really found a true IDE (like the way Eclipse behaves for Java) for python. (I realize that Eclipse has a plug-in for Python, too). -- http://mail.python.org/mailman/listinfo/python-list
Re: Convert Word .doc to Acrobat .pdf files
Justin, Your way appeared to work great, but now I just realized that the using the printer way destroys the table of contents and bookmark links. Rune's way would be perfect, but I don't see a macro created like that. I tried to create one from scratch, but it didn't work. I am now trying to see if there is a way to call PDFMWord.dll through a command-line using rundll32.exe. -- http://mail.python.org/mailman/listinfo/python-list
Re: Convert Word .doc to Acrobat .pdf files
Wow...thanks again for the replies! I will try both of these out at work tomorrow. (I only work 3 days a week because of school). Thanks, Keith www.301labs.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Convert Word .doc to Acrobat .pdf files
Justin, While I was salivating when reading your post, it doesn't work for me, but I am not sure why. I keep getting an error: Titled: Adobe PDF "When you create a PostScript file you have to send the host fonts. Please go to the printer properties, "Adboe PDF Settings" page and turn OFF the option "Do not send fonts to Distiller". Keith www.301labs.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Perforce p4c.run("print" error - AttributeError: OutputBinary
This seemed to fix my problem. Keith www.301labs.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Perforce p4c.run("print" error - AttributeError: OutputBinary
I received a response from Robert Cowham ( the author of the API): The problem is that something like print was only expected to be done for text files not binary. You could try editing p4.py and add a method similar to: def OutputText(self, text): "Adds text lines to the output data." for line in string.split(text, '\n'): self.output.append(line) e.g. around line 214 add def OutputBinary(self, text): "Adds lines to the output data." self.output.append(text) Note: I am sure that Robert will be updating the P4 module for python, so if you can I would just download the most recent version (I would give him a couple of days though). -- http://mail.python.org/mailman/listinfo/python-list
Perforce p4c.run("print" error - AttributeError: OutputBinary
Hi all, I am getting an error message when trying to use the P4 print command via the python api for perforce. Anytime that I run p4c.run("print","-q", eachFile), I keep getting an error message: "AttributeError: OutputBinary." Here is my code below: Please Help. import p4 #import perforce module #For complete API see http://public.perforce.com/guest/robert_cowham/perforce/API/python/index.html p4c = p4.P4() p4c.port = "perforce.ic.ncs.com:1424" p4c.user = "perrk9" p4c.parse_forms() p4c.connect() path = "//practice/perrk9/..." localTemp = "c:\perforce_temp_dir\\" first = p4c.run( "counter", "galloway_deploy" )[0] # here 'last_change_record' is a dictionary last_change_record = p4c.run( "changes", "-m", "1", path )[0] print "last change record" print last_change_record last = last_change_record['change'] print "last \n" print last status_dict = { "right only" :"add", "left only" :"delete", "content" :"edit", "identical" :"no change" } result = p4c.run( "diff2", "-q", path + "@" + first , path + "@" + last ) # result is an Array, each element is a Dictionary #Find out which files were add/edited/deleted and throw them into lists deploy = [] # add/edit list undeploy = [] # delete list for changed_file in result: action = status_dict[ changed_file['status'] ] print action if ((action =='add') or (action == 'edit')): print "Changed file = " print changed_file['depotFile'] deploy.append(changed_file['depotFile']) #appending each file to our 'deploy' list elif action == delete: undeploy.append(changed_file['depotFile']) #appending each file to our 'undeploy' list #print the deploy list print "deploy list" print deploy for eachFile in deploy : print eachFile file = p4c.run("print","-q", eachFile) -- http://mail.python.org/mailman/listinfo/python-list
Re: Convert Word .doc to Acrobat .pdf files
Thanks again Duncan! I will use the OpenOffice solution as a last resort. It isn't the standard office suite at my corp. I would like the code to be as portable as possible, and it would seem like a pain in the arse to have the end user install OpenOffice just to run my script. Sure it would just be a one time deal, but I can hear the groans already. If you happend to come across a way to suppress the save window when doing print option, please let me know. -- http://mail.python.org/mailman/listinfo/python-list
Re: Convert Word .doc to Acrobat .pdf files
Thanks for the replys! I need to stick with Word (not my choice, but I would rather keep everything like he has it). Duncan, I was just trying the printing thing. When installing Adobe Acrobat, it installs a printer called "Adobe PDF," and I have been trying to print to there, but the "Save" window keeps popping up. I need to figure out a way to keep it in the background. -- http://mail.python.org/mailman/listinfo/python-list
Convert Word .doc to Acrobat .pdf files
Hi all, Background: I need some help. I am trying to streamline a process for one of our technical writers. He is using Perforce (version control system), and is constantly changing his word documents, and then converts them to both .pdf and "Web page" format (to publish to the web). He has a licensed copy of Adobe Acrobat Professional (7.x). Questions: Does Acrobat Pro, have some way to interface with it command-line (I tried searching, but couldn't find anything)? Is there any other good way to script word to pdf conversion? Note: The word documents do contain images, and lots of stuff besides just text. -- http://mail.python.org/mailman/listinfo/python-list
Re: Zope/Plone - Is it the right solution?
Rene and Tim, Thanks for the help! I am glad that I didn't rule out Plone yet because I was able to download and install quickly. My "site" was up and running very quickly. For this class we are more focused on the HCI/usability stuff than we are the coding. I have plenty of other classes that focus on the coding. I am hoping that we could build an extension or two using python (if needed), and I would like to completely redesign the main "skin," but other than that I need the CMS tool so Plone looks like a great fit. I tried installing Zope last night, but when I did, I couldn't find out how to even start it for about an hour after searching. I was worried that if I went the Plone/Zope route, then I would need to know both. It looks like Plone just makes Zope much easier to work with. -- http://mail.python.org/mailman/listinfo/python-list
Re: Zope 3?? How do you start it on Windows?
Many good points! Thx Matt. -- http://mail.python.org/mailman/listinfo/python-list
Re: Zope/Plone - Is it the right solution?
Well, I guess our main goal in this class is to improve usability and user experiences at the site. While we want to improve our site visually and make it more usable to the prospective students, the site needs to be easily updated. I don't think that I am looking for a wiki. I will definitely check out Django and turbogears. Thanks a ton for the info! -- http://mail.python.org/mailman/listinfo/python-list
Re: Zope 3?? How do you start it on Windows?
Cool thx Matt. I did finally figure it out, but barely. Why would you want to download and install Zope without creating an instance? It seems kind of dumb to me. -- http://mail.python.org/mailman/listinfo/python-list
Zope/Plone - Is it the right solution?
Hi everyone, I am currently a student, and for our HCI class project we are redeveloping our CS website. I attend a very large university (around 30,000 students), and the CS site will need to be updated by many people that don't have technical skills (like clerical staff). The biggest problem with the current site is that not enough people have access to update it. Since I love python, these seemed like viable solutions. 1) Is Zope/Plone overkill for this type of project? 2) Why use Plone vs. straight up Zope? 3) Is there a way to get over the steep learning curves (that I have read about)? -- http://mail.python.org/mailman/listinfo/python-list
Zope 3?? How do you start it on Windows?
Call me crazy and stupid, but how do you start zope? I downloaded the thing, installed it, and then nothing. I can find a stupid README.txt that is useful. Can someone help?Please! Thx. -- http://mail.python.org/mailman/listinfo/python-list