martes, 27 de junio de 2017

PYTHON HEAD FIRST, FIRST STEPS SESSION3

Un programa para dado un archivo, separarlo en dos, en base a un campo delimitador que se repite constantemente

Damos este archivo

Man: Is this the right room for an argument?
Other Man: I've told you once.
Man: No you haven't!
Other Man: Yes I have.
Man: When?
Other Man: Just now.
Man: No you didn't!
Other Man: Yes I did!
Man: You didn't!
Other Man: I'm telling you, I did!
Man: You did not!
Other Man: Oh I'm sorry, is this a five minute argument, or the full half hour?
Man: Ah! (taking out his wallet and paying) Just the five minutes.
Other Man: Just the five minutes. Thank you.
Other Man: Anyway, I did.
Man: You most certainly did not!
Other Man: Now let's get one thing quite clear: I most definitely told you!
Man: Oh no you didn't!
Other Man: Oh yes I did!
Man: Oh no you didn't!
Other Man: Oh yes I did!
Man: Oh look, this isn't an argument!
(pause)
Other Man: Yes it is!
Man: No it isn't!
(pause)
Man: It's just contradiction!
Other Man: No it isn't!
Man: It IS!
Other Man: It is NOT!
Man: You just contradicted me!
Other Man: No I didn't!
Man: You DID!
Other Man: No no no!
Man: You did just then!
Other Man: Nonsense!
Man: (exasperated) Oh, this is futile!!
(pause)
Other Man: No it isn't!
Man: Yes it is!


lo quiero dividir en dos archivos donde se vaya cargando la información dependiendo de si lo dice Man or Other








Programa:
man = []
other = []

try:
    data = open('sketch.txt')

    for each_line in data:
        try:
            (role, line_spoken) = each_line.split(':', 1)
            line_spoken = line_spoken.strip()
            if role == 'Man':
                man.append(line_spoken)
            elif role == 'Other Man':
                other.append(line_spoken)
        except ValueError:
            pass

    data.close()
except IOError:
    print('The datafile is missing!')

try:
    man_file = open('man_data.txt', 'w')
    other_file = open('other_data.txt', 'w')

    print(man, file=man_file)
    print(other, file=other_file)

    man_file.close()
    other_file.close()
except IOError:
    print('File error.')







Resultado 

Man_data.txt:
['Is this the right room for an argument?', "No you haven't!", 'When?', "No you didn't!", "You didn't!", 'You did not!', 'Ah! (taking out his wallet and paying) Just the five minutes.', 'You most certainly did not!', "Oh no you didn't!", "Oh no you didn't!", "Oh look, this isn't an argument!", "No it isn't!", "It's just contradiction!", 'It IS!', 'You just contradicted me!', 'You DID!', 'You did just then!', '(exasperated) Oh, this is futile!!', 'Yes it is!']


Other_data.txt

["I've told you once.", 'Yes I have.', 'Just now.', 'Yes I did!', "I'm telling you, I did!", "Oh I'm sorry, is this a five minute argument, or the full half hour?", 'Just the five minutes. Thank you.', 'Anyway, I did.', "Now let's get one thing quite clear: I most definitely told you!", 'Oh yes I did!', 'Oh yes I did!', 'Yes it is!', "No it isn't!", 'It is NOT!', "No I didn't!", 'No no no!', 'Nonsense!', "No it isn't!"]



The standard library's pickle, using the pickle.dump() function saves data to disk

The pickle.dump() function saves data to disk

The pickle.load function restores data from disk




sábado, 24 de junio de 2017

PYTHON HEAD FIRST, FIRST STEPS SESSION2







>>> import os
>>> os.getcwd
<built-in function getcwd>
>>> os.chdir('C:\hf\read')
Traceback (most recent call last):
  File "<pyshell#76>", line 1, in <module>
    os.chdir('C:\hf\read')
OSError: [WinError 123] El nombre de archivo, el nombre de directorio o la sintaxis de la etiqueta del volumen no son correctos: 'C:\\hf\read'
>>> os.chdir('../hf/read')
Traceback (most recent call last):
  File "<pyshell#77>", line 1, in <module>
    os.chdir('../hf/read')
