Add to Watchlist

It Works on My Machine: Writing Python Code for Any Environment

38 views

Citation of segment
Embed Code
Purchasing a DVD Cite video

Automated Media Analysis

Beta
Recognized Entities
Speech transcript
hi hi everyone my name is
colin and I'm a software developer data US where I primarily focused on developing the inverse Python the chaos and others but 0 in COI which is a Python-based command line interface for managing your universe resources and this is my talk at work so machine writing Python code bringing about the
better exploit them on so this is not familiar with that you start developing on a by the started building on your own machine and it works fine and and say this idea but another computer say it's a server or a or they did have revoked or another column that may be using this was made in this
respect the graphic that kind round so it fails the intuitive but the success the sailors case so you may be
wondering what is compatibility matter if were environment why do why would I care about it works on something somebody else's well if you ever want to adopt more uses for years program most users are not be running on the same environment as you very using a different Python version a different operating system and therefore it's important variable you can be able to run it successfully secondly usability helps drive popularity when there's no barriers to entry THE use your program it helps widen the range of possible uses many popular Python programs out there such as Django flasks request they all use they'll all have compatible across a bunch of different operating systems in Python versions and finally most the time it is not difficult insert compatibility across the different environments oftentimes is just a line here and there oftentimes little but a couple times it's all the more difficult but when go over will be covered in stock 1st going go into background about this sample application that most of the topics in the based around then talk about the different Python versions and how to ensure compatibility process and talk about compatibility across operating systems and finally how to write a test to ensure compatibility and help improve so the sample application we talk about is the same as minimizing phrase like I said before it's a Python-based alive used for managerial various resources but I decided to use this application because of what experience with it and in the end it's it's it's most users are not I think developers are not concerned with what high-conversion running or the operating system this was working the shell so many of the topics they cover our bases from my experience working with your life that it is still i is compatible on Python versions 2 4 2 6 5 and higher and Python 3 versus 3 3 9 it is also compatible on a bunch of different operating systems such as Linux Mac Unix Windows
so the 1st topic going to cover in terms of compatibility is by convergence this similar subtopics cover remaining so the difference is a string types across pattern versions and the possible limitations in their so with
renaming a lot of times when you're working with the across Python major versions that modules are the classes of the math functions may be renamed and this that we whenever developing until I I sometimes run into this in of course you may be asking how to handle that meaning most general solution is to use 6 6 is a compatibility library to help you write Python code as compatible prospect until Python 3 and it will handle lot of these conversions for you so here's an example the class which is a class that wraps data into a file like objects in Python to you written string library that Python 3 important from the audio library this series of you wrote a Python 2 style formatting in round I 3 code you get a bunch of importers but fortunately this solution is quite simple thanks to 6 you can just simply imports 6 per import StringIO from the 6 library however this spring depends case of what happens when there's no 6 compatibility for example and COI I we have to use the formatting function which is a function that returns a string in anaphora way expect to see in e-mail and I want to be imported from you know that Apple utils and provide 3 you imported from law case like I said before there is no sex conversion for you so the solution that is have your own compatibility model to handle all these convergence along products I worked on the call it's got Wi-Fi and is simply does have this logic 1st we check to see what the Python version you're working on and if it's Python for example that by 3 important the Python free version of a given importing format data and it's by considering you just do the Python 2 version of it then stability of that whenever you need actually sporadic just imported directly from the compact model note that it's a lot better to use the bottom the bottom way of importation speak
instead of having this code block in every single file you need format data because if you ever wanna change the logic you have to change it every single spot so the lessons
learned here is you sex is great for and all those compatibility this name commit changes across the the convergence and if you can do it uses a compact up the white so now we talked about renaming there's also string type differences across all the different have conversions so so you'll be get a change name and also change of functionality that you actually will have to handle so in 1 example of how to handle string types is input to the COI life so within the CIA I will have a bunch of different types of and we could be receiving and example
of silicon and so were trying to run the easy to describe regions command which will just print out what regions are available for you in in input we apply those region names of the value the US West underneath the Sealife be using all uses the art 1st library to create a name space of all the inputs that received and inside of this namespace the values may differ even across string datatypes so across different Python versions you can have different strength types so I can talk about this this pattern string actually cover and there's 2 ways that represent Python strings there it is string data represented as bytes constraint represented as unit code and went to the string class is string data represented as binary In unit code strained interrupt is represented as indicator and this change is low and the 3 and 5 3 by the class that represents stringent as binary and strain is the class represents string data as you can directly be handled using rapid that to put developments but more on top of that there's different functionality into Python classes are present versions so for example if you try to mix the 2 different string types here we're trying to concatenate a by strength you with a unit code string bot I once you understand implicitly encode in the implicit decoding for use such that when you can get Institute together you'll get to unit code string through barred by decoding through 1st and then adding the 2 together however this can cause issues for you if you take this example where here take the by strain interior and can this new culture nobody decoding areas where it tries to decode the 32 by string but it can't because it's asking and as out of range and country it's a little more strict on how to handle this so take the same 1 as before FIL get you can get you can't concatenate bytes string straight up and you will get you have a big message so the problem here it is how do you handle this when especially when you have no no control inputs that you may be receiving and you know that mixing string datatypes is not so the solution that we have that backgrounds will derive development is to ensure that the string type consistency is consistent right off the get-go for input your program so take this and take this method this method that we use when we receive an order Person in space the method person odds takes a name space here the 1st determines what the internal encoding is being used for standard and that and then what I'll do is old iterate through each namespace that was provided integer determine if there's any string strained string binary types so for example here using 6 which has a useful harbor method determines if the string that is represented by a depending on what Python version running on and if it is binary we we detect determines to decoded to string data type represents you encode such that any string
datatypes in namespace is represented as a so
it wasn't here is that the Python constraints differ semantically functionally and you do not want to mix the string datatypes especially at the end and valves the project because to be very hard to trace back what happened what were wrong introduce so make sure you ensure that the type is inconsistent as soon as possible so I've been talking about
a lot of these remains in and change functionality but what happens when the there's the functionality strip doesn't exist for winner development still there's a couple of occasions where there's no functionality especially for the Python version 2 6 and our solution to that is to actually backward the functionality example of
a backward is the water Dick class it's a pipe it's word dictionary that keeps track of when you introduce into the dictionary it's in Python to 7 higher but not in Python 6 and we don't have a dysfunctional from scratch it's a pretty large class to the right by hand so how do you prepare you would how would you go about doing this 1st you will want to add the conditional dependency 14 leaders of the party package that implements order date for us and we can call that in as a conditional passing to take a take this step of code from a sub lucky why file and we take our original requirements are normal requirements and then we use this system info tuple and determined that Python version is 2 6 and if it is will actually attend this new conditional into the into the requirements then the 2nd step in the order to make to hide the lack of functionality is too important using compact up the what In this case and here's an example snippet where we 1st tried to import club Quarterdeck's from were expected to be it was packed 7 which is the collections library if not imported from the third-party packages people so the lessons learned is you may need backward when needed but you want to make sure you limit the effect on uncharted Python versions especially with the dependencies you wanna make sure that you're not pulling in an unnecessary depends successive 217 don't need or reject because it's already in the library for you so the next time going to talk about
operating systems and how to make it compatible across all the properties of a bunch of proper systems you may run into so the 1st topic and talk about is probably going to talk about having a file past and finally back functionality like functionality me differ across systems so violently
most likely if you have a Python application that you're going to be have to deal files interface for files across operating systems is pretty similar or you can is you pretty much the open up a file with reader writer bytes but it's really the undocumented functionality they gotta be aware of that may be a limitation on operating system so for my introduction over my introduction for this I'm going to talk about the universe to receive you can and what this does is it upload files from your local file systems Amazon S 3 which is Amazon's storage service and similarly can download files from mastering copied around about and when it of command this command will work in parallel so it just makes a request to S 3 in parallel and does all writing and stuff that so the original
implementation of how we did this was we would have multiple threads in this case we would say 3 we would make it so that we may confirm request to S 3 where we're doing range gets for a specific object and once we get them at once once each thread world the data they venues right the 5 right to the specific point of wild note that they know exactly where the right saying that is arranged it so they can seek to where they want to and file in other kinds of links so that no 1 ever done writing dust I did and dust there struggle the correcting another part of transport however we ran into problems
of that's where it you start rapidly started with the brain file and you try seeking to the operating system will extend the file with the budget with a bunch of zeros and so when you're extending the following right into the same time some versions of Windows we found does not actually separate and does not have support for that word limitations and ends what happens with the corrupted files so
a solution that was to add I threads to amount of concurrent interactions of file here reads it the take the normal 3 friends in the class on the date it's desire thread which will then sequentially right the data to the file note that the the bottleneck here is not dial thread as making the request to across the network and retrieving the data is much lower than writing into the file
so the lesson learned here is that following behave rejecting it and they can vary greatly are not greatly but you can vary it in very subtle and you need to be aware of it and also to nodes help cover these undocumented behaviors is to limit the number of concurrent interactions you may have with file so I didn't cover all the time others issues we ran into but 1 example is if you have a file opening you try to remove a probability actually try to remove it you'll get back to trace back some windows so the best way to avoid all this is just a limit how many interactions in Newton may be having so if you are handling files you most likely having to deal file past and how the location of files represented so for venture I mean I bell off my previous example with the 3 cd command which has a recursive option which lets you upload a download a whole directory to ask the reason that it relies on being able to list files the problem is well past across operating systems so for example if you take a Linux if get the current working directory all all the you pass will be having a separator of a forward slash but for Windows it'll be backslashes and the way S 3 is represented in this still life is the likes version so for example if you take this here where have a local Linux machine in a transfer all test 3 if it's located at underneath my dear the name my biology 1 transfer just 3 you don't have to worry about it remains or anything of this transfer just fine where the object industry will be named file and have a prefix of my however for Windows look different there's no that in when at a backslash and thus in order to handle it you actually need to change yet and you normalize the separator in this case in Dallas used to transfer test 3 and still have the same function of the desired functionality of having a prefix my dear with that name I file so the general solution to handling this is to use the West library there's a lot of the functionality that will let you do when and a lot of these these things you made them there you may run into for example for for at least for the example I just provided if you can use the west of such property which will determine what separators history pattern can replace it with a normalized version which was was a forward slash in my example so the lessons learned here are files are represented can be represented differently across offering systems in you want be wary user West whenever you're handling task because if you have a hard time value in there will be will not mess up your your Python programs and finally and it's like a talk about across major Python versions under the talk about function differences in functionality across operating systems so 1 example of ran into different functional across operating systems used with the COI I helped him and so what your help command will do is if what if you typed on the command line just the command + help you'll get a man page that shows up and then the man visual and scroll through classes as needed implementation lies all we do is we generate output and then we take out the outputs you add pages such as and the command line utilities lasts for more the thing that 1 thing 1 that is less is like more but has all the more functionality so for example less if you hit the bottom of page 3 paging you can scroll back up the so the problem that we ran into was that when has the ability use both more and less but for Windows you can only use more we did not do we did not want to make a that we don't want to subtracting the functionality based on operating systems such as only 2nd use more for no matter what operating system because Linux has the functionality for less which is a little bit better pages use so ideally what we would ideally what we want is for Linux Mint operates and to use less for Windows machines users to use more so the solution here is actually a platform-specific the if use a platform that system call that what that what you do is determine what opera system running on and this that wondering is I'm checking to see if the system is Windows and also to return a helper specific for Windows if so if not I'll return a some printed and if you look at the subclasses the pages I can assign to it or you expect super windows we have that utility more infer plastics we have less however there's a lot of little bit more you can actually apply to this to help the healthiness of your program ideally when you have to have to overcome these different functional differences it's a it's a good idea to follow a speed which is to make sure that the group the objects in your group have the same interface such that any object a a method or function that may be calling these objects and expect a similar phase so for example if you take the parent class from the windows have rendered in the class itself rendered you'll notice that only has 1 public method which is a random method and the random method pretty much hides all the differences in functionality between Windows and non-Windows non-Windows machines and still despite the output the output that is generated the appropriate pages so similarly you can take like the help command that actually runs direction runs it and all that all has to do is called the rendered and it doesn't it wouldn't have to worry about what operating systems running on just retrieve appropriate and appropriate class and you can just call the random method on its you nature to actually do get get to do what you want to go so the lesson learned here are the operating system that operate system functionality differ in the does you need it is alright so you have platform specific code but if you're going add platform specific code you wanna make sure you traits and parity in the public interfaces such that it doesn't make any compromises making 1 class is an effective all functionality the other classes are a training program
similarly 1 similar tips and tricks about making paddle across Python versions cover how to write tests in mind right test and run test to mention the help better you're compatibility across the various different minus we run into
so the 1st a writing test I can't stress the importance of having having a good suite of a test just for the different and possible issues in their hands you it's also your stating that because you know there's a bunch of different compatibility issues you may run into and so the you're not gonna catch all this really going to help you did it's really help the union under the most likely examples in the form of the unit test module and you have to remember that all the techniques that talked about before still applies so if you answers to this can happen even nodes compatible on a bunch different 500 dropping systems you test are compatible the still failed so it's important to have compatibility there as well important now is to if use unit tests in the density pool in unit testing for Python 2 6 if I 6 it does have unit test positive unit test but the functionality is not the same as that for Python 2 7 or higher so Somalia like how we did how we made a use the functionality can count up the wife we can do it such here where if spikes sex will use unit tests will increase in and just using unit test and if it's not is used regularly unit test module so best practices 1 of the best way to catch if you're program is capable to run on a bunch different environments is to actually throw a bunch of common problem causing inputs into it and see what happens for example in 1 big 1 given values of it in there is unique and is also that just having that making the string a unit type is not enough even tho simulated values and there is great determine if you're your programs than having decoding errors there 1 similarly during its invites as well is a good idea as been shopping catch a lot of the different types of decoding errors that you may run into or you're mixing across the in the bowels of your project finally about past it's a good idea to to have semester destruction nested follows in it such as like and has a directory is just not just away your current working directory and even person unitarians your files and see seeing how if you're actually modifying the file Pascal is stable and all that so another thing I would like to talk about is file-handling in terms of testing a lot of times is pattern where you would blocked out a you will not get a lot of opera the West library always need an open open methods to In order the tree-like is following the object a string idea about SEO ideally for especially for integration testing it's better to use actual files because there is too great difference in parity beat for between phallic object extreme and actual folic objects and if you file it here programs using files known extends that use the real thing so here is an example of was years when your test is to look like in setting up a policy use 1st sample here in the set of this method what we do is we train a temper directory and you from that introductory you can add and if all you want in rights and get into it and then similarly once you have done setting it up you can any test case can actually running the use of just great from and industry down it's a great way to be able to just on the real thing the real type of house expecting program and finally there you may run into a situation where you actually need a test for environments for environment-specific behavior and ideally we want to make sure that it is share code passing a test but when you can it's a it's a script test two-step test you can just use the step that that were decorated in this case I'm skipping effort to Python 3 versions and I can sources given the platform specific so for example you I'm skipping it's not matter Linux so maybe asking now window notes good test ideally skipping test used the join to tested the functionality you you expect a person like that but differs based stuff well operates system Python version using or at the functionalities strip doesn't exist so if you're testing special files such as symbolic links for psychrophiles someone except as a having representation in Windows would be it's it's appropriate to skip here so to reiterate some of the main points here you want to make sure that you are testing common travel inputs to give a realistic idea of how it's able handle possible issues use the excuse expected types such as the trouble inputs and actual files and then step only when we absolutely need to as late as I said before no previous slide so now that have here you just rewritten you wanna know how to actually run the test and make sure it's runs all the environments they can possibly use so 1 of 1 of utility to make sure you have any warehouse is virtual and creating virtual environments for a specific type conversions is great for when you're developing and testing such that you know how well runs on 1st visit version and also use a couple of tools for addressing that is great nose is the test runner that can run through test week the stocks rituals that you can use it to set up your virtual environments RI Adjusted and this in turn down you retrovirus the and can do that for a budget of about Python versions and also which provides a lot of similar functionality so here's example of the types of finite file that you can see you can find life where well there is inspired to do it it's quite simple uploaded with the different environments that you want to support several example here we support 2 6 2 3 4 and then you always produces specify what the dependencies are researchers do the promise texting what the defense for the tests required and the commend you run around so here were just writing nose to run an actual test we and similarly we can have conditional dependencies for private use 6 and note that there is a requirement to 6 specifically for the unit test to dependency
so finally it you may be right wondering how to handle like different operating systems you only have like actors to Linux machine our mixture that I'm running on Windows the I would recommend using CI systems there the ones are Travis Engen constructed automatically links up to you did have repair so cannot only to talk you can automatically test a bunch of these different pressures they make and make sure that support across all different Python versions and and similarly for a when foraging together we can do is you can launch a like city winners instances with chickens installed you can run builds up to test based off what recently Jeriko so in
conclusion some of the major
topics that will like to reiterate is to use sex whenever you run into apartment compatibility which have a remaining it's but are also determining like what Python version running on or determine what string type you're dealing with string types remember that mixing that you're bad there is different there's different interventions across the major part conversions investment analyst ensure that they're all the same at the very beginning of program file-handling this 1 of the major issues around and there it is there may be there may be undocumented behavior that you may not be the 1 where the best way to avoid is still limited in their interactions with that the violent and then with limitation handling where you need to do is oftentimes backward function our compensate for the functionality and then heightened whether you're importing differently for the war or if you're trying to use Ellis the title of the functional differences and finally you also test is closely as possible to reality you this oftentimes catch a lot of these different issues you may run into and finally read the documentation as a final influence that there often times this is the 1 liner and they're saying it's missed by conversion supported or sufferings systems supported they can help you save it save troubles next time you're writing Europe project and thanks again here it is not get every go forward visualize here is my profile I think about over time on the that 3 that yet again so yes so here's my get everything and my profile if you have any questions about the projects that work on a free free larceny me and be here all week on and that's the so we have some more time left for the questions I've been using a terrestrial life for a while and I'm fine I was finding it quite
hot to get used to the help I like candling with the accommodation and what's available on this on the go online because usually when you work on Unix-based systems than the convention is like that just help at the end of the command to see the actual help and then man as for manual pages is that because of the compatibility with Windows systems that you you decided to use like just help at the end and no manual for of that images I think this is implementation detail is like how we decide designed it I believe we just decided use help just the I mean so what is the time when it doesn't have a montage right so having a helpless is this intuitive there's also load the bike future library I think it's that there alternatives a 6 yeah features yeah yeah but that do have very polite because it's compared to 6 and on the sixes quite old and then some the reserve that's when you should use some different approaches think yeah for the for the that I just during based often would conceal and all predatory which is you because it's it's just a little very well wait temple way of handling these can these compatibilities and since every summer project we actually use features for example for a reuse features for some of our book multiprocessor multithreaded a list of artists who supports like windows replacement of at 6 or 3 4 still and I think this is I would say it is getting at all were getting all working on across all the different machines is very different environments is colored and I would say that 1 part of the others certainly there's some some very high hundreds have limitations when it's have limitations is just trying to get it also work well because sometimes you may have a logic for 1 that is it is a lot of other things change in and it doesn't work another machine and it's saturated fat and all to doable was conclusion if I'm developing with the sum of but library that is in the Babylonian variable going package and uh sometimes they update it just of the of the packet show will be updated and that I'm not sure if it works so I can use will be true as told but there are some but but it is the depending dependent on the other no external packages that are not directly with the Python connected some some some C libraries hold Julio vehicles and fill lies with the use of OPEC use in their aggression as here question of how would you go but each the different versions also point toward the packages that are not they could use the the ROC libraries that get updated sometimes so in the background to a lot of natural whether I can use it with the new rule python package or not but usually there is a number word that doesn't have a version instructed the connection what anteversion 1st you feel comfortable with those numerical yeah I'm not that I'm not too sure about that he yeah I want to suggest that making sure that year struck this reverse latest can comfortable with this problem that's what they're talking to the more questions so the only problem that I see is that In my opinion you need to have a clear idea of what you need to and to do differently for a different environment it's not something that is going to come and on its own so how can I know what I need to make differently for different environment I mean and windows words differently from Linux and and 2 . 7 works differently from 2 . 6 or whatever but I don't know the different cases so I cannot foresee them How can know them before I have to test the architect well and the problem the best way to do that is to just like a said using a virtual and for spinning up like an E C 2 instance with that easy to instances of that's integrated weights to just the final around project as a developing and to see if there's any issues that you were may run into as you are developing so law questions focused on securing much
Server (computing)
Building
Computer animation
Computational number theory
Software developer
Universe (mathematics)
Virtual machine
Chaos (cosmogony)
Machine code
Binary file
Machine code
Thermodynamic system
Statistical hypothesis testing
Computer programming
Vapor barrier
Line (geometry)
Multiplication sign
Range (statistics)
Online help
Insertion loss
Interface (computing)
Usability
Revision control
Roundness (object)
Video game
Gastropod shell
Operating system
Subtraction
Operations research
Thermodynamic system
Process (computing)
Military base
Software developer
Sampling (statistics)
Line (geometry)
Density of states
Euler angles
Cartesian coordinate system
Computer animation
Personal digital assistant
Finite difference
Revision control
System programming
Window
Email
Greatest element
Computer file
Multiplication sign
Revision control
Mathematics
Roundness (object)
Type theory
Term (mathematics)
String (computer science)
Utility software
Data conversion
Subtraction
Social class
Stability theory
Compact space
Series (mathematics)
Email
Product (category theory)
File format
Physical law
Model theory
Machine code
Limit (category theory)
Functional (mathematics)
System call
Arithmetic mean
Spring (hydrology)
Computer animation
Personal digital assistant
Logic
String (computer science)
Revision control
Module (mathematics)
Pattern language
Modul <Datentyp>
Object (grammar)
Freeware
Writing
Library (computing)
Email
Computer file
File format
Block (periodic table)
Machine code
Functional (mathematics)
Mathematics
Video game
Type theory
Computer animation
Logic
String (computer science)
String (computer science)
output
Data Encryption Standard
Data conversion
output
Data type
Subtraction
System call
Interior (topology)
Chatterbot
Range (statistics)
Parsing
Binary code
Unicode
Optical disc drive
Mathematics
Type theory
Code
Codec
Module (mathematics)
Social class
Area
Spacetime
Constraint (mathematics)
Namespace
Software developer
Computer file
Binary code
Price index
Port scanner
Functional (mathematics)
Position operator
Message passing
Order (biology)
Interrupt <Informatik>
output
Right angle
Pattern language
Code
Data type
Computer programming
Game controller
Consistency
Line (geometry)
Determinism
Revision control
String (computer science)
Data mining
Integer
output
Subtraction
Units of measurement
Data type
Beer stein
Dialect
Consistency
Machine code
Euler angles
Computer animation
String (computer science)
Iteration
Library (computing)
Revision control
Constraint (mathematics)
Type theory
Computer animation
Consistency
String (computer science)
String (computer science)
Software developer
Projective plane
Data type
Functional (mathematics)
Data type
Trail
Computer file
Multiplication sign
Water vapor
Limit (category theory)
Data dictionary
Proper map
Independence (probability theory)
Sound effect
Revision control
n-Tupel
Damping
Social class
Thermodynamic system
Information
Sound effect
Machine code
Functional (mathematics)
Category of being
Word
Computer animation
Personal digital assistant
Order (biology)
Revision control
System programming
Right angle
Library (computing)
Point (geometry)
Implementation
Service (economics)
Thread (computing)
Computer file
Range (statistics)
Parallel port
Mereology
Latent heat
Linker (computing)
File system
Implementation
Thermodynamic system
Computer file
Heat transfer
Interface (computing)
Parallel port
Euler angles
Cartesian coordinate system
Limit (category theory)
Functional (mathematics)
Computer animation
Data storage device
Personal digital assistant
Universe (mathematics)
Right angle
Local ring
Thread (computing)
Concurrency (computer science)
Computer file
Multiplication sign
Computer file
Interactive television
Limit (category theory)
Revision control
Word
Computer animation
Computer network
Operating system
Right angle
Window
Social class
Statistical hypothesis testing
NP-hard
Greatest element
Concurrency (computer science)
Direction (geometry)
Multiplication sign
Function (mathematics)
Interface (computing)
Thermodynamic system
Machine code
Variance
Video game
Social class
Thermodynamic system
Computer file
Bit
Port scanner
Functional (mathematics)
Maxima and minima
Category of being
Phase transition
Order (biology)
Pattern language
Right angle
Writing
Ocean current
Web page
Computer programming
Implementation
Computer file
Parity (mathematics)
Virtual machine
Similarity (geometry)
Online help
Limit (category theory)
Heat transfer
Open set
Number
Wave packet
Revision control
Social class
Latent heat
Natural number
Utility software
Operating system
Software testing
Implementation
Subtraction
Metropolitan area network
Computing platform
Inheritance (object-oriented programming)
Interactive television
Directory service
Machine code
Euler angles
Limit (category theory)
System call
Local Group
Uniform resource locator
Computer animation
Visualization (computer graphics)
Personal digital assistant
Vertex (graph theory)
Object (grammar)
Window
Local ring
Separation axiom
Library (computing)
Statistical hypothesis testing
Suite (music)
INTEGRAL
Mountain pass
Multiplication sign
Source code
1 (number)
Unicode
Video game
Type theory
Stress (mechanics)
Linker (computing)
Data conversion
Error message
Uniform space
Exception handling
Metropolitan area network
Thermodynamic system
Computer file
Point (geometry)
Sampling (statistics)
Shared memory
Unit testing
Instance (computer science)
Functional (mathematics)
Statistical hypothesis testing
Order (biology)
System programming
Module (mathematics)
output
Personal area network
Pattern language
Virtual reality
Data type
Writing
Point (geometry)
Computer programming
Slide rule
Beat (acoustics)
Finitismus
Computer file
Parity (mathematics)
Real number
Disintegration
Virtual machine
Similarity (geometry)
Electronic mailing list
Hand fan
Revision control
Mixture model
Social class
Latent heat
Goodness of fit
Population density
Term (mathematics)
String (computer science)
Utility software
Representation (politics)
Software testing
Scripting language
output
Subtraction
Units of measurement
Computing platform
Form (programming)
Condition number
Projective plane
Machine code
Directory service
Set (mathematics)
Extreme programming
Symbol table
Computer animation
Personal digital assistant
Finite difference
Revision control
Data Encryption Standard
Object (grammar)
Pressure
Window
Library (computing)
Statistical hypothesis testing
Computer programming
Thermodynamic system
Multiplication sign
Point (geometry)
Projective plane
Euler angles
Limit (category theory)
Mereology
Functional (mathematics)
Statistical hypothesis testing
Revision control
Video game
Computer animation
Profil (magazine)
String (computer science)
String (computer science)
Data conversion
Subtraction
Implementation
Multiplication sign
Virtual machine
Online help
Weight
Mereology
Rule of inference
Number
Revision control
Medical imaging
Natural number
Lie group
Metropolitan area network
Thermodynamic system
Physical law
Projective plane
Electronic mailing list
Instance (computer science)
Limit (category theory)
Connected space
Word
Summation
Exterior algebra
Numeral (linguistics)
Logic
Personal digital assistant
Window
Library (computing)

