Python Serial Number

To determine what serial port your Arduino is connected to look at the bottom right corner of your Arduino sketch. Whatever that is should be what is in quotes in line 3 of the Python program. You can also change the baud rate in line 3 of the Python program and line 2 of the Arduino program as long as they stay the same. A string indicating the pySerial version. Experimental asyncio support is available for Python 3.4 and newer. The module serial.aio.

I am searching for a simple method to list all available com port on a PC.

I have found this method but it is Windows-specific: Listing serial (COM) ports on Windows?

I am using Python 3 with pySerial on a Windows 7 PC.

I have found in the pySerial API (http://pyserial.sourceforge.net/pyserial_api.html) a function serial.tools.list_ports.comports() that lists com ports (exactly what I want).

But it seems that it doesn't work. When my USB to COM gateway is connected to the PC (I see the COM5 in the Device Manager), this COM port isn't included in the list returned by list_ports.comports(). Instead I only get COM4 which seems to be connected to a modem (I don't see it in the COM&LPT section of Device Manager)!

Do you know why it doesn't work? Have you got another solution which is not system specific?

doomdoom

8 Answers

This is the code I use.

Successfully tested on Windows 8.1 x64, Windows 10 x64, Mac OS X 10.9.x / 10.10.x / 10.11.x and Ubuntu 14.04 / 14.10 / 15.04 / 15.10 with both Python 2 and Python 3.

ThomasThomas

You can use:

python -c 'import serial.tools.list_ports;print serial.tools.list_ports.comports()'

Filter by know port:python -c 'import serial.tools.list_ports;print [port for port in serial.tools.list_ports.comports() if port[2] != 'n/a']'

See more info here:https://pyserial.readthedocs.org/en/latest/tools.html#module-serial.tools.list_ports

moylop260moylop260

A possible refinement to Thomas's excellent answer is to have Linux and possibly OSX also try to open ports and return only those which could be opened. This is because Linux, at least, lists a boatload of ports as files in /dev/ which aren't connected to anything. If you're running in a terminal, /dev/tty is the terminal in which you're working and opening and closing it can goof up your command line, so the glob is designed to not do that. Code:

This modification to Thomas's code has been tested on Ubuntu 14.04 only.

NgerfNgerf

refinement on moylop260's answer:

This lists the ports that exist in hardware, including ones that are in use. A whole lot more information exists in the list, per the pyserial tools documentation

grambogrambo

Basically mentioned this in pyserial documentationhttps://pyserial.readthedocs.io/en/latest/tools.html#module-serial.tools.list_ports

Result :

Python Serial Number

COM1: Communications Port (COM1) [ACPIPNP05011]

COM7: MediaTek USB Port (COM7) [USB VID:PID=0E8D:0003 SER=6 LOCATION=1-2.1]

Ozgur OzOzgur Oz

Several options are available:

Call QueryDosDevice with a NULL lpDeviceName to list all DOS devices. Then use CreateFile and GetCommConfig with each device name in turn to figure out whether it's a serial port.

Call SetupDiGetClassDevs with a ClassGuid of GUID_DEVINTERFACE_COMPORT.

WMI is also available to C/C++ programs.

There's some conversation on the win32 newsgroup and a CodeProject, er, project.

Python Serial Number
Hip Hip ArrayHip Hip Array
I am Learning...I am Learning...

Please, try this code:

first of all, you need to import package for serial port communication,so:

then you create the list of all the serial ports currently available:

and then, walking along whole list, you can for example print port names:

This is just an example how to get the list of ports and print their names, but there some other options you can do with this data. Just try print different variants after

port.

Alexander LyapinAlexander Lyapin

Not the answer you're looking for? Browse other questions tagged pythonpyserial or ask your own question.

Colt Python
Colt Pythons with 6-inch (15 cm) and 4-inch (10 cm) barrels and nickel finish
TypeRevolver
Place of originUnited States
Production history
ManufacturerColt's Manufacturing Company
Produced1955–2005
Variants2.5-inch (6.4 cm), 3-inch (7.6 cm), 4-inch (10 cm), 6-inch (15 cm) and 8-inch (20 cm) barrel
Specifications
Mass38 ounces (1.1 kg) to 48 ounces (1.4 kg)
Cartridge.357 Magnum
ActionDouble-action
Maximum firing range200+ yards
Feed systemSix-roundcylinder
SightsRear adj.; front ramp

The Colt Python is a .357 Magnum caliber revolver formerly manufactured by Colt's Manufacturing Company of Hartford, Connecticut. It is sometimes referred to as a 'Combat Magnum'.[1] It was first introduced in 1955, the same year as Smith & Wesson's M29 .44 Magnum. Now discontinued, the Colt Python was intended for the premium revolver market segment. Some firearm collectors and writers such as Jeff Cooper, Ian V. Hogg, Chuck Hawks, Leroy Thompson, Scott Wolber, Renee Smeets and Martin Dougherty have described the Python as the finest production revolver ever made.[1][2][3][4][5][6][7]

  • 2History

Description[edit]

The Colt Python is a double action handgun chambered for the .357 Magnum cartridge, built on Colt's large I-frame. Pythons have a reputation for accuracy, smooth trigger pull, and a tight cylinder lock-up.[2] They are similar in size and function to the Colt Trooper and Colt Lawman revolvers.[8]

History[edit]

The Colt Python was first introduced in 1955 as Colt's top-of-the-line model and was originally intended to be a large-frame .38 Special target revolver.[3] As a result, it features precision adjustable sights, a smooth trigger, solid construction, and extra metal. Pythons have a distinct appearance due to a full barrel underlug, ventilated rib and adjustable sights.[3] Colt originally manufactured Pythons with hollow underlugs but left them solid to work as a stabilizing barrel weight. When the revolver is at full cock, just as the trigger is pressed, the cylinder locks up for the duration of the hammer strike. Other revolvers have a hint of looseness even at full-cock. The gap between the cylinder and forcing cone is very tight, further aiding accuracy and velocity.[2] From the 1970s each Python revolver was boresighted at the factory with a laser; the first mass-produced revolver for which this was done.[3]

End of production[edit]

In October 1999, Colt Manufacturing Co. announced that it was ceasing production of Python revolvers. In a 2000 follow-up letter to distributors, the company cited changing market conditions and the costs of defending lawsuits as the reasons for the discontinuation of the Python line, as well as a number of other models.[9] The Colt Custom Gun Shop continued making a limited number of Pythons on special order until 2005, when even this limited production ceased.[2][10]

Models and variants[edit]

Colt Python rollmark on the barrel.
Colt Python Target, 8-inch barrel .38 Special.

The Python was originally available in two finishes: Royal Blue and Bright Nickel. The Bright Nickel model was discontinued with the introduction of the more durable satin stainless and mirror-polished Ultimate Stainless models.[2] The stainless steel and Royal Blue finishes were offered until 2003 by Colt on the Python 'Elite' model.[8]

Pythons were available with 2.5-inch (6.4 cm), 3-inch (7.6 cm), 4-inch (10 cm), 6-inch (15 cm) and 8-inch (20 cm) barrels.[2] The six-inch model was the most popular generally, and the 8-inch model was intended for hunting. A 3-inch barrel version is very collectible, although not rare.[3]

The Python Hunter model, with 8-inch barrel and factory-installed 2X Leupold scope, was made in 1980.[11] The Python Hunter was the first field-ready handgun hunting package made by a major handgun manufacturer.[11] The scope was mounted on the barrel using Redfield mounts and the gun was packaged in a Haliburton case.[11] It was discontinued by 1990 and briefly offered as a 'Custom Shop' model afterward.[11] A Python Target model was made for several years in .38 Special only, in blue and nickel finishes.[8]

Two variants of the Python were made in small numbers by Colt. The first was the Colt Boa of 1985, a limited production .357 Magnum revolver, made for the Lew Horton Distributing Company in Massachusetts. It used a Python barrel mated to a Trooper Mk V frame. Six hundred 6-inch revolvers and 600 4-inch revolvers were made, of which 100 were matched sets. Though it resembles a Python visually, it is substantially different internally. The second was the stainless steel Colt Grizzly of 1994, another limited production .357 Magnum revolver. It used a Python barrel mated to a Colt King Cobra frame. 500 of these revolvers were manufactured, with 6-inch Magna-Ported barrels and smooth, unfluted cylinders. The ported barrel includes a bear footprint. Similar to the Grizzly was the Colt Kodiak, which was a Colt Anaconda with a Magna-Ported Barrel and an unfluted cylinder. Approximately 2000 Kodiaks were manufactured.[8]

According to Colt historian, R.L. Wilson, Colt Pythons have been collected by Elvis Presley and various kings in the traditional sense: 'H.M. (His Majesty) Hussein I of Jordan ordered a limited number of Pythons with 4-inch and 6-inch barrels, as gifts to his selected friends. Casing and barrel were embossed with His Majesty's crest. The Python for King Juan Carlos of Spain bore his name in flush gold on the sideplate. Among other celebrated recipients: King Khalid and Prince Fahd (Saudi Arabia), King Hassan (Morocco), Sheik Zayed (United Arab Emirates), President Anwar Sadat (Egypt) and President Hafez Assad (Syria).'[4]

Serial

Usage[edit]

Colt Pythons with 8-inch and 6-inch barrels and royal blue finish

The Python immediately made inroads into the law enforcement market when introduced, with the 6-inch barrel being popular with uniformed officers and the 4-inch barrel considered optimum for plainclothes use.[3] However, it has since fallen out of common use (along with all other revolvers) due to changing law enforcement needs that favor semi-automatic pistols. When law-enforcement agencies realized that the 9 mm semi-automatic pistols fire a round with similar characteristics to the .38 Special with higher capacity, they began a migration to these, and other, semi-automatic pistol cartridges.[12][13] The move away from the Python is also being driven by the increasing number of law enforcement agencies which require officers to carry department-issue weapons (as a way to reduce liability).

Python Serial Numbers V

The Colorado State Patrol issued 4-inch blue Pythons until their switch to the S&W .40 caliber autoloader.[14]Georgia State Patrol and Florida Highway Patrol issued Pythons to their officers.[14]

A Python, loaded with .357 Magnumsemiwadcutter bullets, was used to murder Irish crime reporter Veronica Guerin in 1996, an act which resulted in the creation of the Criminal Assets Bureau.[15][16]

Colt's Python revolvers are still popular on the used market and command high prices.[17]

Criticisms[edit]

Colt Python with open cylinder.

Official Colt historian R.L. Wilson described the Colt Python as 'the Rolls-Royce of Colt revolvers',[4] and firearms historian Ian V. Hogg referred to it as the 'best revolver in the world'.[7] However, the revolver is not without its detractors. The downside to the Colt Python's precision is its tendency to go 'out of time' with continued heavy shooting.[18] This is a condition in which the cylinder does not turn in exact alignment with the forcing cone, so a shooter may be sprayed with burning propellant when the gun is fired, or the gun may not fire when used as a double-action.[18] When this happens, the lockwork needs to be re-timed.[18]

Author Martin Dougherty notes the weight of the Python as a drawback, as it is quite heavy for a handgun of its caliber, ranging from 2.4 lbs (1.1 kg) to 2.6 lbs (1.2 kg). This makes the Python comparable to Smith and Wesson's premier .357, the M27 which weighs 2.6 lbs. (42 ounces) with a 4-inch barrel. Both revolvers are 6 to 9 ounces lighter than Smith & Wesson's more powerful M29 .44 Magnum, which weighs 3.0 lbs in 6½-inch barrel configuration (1.36 kg).[1]

See also[edit]

References[edit]

  1. ^ abcDougherty, Martin Small Arms: From the Civil War to the Present Day, New York City: Fall River Press, 2005, page 48. ISBN978-0-7607-6329-2
  2. ^ abcdefThe Colt Python .357 Magnum Revolver by Chuck Hawks at www.chuckhawks.com accessed April 27, 2009
  3. ^ abcdefThompson, Leroy; Rene Smeets (October 1, 1993). Great Combat Handguns: A Guide to Using, Collecting and Training With Handguns. London: Arms & Armour Publication. p. 256. ISBN978-1-85409-168-0.
  4. ^ abcWilson, R.L., The Colt Heritage, New York City: Simon & Schuster, 1987, P. 272.
  5. ^Wilson, R.L., Colt: An American Legend, New York City: Abbeville Press, 1985, P 272.
  6. ^Cooper, Jeff, 'Cooper on Handguns,' Los Angeles, Petersen Publishing Co., 1974, P. 189.
  7. ^ abHogg, Ian V. (1994)Military Small Arms: 300 Years of Soldiers' Firearms, Salamander Publishing
  8. ^ abcdTarr, James (November 18, 2013). Standard Catalog of Colt Firearms. Iola, Wisconsin: Krause Publications. pp. 120–121. ISBN978-1-4402-3747-8.
  9. ^For several years before that, however, the mighty Python's days were numbered, and some collectors believe the sterling quality of these guns were not the same during the 'strike years,' which began on January 24, 1986, when more than 1,000 workers struck the Colt Firearms division of Colt Industries and Colt hired replacement workers. Update from Colt's Manufacturing Company, Inc.Archived February 20, 2007, at the Wayback Machine
  10. ^The New York Times, October 22, 1986, 'After 8 Months, U.A.W. Sees Shift in Colt Strike.'
  11. ^ abcdMetcalf, Dick (1994). 'Top 10 Hunt Guns'. HandGunning. PJS Publications. 8 (5): 52–58.
  12. ^Bailey, William G (1995). The Encyclopedia of Police Science. Taylor & Francis. p. 309. ISBN0-8153-1331-4.
  13. ^New York City Police to Replace Revolvers With Semiautomatics The New York Times, By CRAIG WOLFF, Saturday, August 21, 1993, Accessed April 27, 2009.
  14. ^ abAyoob, Massad(2003)The Colt Python, The Accurate Rifle Magazine, November 2003
  15. ^Corcoran, Jody (March 2, 2014). 'Veronica led virtual one-woman crusade to bring down gangs'. Independent.ie. Retrieved December 23, 2014.
  16. ^Cusack, Jim (October 13, 2013). 'Gilligan returns, now just a trivial figure in a very changed landscape'. Independent.ie. Retrieved June 26, 2014.
  17. ^Fjestad, S.P. (August 18, 2015). 'Colt's Snake Guns'. American Rifleman.
  18. ^ abcRich Grassi (May 2005). 'C&S Python .357MAG'. Combat Handguns. Retrieved April 27, 2009.

External links[edit]

Colt Python Serial Number Lookup

Wikimedia Commons has media related to:

Python Serial Number Py 4801

  • Official Safety and Instruction Manual (.pdf)

Python Serial Number List

Retrieved from 'https://en.wikipedia.org/w/index.php?title=Colt_Python&oldid=893380590'