FileNotFoundError: [WinError 3] El sistema no puede encontrar la ruta especificada: '../hf/read'
>>> os.getcwd
<built-in function getcwd>
>>> os.getcwd()
'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35'
>>> os.chdir('../hf/read')
Traceback (most recent call last):
  File "<pyshell#80>", line 1, in <module>
    os.chdir('../hf/read')
FileNotFoundError: [WinError 3] El sistema no puede encontrar la ruta especificada: '../hf/read'
>>> os.chdir('/hf/read')
Traceback (most recent call last):
  File "<pyshell#81>", line 1, in <module>
    os.chdir('/hf/read')
FileNotFoundError: [WinError 3] El sistema no puede encontrar la ruta especificada: '/hf/read'
>>> os.chdir('./hf/read')
>>> os.getcwd()
'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\hf\\read'
>>> data = open('sketch.txt')
>>> print(data.readline(), end='')
Man: Is this the right room for an argument?
>>> print(data.readline(), end='')
Other Man: I've told you once.
>>> data.seek(0)
0
>>> for each_line in data:
print(each_line, ends='')


Traceback (most recent call last):
  File "<pyshell#90>", line 2, in <module>
    print(each_line, ends='')
TypeError: 'ends' is an invalid keyword argument for this function
>>> for each_line in data:
print(each_line, end='')


Other Man: I've told you once.
Man: No you haven't!
Other Man: Yes I have.
Man: When?
Other Man: Just now.
Man: No you didn't!
Other Man: Yes I did!
Man: You didn't!
Other Man: I'm telling you, I did!
Man: You did not!
Other Man: Oh I'm sorry, is this a five minute argument, or the full half hour?
Man: Ah! (taking out his wallet and paying) Just the five minutes.
Other Man: Just the five minutes. Thank you.
Other Man: Anyway, I did.
Man: You most certainly did not!
Other Man: Now let's get one thing quite clear: I most definitely told you!
Man: Oh no you didn't!
Other Man: Oh yes I did!
Man: Oh no you didn't!
Other Man: Oh yes I did!
Man: Oh look, this isn't an argument!
(pause)
Other Man: Yes it is!
Man: No it isn't!
(pause)
Man: It's just contradiction!
Other Man: No it isn't!
Man: It IS!
Other Man: It is NOT!
Man: You just contradicted me!
Other Man: No I didn't!
Man: You DID!
Other Man: No no no!
Man: You did just then!
Other Man: Nonsense!
Man: (exasperated) Oh, this is futile!!
(pause)
Other Man: No it isn't!
Man: Yes it is!
>>> data.close()
>>> data = open('sketch.txt')
>>> for each_line in data:
(role,line_spoken)=each_line.split(':')
print(role, end='')
print(' said: ', end='')
print(line_spoken, end='')


Man said:  Is this the right room for an argument?
Other Man said:  I've told you once.
Man said:  No you haven't!
Other Man said:  Yes I have.
Man said:  When?
Other Man said:  Just now.
Man said:  No you didn't!
Other Man said:  Yes I did!
Man said:  You didn't!
Other Man said:  I'm telling you, I did!
Man said:  You did not!
Other Man said:  Oh I'm sorry, is this a five minute argument, or the full half hour?
Man said:  Ah! (taking out his wallet and paying) Just the five minutes.
Other Man said:  Just the five minutes. Thank you.
Other Man said:  Anyway, I did.
Man said:  You most certainly did not!
Traceback (most recent call last):
  File "<pyshell#98>", line 2, in <module>
    (role,line_spoken)=each_line.split(':')
ValueError: too many values to unpack (expected 2)
>>> help(each_line.split)
Help on built-in function split:

split(...) method of builtins.str instance
    S.split(sep=None, maxsplit=-1) -> list of strings
 
    Return a list of the words in S, using sep as the
    delimiter string.  If maxsplit is given, at most maxsplit
    splits are done. If sep is not specified or is None, any
    whitespace string is a separator and empty strings are
    removed from the result.

>>> data = open('sketch.txt')
>>> for each_line in data:
try:
   (role,line_spoken)=each_line.split(':')
    print(role, end='')
    print(' said: ', end='')
    print(line_spoken, end='')
 