Metadata

Formal Metadata

Title It Works on My Machine: Writing Python Code for Any Environment
Title of Series EuroPython 2015
Part Number 24
Number of Parts 173
Author Knapp, Kyle
License CC Attribution - NonCommercial - ShareAlike 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this license.
DOI 10.5446/20149
Publisher EuroPython
Release Date 2015
Language English
Production Place Bilbao, Euskadi, Spain

Content Metadata

Subject Area Information technology
Abstract Kyle Knapp - It Works on My Machine: Writing Python Code for Any Environment Have you ever developed a nice, well-working python program on one environment, only to have it blow up with exceptions and tracebacks when you run it on a different environment? Have no fear! This talk will show you how to write and maintain python code that is compatible across environments that may differ by python versions and/or operating systems. Techniques and tips will be drawn from lessons and experiences gained from making the AWS CLI, a python-based command line tool to manage AWS resources, compatible across a wide range of environments. In a case-study-like format, real-life compatibility issues encountered while developing the AWS CLI will be presented along with how we resolved each of them. These real-life examples will encompass, but will not be limited to, the following topics: • How to use functions and classes that may differ across python versions and/or operating systems • How to handle version-specific bugs • How to handle strings, bytes, and Unicode across python versions • How to handle differing locale settings • How to handle file operations across operating systems • How and when to vendor dependencies • How to write tests that are compatible across python versions and operating systems • How to create a testing environment that monitors compatibility of code across various environments Ultimately, the goal of these examples is introduce to you some effective, real-world programming practices to overcome your current or next compatibility issue.
Keywords EuroPython Conference
EP 2015
EuroPython 2015

Recommendations

Loading...
Feedback
AV-Portal 3.5.0 (cb7a58240982536f976b3fae0db2d7d34ae7e46b)

Timings

  660 ms - page object