Esempio n. 1
0
from hello import say_hello_to

say_hello_to("world!!")


# import timeit

# cy = timeit.timeit('hello.say_hello_to("world!!")', setup="import hello", number=100)
# print(str(cy) + " second!")
Esempio n. 2
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2015 Richard Wong
#
from functools import partial
import timeit

import hello
import hi

hello.say_hello_to('richard')
print(hello.f1(13332))
print(hello.__dict__)

print(hi.__dict__)
print(hi.f3(13332))
print(timeit.Timer(partial(hello.f1, 133332)).repeat(3, 10000))
print(timeit.Timer(partial(hi.f3, 133332)).repeat(3, 10000))

# t.py ended here
Esempio n. 3
0
# filename: hello_run.py

from hello import say_hello_to
say_hello_to('Ricci')
Esempio n. 4
0
def test_say_hello_to(capsys):
    say_hello_to('me')
    out, err = capsys.readouterr()
    assert out == 'Hello me!\n'
Esempio n. 5
0
# -*- coding: utf-8 -*-
__author__ = "youhei"

from hello import say_hello_to

print("test")

say_hello_to("you")
Esempio n. 6
0
from hello import say_hello_to

say_hello_to('martin')
Esempio n. 7
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 25 22:14:11 2019

@author: ubuntu
"""

import hello

hello.say_hello_to("Leo")
Esempio n. 8
0
import pyximport; pyximport.install()
import hello

if __name__ == "__main__":
  hello.say_hello_to("Reona")
Esempio n. 9
0
def test_valid(capsys):
    name = "Todd"
    hello.say_hello_to(name)
    out, _ = capsys.readouterr()
    assert out == "Hello {}!\n".format(name)
Esempio n. 10
0
import pyximport

pyximport.install()

import datetime
import exert

exert.fib(16)

import hello

hello.say_hello_to('aaa')
Esempio n. 11
0
from hello import say_hello_to
say_hello_to('Hi')
Esempio n. 12
0
import hello
hello.say_hello_to('张三')
Esempio n. 13
0
from helloworld import say_hello
from hello import say_hello_to

for i in range(5):
  say_hello()

say_hello_to('Mike')
Esempio n. 14
0
# coding: utf-8
import hello

hello.say_hello_to('someone')
Esempio n. 15
0
# import pyximport; pyximport.install()
import hello

hello.say_hello_to("xiao")
Esempio n. 16
0
from hello import say_hello_to
from hello import StructTest
say_hello_to("kkk")
a= StructTest()
print(a)
Esempio n. 17
0
# -*- coding: utf-8 -*-
""" This example displays how to use pyximport for on-the-fly compilation via Cython.

For simple cases like this example, pyximport removes the need to write a setup.py
distutils script, and we can treat hello.pyx as if it were a regular Python module.

If a Cython source file is modified, pyximport automatically detects the modification
and will recompile the source file the next time it is imported in a new Python
interpreter session.

Because Cython modules imported via pyximport depend on both the cython compiler and a
properly set up C compiler, it tends not to be used in production environments where
these dependencies are not under our control.
"""
import pyximport

# .install() needs to be called before importing Cython extension modules
pyximport.install()

# This will compile hello.pyx to a *.so if it hasn't already been and load the .so extension module
import hello

hello.say_hello_to('Todd')

Esempio n. 18
0
from hello import say_hello_to

say_hello_to("Matthew")
Esempio n. 19
0
from hello import say_hello_to

say_hello_to()
Esempio n. 20
0
 def hello(self):
     say_hello_to("adfadf")
Esempio n. 21
0
import hello
hello.say_hello_to("hi,cython!!")
Esempio n. 22
0
import nimporter  # Required before importing any Nim extension modules
import hello  # The Nim module to import

hello.say_hello_to(input('What is your name? '))
Esempio n. 23
0
from hello import say_hello_to

say_hello_to("asdf")
Esempio n. 24
0
import hello
hello.say_hello_to("Appveyor")
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Simple example which imports the extension module generated by Cython and uses it.
"""
from hello import say_hello_to

say_hello_to('Todd')
Esempio n. 26
0
from hello import say_hello_to
from hello_py import say_hello_to as say_hello_to2

if __name__ == '__main__':
    say_hello_to('aa')
    say_hello_to2('bb')
Esempio n. 27
0
'''
from hello import say_hello_to, f, f2
import time

def fpy(x):
    return x**2-x


def testf():
    t = time.time()
    for i in xrange(1000000):
        fpy(i)
    print time.time()-t
    
    t= time.time()
    for i in xrange(1000000):
        f(i)
    print time.time()-t
    
    t= time.time()
    for i in xrange(1000000):
        f2(i)
    print time.time()-t

if __name__ == '__main__':
    say_hello_to("Chenhh")
    print f(10)
    testf()

    
Esempio n. 28
0
from hello import say_hello_to

print(say_hello_to("world"))
Esempio n. 29
0
#!/usr/bin/env python
"""
Simple script showing how a module that was built using distutils and
Cython.Build can be directly imported similar to any python module.
"""

__author__ = 'John Stein'
__email__ = '*****@*****.**'

from hello import say_hello_to

say_hello_to('John')
Esempio n. 30
0
# use import call hello.so or hello.pyd
from hello import say_hello_to

say_hello_to(" ff world ")
Esempio n. 31
0
import hello

hello.say_hello_to('Alex')

Esempio n. 32
0
#coding:utf8

import hello

if __name__=='__main__':
    print dir(hello)
    print hello.say_hello_to('jadesoul')

Esempio n. 33
0
import pyximport; pyximport.install()
import hello as hello

hello.say_hello_to('jon')


Esempio n. 34
0
 def test_hello(self):
     self.assertEqual(say_hello_to('Marc'), 'Marc')
Esempio n. 35
0
import hello
import numpy as np

if __name__ == '__main__':
    hello.say_hello_to('everyone')
    matrix = np.random.randn(100, 2)
    print(hello.convert_demo(matrix))
Esempio n. 36
0
# -*- coding: utf-8 -*-
import hello

hello.say_hello_to('lily')

Esempio n. 37
0
import hello

if __name__ == "__main__":
    hello.say_hello_to("Ikki")
Esempio n. 38
0
from hello import say_hello_to
say_hello_to("David")