SyntaxError: unexpected indent
>>> for each_line in data:
try:
(role,line_spoken)=each_line.split(':')
print(role, end='')
print(' said: ', end='')
         print(line_spoken, end='')
       
SyntaxError: expected an indented block
>>> for each_line in data:
        try:
   (role,line_spoken)=each_line.split(':')
    print(role, end='')
    print(' said: ', end='')
             print(line_spoken, end='')
           
SyntaxError: inconsistent use of tabs and spaces in indentation
>>> for each_line in data:
try:
(role,line_spoken)=each_line.split(':')
print(role, end='')
print(' said: ', end='')
print(' said: ', end='')

except:
pass
data.close()
SyntaxError: invalid syntax
>>>
>>> for each_line in data:
try:
(role,line_spoken)=each_line.split(':')
print(role, end='')
print(' said: ', end='')
print(' said: ', end='')
        except:
pass
data.close()
SyntaxError: inconsistent use of tabs and spaces in indentation
>>> for each_line in data:
try:
(role,line_spoken)=each_line.split(':')
print(role, end='')
print(' said: ', end='')
print(' said: ', end='')
except:
pass


Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Other Man said:  said: Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said:
>>> data = open('sketch.txt')
>>> for each_line in data:
try:
(role,line_spoken)=each_line.split(':')
print(role, end='')
print(' said: ', end='')
print(' said: ', end='')
except:
pass


Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Other Man said:  said: Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said: Other Man said:  said: Man said:  said:
>>> for each_line in data:
try:
(role,line_spoken)=each_line.split(':')
print(role, end='')
print(' said: ', end='')
print(' said: ', end='')
except:
pass


>>>
>>>

data = open('sketch.txt')
   for each_line in data:
(role,line_spoken)=each_line.split(':')
print(role, end='')
print(' said: ', end='')
print(line_spoken, end='')

SyntaxError: multiple statements found while compiling a single statement
>>> data = open('sketch.txt')
   for each_line in data:
(role,line_spoken)=each_line.split(':')
print(role, end='')
print(' said: ', end='')
print(line_spoken, end='')

SyntaxError: multiple statements found while compiling a single statement
>>> data = open('sketch.txt')

 
>>> for each_line in data:
(role,line_spoken)=each_line.split(':')
print(role, end='')
print(' said: ', end='')
print(line_spoken, end='')


Man said:  Is this the right room for an argument?
Other Man said:  I've told you once.
Man said:  No you haven't!
Other Man said:  Yes I have.
Man said:  When?
Other Man said:  Just now.
Man said:  No you didn't!
Other Man said:  Yes I did!
Man said:  You didn't!
Other Man said:  I'm telling you, I did!
Man said:  You did not!
Other Man said:  Oh I'm sorry, is this a five minute argument, or the full half hour?
Man said:  Ah! (taking out his wallet and paying) Just the five minutes.
Other Man said:  Just the five minutes. Thank you.
Other Man said:  Anyway, I did.
Man said:  You most certainly did not!
Traceback (most recent call last):
  File "<pyshell#136>", line 2, in <module>
    (role,line_spoken)=each_line.split(':')
ValueError: too many values to unpack (expected 2)
>>> for each_line in data:
try:
(role,line_spoken)=each_line.split(':')
print(role, end='')
print(' said: ', end='')
print(' said: ', end='')
except:
pass

martes, 20 de junio de 2017

PYTHON HEAD FIRST, FIRST STEPS SESSION1

FIRST STEPS IN PYTHON

ES IDENTADO, EN LUGAR DE USAR {},  YOU CAN MIX STRINGS AND NUMBERS IN A LIST, YOU CAN STORE DATA OF ANY TYPE,


Usamos la herramienta de IDLE

Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> pr
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    pr
NameError: name 'pr' is not defined
>>> print
<built-in function print>
>>> cast = ["Jack", "Leo", "PENELOPE", "PAPAJONES"]
>>> print(cast)
['Jack', 'Leo', 'PENELOPE', 'PAPAJONES']
>>> print(cast[1])
Leo
>>> cast.append("Robert")
>>> print(cast)
['Jack', 'Leo', 'PENELOPE', 'PAPAJONES', 'Robert']
>>> fav_,movies=["Shining", "Clockwork", "BR"]
Traceback (most recent call last):
  File "<pyshell#7>", line 1, in <module>
    fav_,movies=["Shining", "Clockwork", "BR"]
