pip vs pip2 vs pip2.7?
Hi everyone, this is my first post here. I've been using Python occasionally to accomplish some specific tasks but now I decided to study it more seriously. I am successfully using both Python 2.6.2 and Python 3.2.2 instaled on Windows. I installed 2.6.2 back in 2009. and 3.2.2 came along with the VPyton 5.74 MSI installer. There was no problems but today I decided to install Python 2.7.11 as the latest pre-3.x.x version and the first thing I noticed was the 'Scripts' folder which was not present in earlier versions, containing: easy_install.exe easy_install-2.7.exe pip.exe pip2.exe pip2.7.exe So my question is - which one should I use to install the Python packages? Should I just use pip, of pip2 or pip2.7 and what is the difference? Typing: pip list in command prompt says: >pip list pip (7.1.2) setuptools (18.2) You are using pip version 7.1.2, however version 8.1.2 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command. >pip2 list and >pip2.7 list results in exactly the same - what is then purpose of three different 'pip*.exe' executables? I noticed both easy_install files are of the same size (89.448 bytes) and all 3 of the pip files are of the same size (89.420 bytes) as well. In fact, easy_install.exe and easy_install-2.7.exe are exactly the same compared by binary compare utility, and pip, pip2 & pip2.7 are exactly the same up to the single byte :-/ I am assuming multiple copies of the same file with different names are because of some compatibility issues but couldn't find any explanations so I hope someone can point me to some docs explaining the issue. -- Let There Be Light Custom LED driveri prema specifikacijama http://tinyurl.com/customleddriver Chupo -- https://mail.python.org/mailman/listinfo/python-list
python-2.7.11.msi destroys PATH env var?
After installing Python 2.7.11 through python-2.7.11.msi Windows installer OS couldn't anymore detect antivirus software so after some investigation I found that PATH environment variable was completely removed from the system. I had to recreate the PATH var and add: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem; into the path so the WMI could detect antivirus again. Can anyone confirm the same problem? I marked 'Add python.exe to PATH' during the installation process. -- Let There Be Light Custom LED driveri prema specifikacijama http://tinyurl.com/customleddriver Chupo -- https://mail.python.org/mailman/listinfo/python-list
Re: pip vs pip2 vs pip2.7?
In article , Random832 says... > The idea is, if you have multiple python installations on your path, > "pip" will find the first one, "pip2" will find the first python2 one > (so if the first one was python3, or vice versa), and pip2.7 will find > 2.7 even if e.g. 2.6 was before it on the path. > > It makes a bit more sense on Unix where all of these are in /usr/bin and > only the primary "pip" [of whatever your main python installation] > actually exists. > Thank you very much for the reply! So I guess it will be safe if I just add only 2.7 installation dir to the PATH var and use 'pip'. -- Let There Be Light Custom LED driveri prema specifikacijama http://tinyurl.com/customleddriver Chupo -- https://mail.python.org/mailman/listinfo/python-list
Trying to figure out the data type from the code snippet
I am trying to figure out what data type is assigned to variable p in this code snippet: for p in game.players.passing(): print p, p.team, p.passing_att, p.passer_rating() Results: R.Wilson SEA 29 55.7 J.Ryan SEA 1 158.3 A.Rodgers GB 34 55.8 https://stackoverflow.com/q/28056171/1324175 If p is a string ('print p' prints names of the players) then how is possible to access p.something? If p is an object, then how can p return a string? -- Let There Be Light Custom LED driveri prema specifikacijama http://tinyurl.com/customleddriver Chupo -- https://mail.python.org/mailman/listinfo/python-list
Re: Trying to figure out the data type from the code snippet
In article , Cameron Simpson says... > What you're probably wanting to know is that the print statement calls > str(x) for every "x" which it is asked to print, and that "p" has a > __str__ method returning the "R.Wilson" string (etc). All object's have > an __str__ method, and for "p" it has been defined to produce what looks > like a player's name. > Yes, that is exactly what answers my question, thank you very much for such a comprehensive explanation! I couldn't use type() because implementation of: game.players.passing() is not known. This is all info I saw: https://stackoverflow.com/q/28056171/1324175 I searched Google using quite a few search strings, for example: python object returning value python class returning value python dot python attribute but didn't find an answer because I didn't know what exactly should I search for. Best Regards -- Let There Be Light Custom LED driveri prema specifikacijama http://tinyurl.com/customleddriver Chupo -- https://mail.python.org/mailman/listinfo/python-list
Re: Trying to figure out the data type from the code snippet
In article , DL Neil says... > Alternately/additionally, if you ask help(p), it will reveal-all about > the "class" (of which p is an "instance") - including some answers to > your second question (and perhaps others which logically follow-on). Yes, but unfortunately this was all I had: https://stackoverflow.com/q/28056171/1324175 -- Let There Be Light Custom LED driveri prema specifikacijama http://tinyurl.com/customleddriver Chupo -- https://mail.python.org/mailman/listinfo/python-list
Re: Trying to figure out the data type from the code snippet
In article <8bff3a64-e154-4e39-b558-952e8f28a...@googlegroups.com>, Rick Johnson says... > Listen... if you are not familiar with all of Python's built-in functions, > all special methods of Python objects, and all the methods of strings, > integers, floats, lists, tuples, dicts (and possibly others that i forgot > to mention), you can't do much of anything with this language. > > I would advise you to read a beginners tutorial. I am by any means not Python expert but I do have a basic Python knowledge and I do occasionally use Pyhon to perform some tasks. I am not a professional programmer but rather an electrical engineer and I am using various programming languages since 1982. I started with Z80 and 6502 assembler, Fortran, Pascal, ... and since I am often using microcontrollers my main programming languages are C and assembler. However, sometimes when I have to process some data, parse some file, generate some data, extract of filter some results acquired by sampling or measuring analog values, ... I do use Python - although I never learnt it from the book. I am using Python as a tool to accomplish the tasks as they 'arrive' and although my code is for sure not written in Pythonic way - it works. Since arrival of various SoCs (e.g. Rasbperry Pi) I used Python not only for pre/post processing the data but for building applications as well and some of the Python programs I wrote are: - Driver for *very* fast 3D printer which is unique in its construction - Filtering the data acquired from multiple AD converters sampling movements of human body using Savitzky-Golay filter - Program for sending large amount of data in real time via I2C BUS towards multiple microcontrollers every 10 ms (I used threading and Queue from multiprocessing and I am, upon sending the data over I2C BUS, scheduling a new thread in a way timing disturbances caused by background tasks and interrupts don't accumulate over time) - Programs used as 'a glue' between node.js code and microcontrollers - Interpolating the data used for sinhronizing lip movements of humanoid robot with spoken words between the keyframes - 3D animation of humaniod robot arms based on the data acquired by motion capture and by recording movements using rotary encoders And yes, I did use OOP. For example, I can use my driver for 3D printer to print one layer as follows: from Printer3D import Head import numpy as np import cv2 import glob import time np.set_printoptions(threshold=np.nan) layer = cv2.imread("./png_input/layer.png") visina, sirina = layer.shape[:2] print visina, sirina layer = cv2.cvtColor(layer, cv2.COLOR_BGR2GRAY) #layer = cv2.resize(layer, None, fx=0.5, fy=0.5, interpolation = cv2.INTER_AREA) hd = Head(layer) hd.setSteps_x(44, 44, 382) hd.setDistance(21) hd.setHead_GPIO([0, 4, 17, 27, 22, 10, 9, 11, 5, 6]) hd.setMotor_GPIO([13, 19, 26, 21, 20, 16]) hd.move(Head.ROW_UP, 10) hd.printLayer() hd.move(Head.UP, 10) So, the truth is - I am indeed (obviously) not familiar with everything you mentioned but you can decide for yourself if everything I already did using Python could be classified as 'not much'. -- Let There Be Light Custom LED driveri prema specifikacijama http://tinyurl.com/customleddriver Chupo -- https://mail.python.org/mailman/listinfo/python-list
Re: Trying to figure out the data type from the code snippet
In article , DL Neil says... > It can't be - there must be some source for p (code and data)! Surely > you're only showing us a small portion of the code? > I am not author of the question on StackOverflow. I was looking for something about Python and that question was among the search results. You can see the question was asked 4 years ago. -- Let There Be Light Custom LED driveri prema specifikacijama http://tinyurl.com/customleddriver Chupo -- https://mail.python.org/mailman/listinfo/python-list
Re: Trying to figure out the data type from the code snippet
In article <67d5c4bc-7212-43d0-b44f-7f22efffa...@googlegroups.com>, Rick Johnson says... > I'm impressed! But you're asking basic questions that someone with your > resume should either (1) already know, or (2) be competent enough to find on > their own. Now don't get me wrong. My intention is not to ridicule you. But, > with your resume, you should be embarrassed to ask such basic questions. You > are obviously not an idiot. If you can do what you claim you can do, then you > are intelligent and driven person. There are redeemable qualities. Don't waste them. And don't undercut your reputation by appearing to be a hapless rube. I was thought there aren't stupid questions, just stupid answers and I for sure won't apologize for asking any question. If someone things the question I asked is stupid they can ignore it. I am not affraid of losing my reputation by asking a question. > Hmm. I don't see anything here that a child couldn't be taught to do. You failed to see the point of the code snippet I pasted, let me explain what was my intention to show with that code: Since I said I wrote a driver for 3D printer and since there is: from Printer3D import Head at the beginning of the code and there is: hd = Head(layer) below - from just those two lines you could conclude I wrote Head class meaning I *am* aware what object is. And since hd.printLayer() obviously does print a layer of the material, that means my 3D printer driver is working well. I assumed you could imagine that the driver for driving the head of 3D printer is not just a few lines of code, that it works in real-time and that it interacts with the hardware. > Your reseme may be impressive... What I mentioned is not my resume, I just mentioned what I, knowing only Python basics, did using Python. My resume includes: Embedded devices for industry process control automation (temperature, fluid level, time, data from PID controller, ?); VFD control systems with complex menu structure, user friendly interface, failsafe and data retention; IoT applications; multi-channel sound generation; bike computer; remote data acquisition over RF; data logging; ERP software coding (C#); client&web service sw for warehouse handheld data acquisition system (SOAP requests), software for CNC machines duty simplifications and many more I am an expert on embedded systems design with more than 50,000 lines of C code built-in in various working firmwares. I both designed and built many embedded electronic devices based on various microcontrollers doing all the production stages, designing circuit schematics, calculating the elements, designing printed circuit boards, generating Gerber files according to the manufacturing requirements, soldering components (both TH and SMD) and coding&debugging the firmwares. By utilizing GCC based toolchain and Bare Metal Programming, developing my own libraries and optimizing the most critical routines by writing them in assembler I can often design the devices based on 16 MHz or even just 8 MHz Atmel AVR line of microcontrollers, where others would resort to using 72 MHz ARM or even more powerful processors. Although my carefully optimized devices usually outperform the devices based on even much more powerful hardware, I am using the newest generation of microcontrollers such as ESP8266 and ESP32 as well. I learnt Z80 assembler when I was 10 and after years of coding in both Z80 and 6502 assembler it was easy to start using Microchip's PIC microcontrollers. Later on I switched to Atmel's (now Microchip) microcontrollers and to the newest ones I mentioned before. I can start using completely new family of microcontrollers and completely new toolchains in a matter of days. I coded all sorts of SPI, I2C, UART, 1-Wire etc. and custom communication routines, both using the hardware peripherals and/or bit banging algorithms, hardware/software PWM, efficient debounce algorithms, multitasking environments, routines for precise measuring of pulse lengths, complex ISR routines with carefully calculated T-states (cycles) per pass, DDS algorithms, graphic display libraries, libraries for communicating with various devices (e.g. NRF24L01+), EEPROM wear leveling routines and many more. Furthermore, I have a vast experience with reverse engineering .hex files extracted from microcontrollers which allows me to easily proof the assembly code generated by the compiler in order to - if necessary - rewrite the code in a more efficient way, while my deep understanding of serial and parallel programming protocols, bootloaders, JTAG debugging and inner workings of a microcontroller allows me to cope with all kinds of problems that could be met while developing embedded devices (e.g. noisy environments, black-outs, brown-outs, BUS contention, contact bounce, ?). Additionally, I have a reasonable knowledge of Genetic and other AI algorithms (pathfinding, game
Re: Trying to figure out the data type from the code snippet
> I was thought > I meant: 'I was taught'. -- Let There Be Light Custom LED driveri prema specifikacijama http://tinyurl.com/customleddriver Chupo -- https://mail.python.org/mailman/listinfo/python-list
Re: Trying to figure out the data type from the code snippet
In article , Chris Angelico says... > There are stupid questions, but I enjoy answering those too. You don't > need to apologize for asking these questions. All you need to do is > ignore the trolls like Rick. In fact, if you abandon Google Groups and > instead read the mailing list python-list@python.org, you can just > leave behind all the people who've been blocked. > Thank you for the tip. I am in fact not using Google Groups but am accessing comp.lang.python via nntp:// by using a newsreader. I think Google Groups destroyed usenet. -- Let There Be Light Custom LED driveri prema specifikacijama http://tinyurl.com/customleddriver Chupo -- https://mail.python.org/mailman/listinfo/python-list
Re: Trying to figure out the data type from the code snippet
In article , Chris Angelico says... > Ah okay. You may want to killfile a few people then, since you're > using an actual real newsreader and have that capability. > Yes, Gravity has Bozo Bin for that purpose :-) But although I've been using newsgroups for 20 years I've never blocked a single person by using a filter because it is not hard to just not open certain messages posted by known authors. Especially nowadays when post count is so low. -- Let There Be Light Custom LED driveri prema specifikacijama http://tinyurl.com/customleddriver Chupo -- https://mail.python.org/mailman/listinfo/python-list
Re: Trying to figure out the data type from the code snippet
In article , Rick Johnson says... > You know _all_ that What I mentioned is just a small excerpt of what I know :-) > yet... you didn't know about the built-in `type()` method? Exactly :-) > Well, that's just great. We can only hope you don't try your hand at any > mission-critical code. And i suppose when the plane crashes you can always > fall back on the "beautiful plumage" of your resume, eh chap? > Now that you are saying that, I thing I should abandon my 150 km/h racing quadcopter flight controller project :-O Especially because my idea was to use PYTHON for analyzing the data from onboard black box flash in order to fine tune PIDs. Hahah LOL :-) -- Let There Be Light Custom LED driveri prema specifikacijama http://tinyurl.com/customleddriver Chupo -- https://mail.python.org/mailman/listinfo/python-list