Showing posts with label command line. Show all posts
Showing posts with label command line. Show all posts

Thursday, October 27, 2016

Python command line arguments

I needed to be able to pass an argument into my program to allow it to run in two different ways. The syntax of the constructor that I'd simply copied from something else a long time ago is weird. It turns out that these are two different problems. Neither wasn't so bad once I dug into them.

To pass an argument into the program from the command line, just use c-like argc and argv:

http://www.cyberciti.biz/faq/python-command-line-arguments-argv-example/

The constructor is using a pythonic trick of indirectly referencing a function's argument list. It's nothing to do with the command line and isn't specific to constructors:

http://stackoverflow.com/questions/3394835/args-and-kwargs

https://mail.python.org/pipermail/tutor/2006-August/048394.html

https://pythonprogramming.net/styling-gui-bit-using-ttk/

Tuesday, November 10, 2015

How to get a list of com ports in Windows 7 without being administrator

Thanks to my job treating employees like preschoolers, I no longer have the ability to view the device manager on my laptop. I am trying to use the laptop to control a remote device through USB, how to I tell what COM port my USB device has been assigned to? There might be better ways, but what I found is using the heretofore unknown "MODE" command in a DOS window. This will list all printer and com ports with lots of info.

Sources:

This had the key info, although some users on this thread also mention powershell which was the commonly supplied answer on other threads also:
http://superuser.com/questions/835848/how-to-view-serial-com-ports-but-not-through-device-manager

This thread beats on the problem a lot with powershell and some visual basic scripts, but does not reference the MODE command which seems like such an easy solution:
http://empegbbs.com/ubbthreads.php/topics/352184/Windows_command_to_quickly_lis

Thursday, December 15, 2011

command line HTML to PDF converter

Preferably free, of course.

I think the real answer is to somehow use the python pdf libraries. Somebody must have written this kind of converter using this library, but I haven't found it yet.

(Update, here it is. Of course, will it work with our pathetic version 2.5 python?)

http://www.xhtml2pdf.com/

Oh how interesting, they list "alternatives" to xhtml2pdf.

Here are some other options:

ImPDF seems to be the winner. It's command line, and has a free version although they are also advertising a "company license"? Needs more investigation:

http://www.tipdownload.com/ImPDF-HTML-to-PDF-Converter-Comm_103690/

The pricing page (link now lost) seemed to indicate that the command line option could only be bought under a $200 "company license", but this page seems to have a free download link:

http://www.impdf.com/html-to-pdf-cmd.htm

Here's a retail-boxed version with what's probably a trial download. Doesn't seem to have a command line though:

http://www.coolutils.com/TotalHTMLConverter

SVN options ci

I find it interesting that we are using both Tortoise and "plain" SVN to access our SVN repository, depending on the system being used. For our unix boxes, plain SVN must be used at the command line.

From a recent search for the proper syntax for SVN command line options, here is a nice page:

http://www.yolinux.com/TUTORIALS/Subversion.html