ValueError: too many values to unpack (expected 2)
>>> fav_movies=["Shining", "Clockwork", "BR"]
>>> for each_flick in fav_movies:
print(each_flick)


Shining
Clockwork
BR
>>>

print(movies1)
SyntaxError: multiple statements found while compiling a single statement
>>> clear
Traceback (most recent call last):
  File "<pyshell#24>", line 1, in <module>
    clear
NameError: name 'clear' is not defined
>>> lola = [1,2,3,4,[5,6,7,[8,9,10]]]
>>> print(lola)
SyntaxError: unexpected indent
>>> lola = [1,2,3,4,[5,6,7,[8,9,10]]]
>>> print(lola)
SyntaxError: unexpected indent
>>> print(lola)
[1, 2, 3, 4, [5, 6, 7, [8, 9, 10]]]
>>> print(lola[4][3][2])
10
>>> 
>>> for each_item in lola:
print(each_item)

1
2
3
4
[5, 6, 7, [8, 9, 10]]

>>> for each_item in lola:
if isinstance(each_item,list):
for nested_item in each_item:
if isinstance(nested_item, list):
for deeper_item in nested_item:
print(deeper_item)
else:
print(nested_item)
else:
print(each_item)

1
2
3
4
5
6
7
8
9
10
>>> 

pero es mucho codigo, 
por lo que definimos mejor una funcion, 

def function_name(argumentos):
       function code suite


>>> def print_lol(the_list):
for each_item in the_list:
if isinstance(each_item, list):
print_lol(each_item)
else:
print(each_item)

>>> print_lol(lola)
1
2
3
4
5
6
7
8
9
10
>>> 








How do I know the python modules are on my computer
import sys;
 sys.path;
['', 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\Lib\\idlelib', 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\python35.zip', 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\DLLs', 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib', 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35', 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\site-packages']

>>> print_lol(lola)
1
2
3
4
5
6
7
8
9
10
>>> 
== RESTART: C:\Users\rober\AppData\Local\Programs\Python\Python35\nester.py ==
>>> lola = [1,2,3,4,[5,6,7,[8,9,10]]]
>>> print_lol(lola)
1
2
3
4
5
6
7
8
9
10
>>> lola2 = [1,2,3,4,[5,6,7,[8,9,10]]]
>>> print(lola2)
[1, 2, 3, 4, [5, 6, 7, [8, 9, 10]]]
>>> print_lol(lola2)
1
2
3
4
5
6
7
8
9
10
>>> 



crear el archivo setup.py


from distutils.core import setup

setup(
name = 'nester',
version = '1.0.0',
py_modules = ['nester'],
author = 'hfpython',
author_email    = 'robert_rpm@ciencias.unam.mx',
url = 'http://www.headfirstlabs.com',
description = 'A simple printer of nested lists',
)



C:\nester>python setup.py sdist
running sdist
running check
warning: sdist: manifest template 'MANIFEST.in' does not exist (using default file list)

warning: sdist: standard file not found: should have one of README, README.txt

writing manifest file 'MANIFEST'
creating nester-1.0.0
making hard links in nester-1.0.0...
hard linking nester.py -> nester-1.0.0
hard linking setup.py -> nester-1.0.0
creating dist
creating 'dist\nester-1.0.0.zip' and adding 'nester-1.0.0' to it
adding 'nester-1.0.0\nester.py'
adding 'nester-1.0.0\PKG-INFO'
adding 'nester-1.0.0\setup.py'
removing 'nester-1.0.0' (and everything under it)

C:\nester>python setup.py install
running install
running build
running build_py
creating build
creating build\lib
copying nester.py -> build\lib
running install_lib
copying build\lib\nester.py -> C:\Users\rober\AppData\Local\Programs\Python\Python35\Lib\site-packages
byte-compiling C:\Users\rober\AppData\Local\Programs\Python\Python35\Lib\site-packages\nester.py to nester.cpython-35.pyc
running install_egg_info
Writing C:\Users\rober\AppData\Local\Programs\Python\Python35\Lib\site-packages\nester-1.0.0-py3.5.egg-info



