Exemple #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!")
Exemple #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
Exemple #3
0
# filename: hello_run.py

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

from hello import say_hello_to

print("test")

say_hello_to("you")
Exemple #6
0
from hello import say_hello_to

say_hello_to('martin')
#!/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")
Exemple #8
0
import pyximport; pyximport.install()
import hello

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

pyximport.install()

import datetime
import exert

exert.fib(16)

import hello

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

for i in range(5):
  say_hello()

say_hello_to('Mike')
# coding: utf-8
import hello

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

hello.say_hello_to("xiao")
Exemple #16
0
from hello import say_hello_to
from hello import StructTest
say_hello_to("kkk")
a= StructTest()
print(a)
Exemple #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')

Exemple #18
0
from hello import say_hello_to

say_hello_to("Matthew")
Exemple #19
0
from hello import say_hello_to

say_hello_to()
Exemple #20
0
 def hello(self):
     say_hello_to("adfadf")
Exemple #21
0
import hello
hello.say_hello_to("hi,cython!!")
Exemple #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? '))
Exemple #23
0
from hello import say_hello_to

say_hello_to("asdf")
Exemple #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')
Exemple #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')
Exemple #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()

    
from hello import say_hello_to

print(say_hello_to("world"))
Exemple #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')
Exemple #30
0
# use import call hello.so or hello.pyd
from hello import say_hello_to

say_hello_to(" ff world ")
Exemple #31
0
import hello

hello.say_hello_to('Alex')

Exemple #32
0
#coding:utf8

import hello

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

Exemple #33
0
import pyximport; pyximport.install()
import hello as hello

hello.say_hello_to('jon')


Exemple #34
0
 def test_hello(self):
     self.assertEqual(say_hello_to('Marc'), 'Marc')
Exemple #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))
# -*- coding: utf-8 -*-
import hello

hello.say_hello_to('lily')

Exemple #37
0
import hello

if __name__ == "__main__":
    hello.say_hello_to("Ikki")
from hello import say_hello_to
say_hello_to("David")