| File | Date | Author | Commit |
|---|---|---|---|
| .gitignore | 2014-10-18 |
|
[fbd20e] Initial commit |
| LICENSE | 2014-10-18 |
|
[fbd20e] Initial commit |
| README.md | 2014-11-09 |
|
[f6f3ac] Update README.md |
| db_rebuild.rake | 2014-10-19 |
|
[b970f8] Update db_rebuild.rakePermalink |
| erlang.sh | 2014-10-19 |
|
[b54950] Create new file |
| faraday_ex.rb | 2014-10-19 |
|
[b384cc] Create new file |
| firsttest.rb | 2014-11-09 |
|
[e59ec8] Create new file |
| test.rb | 2014-11-09 |
|
[814390] Create new file |
tests writting in pu language
{{{
#!/usr/bin/ Rake --status
$ gem install rubygems-update # again, might need to be admin/root
$ update_rubygems # ... here too
}}}
http://www.rubydoc.info/github/keenesthan/chromingproject/master/frames#Fibonacci_numbers_module
==principes du rb==
the soft his test.rb and test.rb the runner
* http://rubylearning.com/satishtalim/including_other_files_in_ruby.html
The init.py files are required to make Python treat the directories as containing packages; this is done to prevent directories with a common name, such as string, from unintentionally hiding valid modules that occur later on the module search path. In the simplest case, init.py can just be an empty file, but it can also execute initialization code for the package or set the all variable, described later.
The init.py file is usually empty
Files named init.py are used to mark directories on disk as Python package directories.
If you have the files
mydir/spam/init.py
mydir/spam/module.py
and mydir is on your path, you can import the code in module.py as
import spam.module
or
from spam import module
A module is a file containing Python definitions and statements.
The file name is the module name with the suffix .py appended. Within a module, the module’s name (as a string) is available as the value of the global variable name. For instance, use your favorite text editor to create a file called fibo.py in the current directory with the following contents:
Fibonacci numbers module
def fib(n): # write Fibonacci series up to n
a, b = 0, 1
while b < n:
print b,
a, b = b, a+b
def fib2(n): # return Fibonacci series up to n
result = []
a, b = 0, 1
while b < n:
result.append(b)
a, b = b, a+b
return result
Now enter the Python interpreter and import this module with the following command:
import fibo
Executing modules as scripts
== When you run a Python module with ==
python fibo.py <arguments>
</arguments>
the code in the module will be executed, just as if you imported it, but with the name set to "main".
That means that by adding this code at the end of your module:
if name == "main":
import sys
fib(int(sys.argv[1]))
== main — Top-level script environment ==
This module represents the (otherwise anonymous) scope in which the interpreter’s main program executes — commands read either from standard input, from a script file, or from an interactive prompt.
if name == "main":
main()
== The Module Search Path ==