Ahora que tengo el modulo, lo puedo importar a mi espacio de trabajo


>>> import nester
>>> cast =[1,2,3,4,[5,6,7,[8,9,10]]]
>>> nester.print
Traceback (most recent call last):
  File "<pyshell#71>", line 1, in <module>
    nester.print
AttributeError: module 'nester' has no attribute 'print'
>>> nester.print_lol(cast)
1
2
3
4
5
6
7
8
9
10




Then we register into:  https://pypi.python.org/pypi

PYTHON 3 for METRO


Microsoft Windows [Versión 10.0.10586]
(c) 2015 Microsoft Corporation. Todos los derechos reservados.

C:\Users\rober>java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)

C:\Users\rober>python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>


C:\Users\rober>python -v
import _frozen_importlib # frozen
import _imp # builtin
import sys # builtin
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>
import '_io' # <class '_frozen_importlib.BuiltinImporter'>
import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>
import 'nt' # <class '_frozen_importlib.BuiltinImporter'>
import _thread # previously loaded ('_thread')
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import _weakref # previously loaded ('_weakref')
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
import 'winreg' # <class '_frozen_importlib.BuiltinImporter'>
# installing zipimport hook
import 'zipimport' # <class '_frozen_importlib.BuiltinImporter'>
# installed zipimport hook
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\__pycache__\__init__.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\__init__.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\encodings\\__pycache__\\__init__.cpython-35.pyc'
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\codecs.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\codecs.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\codecs.cpython-35.pyc'
import '_codecs' # <class '_frozen_importlib.BuiltinImporter'>
import 'codecs' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E95FD34FD0>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\__pycache__\aliases.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\aliases.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\encodings\\__pycache__\\aliases.cpython-35.pyc'
import 'encodings.aliases' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E95FD57DA0>
import 'encodings' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E95FD346D8>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\__pycache__\mbcs.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\mbcs.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\encodings\\__pycache__\\mbcs.cpython-35.pyc'
import 'encodings.mbcs' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E95FD65CF8>
import '_signal' # <class '_frozen_importlib.BuiltinImporter'>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\__pycache__\utf_8.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\utf_8.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\encodings\\__pycache__\\utf_8.cpython-35.pyc'
import 'encodings.utf_8' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E95FD58198>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\__pycache__\latin_1.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\latin_1.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\encodings\\__pycache__\\latin_1.cpython-35.pyc'
import 'encodings.latin_1' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E95FD58400>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\io.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\io.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\io.cpython-35.pyc'
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\abc.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\abc.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\abc.cpython-35.pyc'
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\_weakrefset.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\_weakrefset.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\_weakrefset.cpython-35.pyc'
import '_weakrefset' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E95FD710F0>
import 'abc' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E95FD588D0>
import 'io' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E95FD58668>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\__pycache__\cp437.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\cp437.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\encodings\\__pycache__\\cp437.cpython-35.pyc'
import 'encodings.cp437' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E95FD7A828>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\site.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\site.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\site.cpython-35.pyc'
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\os.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\os.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\os.cpython-35.pyc'
import 'errno' # <class '_frozen_importlib.BuiltinImporter'>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\stat.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\stat.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\stat.cpython-35.pyc'
import '_stat' # <class '_frozen_importlib.BuiltinImporter'>
import 'stat' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E95FD95470>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\ntpath.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\ntpath.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\ntpath.cpython-35.pyc'
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\genericpath.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\genericpath.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\genericpath.cpython-35.pyc'
import 'genericpath' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E95FDA3240>
import 'ntpath' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E95FD957B8>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\_collections_abc.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\_collections_abc.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\_collections_abc.cpython-35.pyc'
import '_collections_abc' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E95FDA3860>
import 'os' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E95FD842B0>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\_sitebuiltins.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\_sitebuiltins.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\_sitebuiltins.cpython-35.pyc'
import '_sitebuiltins' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E95FD84588>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\sysconfig.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\sysconfig.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\sysconfig.cpython-35.pyc'
import 'sysconfig' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E95FD847B8>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\_bootlocale.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\_bootlocale.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\_bootlocale.cpython-35.pyc'
import '_locale' # <class '_frozen_importlib.BuiltinImporter'>
import '_bootlocale' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E96022C6D8>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\__pycache__\cp1252.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\cp1252.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\encodings\\__pycache__\\cp1252.cpython-35.pyc'
import 'encodings.cp1252' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E96022CB00>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\types.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\types.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\types.cpython-35.pyc'
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\functools.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\functools.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\functools.cpython-35.pyc'
import '_functools' # <class '_frozen_importlib.BuiltinImporter'>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\collections\__pycache__\__init__.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\collections\__init__.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\collections\\__pycache__\\__init__.cpython-35.pyc'
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\operator.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\operator.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\operator.cpython-35.pyc'
import '_operator' # <class '_frozen_importlib.BuiltinImporter'>
import 'operator' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E96036B6A0>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\keyword.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\keyword.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\keyword.cpython-35.pyc'
import 'keyword' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E9603759B0>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\heapq.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\heapq.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\heapq.cpython-35.pyc'
import '_heapq' # <class '_frozen_importlib.BuiltinImporter'>
import 'heapq' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E960376278>
import 'itertools' # <class '_frozen_importlib.BuiltinImporter'>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\reprlib.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\reprlib.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\reprlib.cpython-35.pyc'
import 'reprlib' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E960376710>
import '_collections' # <class '_frozen_importlib.BuiltinImporter'>
import 'collections' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E960249198>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\weakref.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\weakref.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\weakref.cpython-35.pyc'
import 'weakref' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E9603832E8>
import 'functools' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E960235E48>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\collections\__pycache__\abc.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\collections\abc.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\collections\\__pycache__\\abc.cpython-35.pyc'
import 'collections.abc' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E96023BE10>
import 'types' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E9602351D0>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\importlib\__pycache__\__init__.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\importlib\__init__.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\importlib\\__pycache__\\__init__.cpython-35.pyc'
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\warnings.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\warnings.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\warnings.cpython-35.pyc'
import 'warnings' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E960244668>
import 'importlib' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E960235588>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\importlib\__pycache__\util.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\importlib\util.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\importlib\\__pycache__\\util.cpython-35.pyc'
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\importlib\__pycache__\abc.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\importlib\abc.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\importlib\\__pycache__\\abc.cpython-35.pyc'
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\importlib\__pycache__\machinery.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\importlib\machinery.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\importlib\\__pycache__\\machinery.cpython-35.pyc'
import 'importlib.machinery' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E96039DEF0>
import 'importlib.abc' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E96039D8D0>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\contextlib.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\contextlib.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\contextlib.cpython-35.pyc'
import 'contextlib' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E9603A6B70>
import 'importlib.util' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E960392F28>
# possible namespace for C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\site-packages\google
import 'site' # <_frozen_importlib_external.SourceFileLoader object at 0x000001E95FD7AD68>
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import 'atexit' # <class '_frozen_importlib.BuiltinImporter'>
>>>
^C
C:\Users\rober>python.exe -v
import _frozen_importlib # frozen
import _imp # builtin
import sys # builtin
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>
import '_io' # <class '_frozen_importlib.BuiltinImporter'>
import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>
import 'nt' # <class '_frozen_importlib.BuiltinImporter'>
import _thread # previously loaded ('_thread')
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import _weakref # previously loaded ('_weakref')
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
import 'winreg' # <class '_frozen_importlib.BuiltinImporter'>
# installing zipimport hook
import 'zipimport' # <class '_frozen_importlib.BuiltinImporter'>
# installed zipimport hook
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\__pycache__\__init__.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\__init__.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\encodings\\__pycache__\\__init__.cpython-35.pyc'
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\codecs.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\codecs.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\codecs.cpython-35.pyc'
import '_codecs' # <class '_frozen_importlib.BuiltinImporter'>
import 'codecs' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC85344FD0>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\__pycache__\aliases.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\aliases.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\encodings\\__pycache__\\aliases.cpython-35.pyc'
import 'encodings.aliases' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC85367DA0>
import 'encodings' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC853446D8>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\__pycache__\mbcs.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\mbcs.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\encodings\\__pycache__\\mbcs.cpython-35.pyc'
import 'encodings.mbcs' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC85375CF8>
import '_signal' # <class '_frozen_importlib.BuiltinImporter'>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\__pycache__\utf_8.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\utf_8.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\encodings\\__pycache__\\utf_8.cpython-35.pyc'
import 'encodings.utf_8' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC85368198>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\__pycache__\latin_1.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\latin_1.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\encodings\\__pycache__\\latin_1.cpython-35.pyc'
import 'encodings.latin_1' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC85368400>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\io.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\io.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\io.cpython-35.pyc'
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\abc.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\abc.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\abc.cpython-35.pyc'
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\_weakrefset.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\_weakrefset.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\_weakrefset.cpython-35.pyc'
import '_weakrefset' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC853810F0>
import 'abc' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC853688D0>
import 'io' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC85368668>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\__pycache__\cp437.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\cp437.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\encodings\\__pycache__\\cp437.cpython-35.pyc'
import 'encodings.cp437' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC8538A828>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\site.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\site.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\site.cpython-35.pyc'
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\os.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\os.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\os.cpython-35.pyc'
import 'errno' # <class '_frozen_importlib.BuiltinImporter'>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\stat.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\stat.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\stat.cpython-35.pyc'
import '_stat' # <class '_frozen_importlib.BuiltinImporter'>
import 'stat' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC85815470>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\ntpath.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\ntpath.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\ntpath.cpython-35.pyc'
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\genericpath.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\genericpath.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\genericpath.cpython-35.pyc'
import 'genericpath' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC85823240>
import 'ntpath' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC858157B8>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\_collections_abc.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\_collections_abc.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\_collections_abc.cpython-35.pyc'
import '_collections_abc' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC85823860>
import 'os' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC853942B0>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\_sitebuiltins.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\_sitebuiltins.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\_sitebuiltins.cpython-35.pyc'
import '_sitebuiltins' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC85394588>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\sysconfig.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\sysconfig.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\sysconfig.cpython-35.pyc'
import 'sysconfig' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC853947B8>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\_bootlocale.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\_bootlocale.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\_bootlocale.cpython-35.pyc'
import '_locale' # <class '_frozen_importlib.BuiltinImporter'>
import '_bootlocale' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC8595C6D8>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\__pycache__\cp1252.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\encodings\cp1252.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\encodings\\__pycache__\\cp1252.cpython-35.pyc'
import 'encodings.cp1252' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC8595CB00>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\types.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\types.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\types.cpython-35.pyc'
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\functools.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\functools.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\functools.cpython-35.pyc'
import '_functools' # <class '_frozen_importlib.BuiltinImporter'>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\collections\__pycache__\__init__.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\collections\__init__.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\collections\\__pycache__\\__init__.cpython-35.pyc'
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\operator.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\operator.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\operator.cpython-35.pyc'
import '_operator' # <class '_frozen_importlib.BuiltinImporter'>
import 'operator' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC8599B6A0>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\keyword.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\keyword.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\keyword.cpython-35.pyc'
import 'keyword' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC859A59B0>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\heapq.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\heapq.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\heapq.cpython-35.pyc'
import '_heapq' # <class '_frozen_importlib.BuiltinImporter'>
import 'heapq' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC859A6278>
import 'itertools' # <class '_frozen_importlib.BuiltinImporter'>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\reprlib.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\reprlib.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\reprlib.cpython-35.pyc'
import 'reprlib' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC859A6710>
import '_collections' # <class '_frozen_importlib.BuiltinImporter'>
import 'collections' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC85979198>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\weakref.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\weakref.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\weakref.cpython-35.pyc'
import 'weakref' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC859B32E8>
import 'functools' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC85965E48>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\collections\__pycache__\abc.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\collections\abc.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\collections\\__pycache__\\abc.cpython-35.pyc'
import 'collections.abc' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC8596BE10>
import 'types' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC859651D0>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\importlib\__pycache__\__init__.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\importlib\__init__.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\importlib\\__pycache__\\__init__.cpython-35.pyc'
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\warnings.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\warnings.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\warnings.cpython-35.pyc'
import 'warnings' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC85974668>
import 'importlib' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC85965588>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\importlib\__pycache__\util.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\importlib\util.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\importlib\\__pycache__\\util.cpython-35.pyc'
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\importlib\__pycache__\abc.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\importlib\abc.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\importlib\\__pycache__\\abc.cpython-35.pyc'
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\importlib\__pycache__\machinery.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\importlib\machinery.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\importlib\\__pycache__\\machinery.cpython-35.pyc'
import 'importlib.machinery' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC859CDEF0>
import 'importlib.abc' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC859CD8D0>
# C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\__pycache__\contextlib.cpython-35.pyc matches C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\contextlib.py
# code object from 'C:\\Users\\rober\\AppData\\Local\\Programs\\Python\\Python35\\lib\\__pycache__\\contextlib.cpython-35.pyc'
import 'contextlib' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC859D6B70>
import 'importlib.util' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC859C2F28>
# possible namespace for C:\Users\rober\AppData\Local\Programs\Python\Python35\lib\site-packages\google
import 'site' # <_frozen_importlib_external.SourceFileLoader object at 0x000001AC8538AD68>
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import 'atexit' # <class '_frozen_importlib.BuiltinImporter'>
>>>
>>>
^C
C:\Users\rober>
C:\Users\rober>python3 -v
"python3" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.

C:\Users\rober>cd ..

C:\Users>cd..

C:\>cd nester

C:\nester>python setup.py sdist
running sdist
running check
warning: sdist: manifest template 'MANIFEST.in' does not exist (using default file list)

warning: sdist: standard file not found: should have one of README, README.txt

writing manifest file 'MANIFEST'
creating nester-1.0.0
making hard links in nester-1.0.0...
hard linking nester.py -> nester-1.0.0
hard linking setup.py -> nester-1.0.0
creating dist
creating 'dist\nester-1.0.0.zip' and adding 'nester-1.0.0' to it
adding 'nester-1.0.0\nester.py'
adding 'nester-1.0.0\PKG-INFO'
adding 'nester-1.0.0\setup.py'
removing 'nester-1.0.0' (and everything under it)

C:\nester>python setup.py install
running install
running build
running build_py
creating build
creating build\lib
copying nester.py -> build\lib
running install_lib
copying build\lib\nester.py -> C:\Users\rober\AppData\Local\Programs\Python\Python35\Lib\site-packages
byte-compiling C:\Users\rober\AppData\Local\Programs\Python\Python35\Lib\site-packages\nester.py to nester.cpython-35.pyc
running install_egg_info
Writing C:\Users\rober\AppData\Local\Programs\Python\Python35\Lib\site-packages\nester-1.0.0-py3.5.egg-info

C:\nester>

lunes, 19 de junio de 2017

python and java hackerrank


Welcome to HackerRank! The purpose of this challenge is to familiarize you with reading input from stdin (the standard input stream) and writing output to stdout (the standard output stream) using our environment.
Review the code provided in the editor below, then complete the solveMeFirst function so that it returns the sum of two integers read from stdin. Take some time to understand this code so you're prepared to write it yourself in future challenges.
Select a language below, and start coding!
Input Format
Code that reads input from stdin is provided for you in the editor. There are  lines of input, and each line contains a single integer.
Output Format
Code that prints the sum calculated and returned by solveMeFirst is provided for you in the editor.

import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Solution {

    static int solveMeFirst(int a, int b) {
         // Hint: Type return a+b; below
return a+b;
   }

 
 public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a;
        a = in.nextInt();
        int b;
        b = in.nextInt();
        int sum;
        sum = solveMeFirst(a, b);
        System.out.println(sum);
   }
}



PYTHON

def solveMeFirst(a,b):
   # Hint: Type return a+b below
  return a+b

num1 = int(input())
num2 = int(input())
res = solveMeFirst(num1,num2)
print(res)


********************************************

Given an array of  integers, can you find the sum of its elements?
Input Format
The first line contains an integer, , denoting the size of the array. 
The second line contains  space-separated integers representing the array's elements.
Output Format
Print the sum of the array's elements as a single integer.
Sample Input
6
1 2 3 4 10 11
Sample Output
31
Explanation
We print the sum of the array's elements, which is: .

import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class SimpleArraySum {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int number = sc.nextInt();
        int sum=0;
        for(int i = 0;i<number;i++){
            sum+=sc.nextInt();
        }
        System.out.println(sum);
    }
}

Blogger Widgets