4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
York University, Toronto, Canada, Bil , cse 203 1
Last edited by Scott; 11-26-2012 at 04:54 PM..
Reason: Post restored; Thread Closed.
Dear All,
I'm trying to write a shell script that continously checks a certain folder. When a file is placed in the directory securely copies the file to another server.
I've got the secure copying working, but I don't know how to contiously check a directory for a new file and then use that... (3 Replies)
I have a folder with lots of file. e.g. a.txt, b.txt, c.txt.... I want to put these files from the source directory and place them in a destination directory in a specific order, such as /destination/a/a.txt, /destination/b/b.txt, /destination/c/c.txt, ......
Please help. Thx :confused: (3 Replies)
. ./testFile.sh
url=http://ichart.finance.yahoo.com/table.csv?s= suf=&d=5&e=9&f=2009&g=d&a=1&b=4&c=1999&ignore=.csv
wget $url$s1$suf;
sleep 10;
cat header.txt > $s1.txt;
chmod 777 $s1.txt;
sed '1d' table.csv?s\=$s1 >> $s1.txt;
rm -Rf table*
Very new at shell scripting as you can see... (3 Replies)
I have been following a tutorial on bash which has proven to be very helpful. However, i am stuck with a command not found issue when asking for a y/n response from the user. Below is the part of code I believe is giving me grief... I have been trying to work through this for 3 hours now.... Please... (5 Replies)
Hello,
I'm new to Sheel script and I need your help for a script I need to develop (for me).
Indead, I have a software which log all entry from internet and save it in text file.
But, the log is practically unreadable because every 256 characters jump to a new line (even if the message is... (5 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
"Create a shell script that changes the selected word to another word in all files from selected archive. The... (1 Reply)
So guys basically I was really sick and couldn't attend the labs and lectures and I went to my lecture hoping he would say ok I will help you from the start but he just said google it. So If it's possible to make the assignment and explain more in detail why is that would be really helpfull.
I can... (1 Reply)
Hi,
can someone explain how this aliases work:
alias m 'if ( \!:$ =~ *gz) set status = 1 && most \!:$ || gzcat \!:1 | most '
I mean, I know what it does, but I don't know how
- what is \!:$ and \!:1
- how do it used the && and ||
- what it does with status variable?
thanks (3 Replies)
Hi everyone, first time visitor to these forums here.
Keeping a long story short I've been attempting to learn how to code in bash. I have VERY little previous experience with coding languages besides simply copying and pasting batch scripts for Windows. So, with that in mind I've followed a... (4 Replies)
Discussion started by: Meta
4 Replies
LEARN ABOUT DEBIAN
py.test-3
PY.TEST-3(1) pytest PY.TEST-3(1)NAME
pytest - pytest usage
CALLING PY.TEST-3 THROUGH PYTHON -M PY.TEST-3
New in version 2.0.
If you use Python-2.5 or later you can invoke testing through the Python interpreter from the command line:
python -m pytest [...]
This is equivalent to invoking the command line script py.test-3 [...] directly.
GETTING HELP ON VERSION, OPTION NAMES, ENVIRONMENT VARIABLES
py.test-3 --version # shows where pytest was imported from
py.test-3 --funcargs # show available builtin function arguments
py.test-3 -h | --help # show help on command line and config file options
STOPPING AFTER THE FIRST (OR N) FAILURES
To stop the testing process after the first (N) failures:
py.test-3 -x # stop after first failure
py.test-3 --maxfail=2 # stop after two failures
SPECIFYING TESTS / SELECTING TESTS
Several test run options:
py.test-3 test_mod.py # run tests in module
py.test-3 somepath # run all tests below path
py.test-3 -k string # only run tests whose names contain a string
Import 'pkg' and use its filesystem location to find and run tests:
py.test-3 --pyargs pkg # run all tests found below directory of pypkg
MODIFYING PYTHON TRACEBACK PRINTING
Examples for modifying traceback printing:
py.test-3 --showlocals # show local variables in tracebacks
py.test-3 -l # show local variables (shortcut)
py.test-3 --tb=long # the default informative traceback formatting
py.test-3 --tb=native # the Python standard library formatting
py.test-3 --tb=short # a shorter traceback format
py.test-3 --tb=line # only one line per failure
DROPPING TO PDB (PYTHON DEBUGGER) ON FAILURES
Python comes with a builtin Python debugger called PDB. py.test-3 allows one to drop into the PDB prompt via a command line option:
py.test-3 --pdb
This will invoke the Python debugger on every failure. Often you might only want to do this for the first failing test to understand a
certain failure situation:
py.test-3 -x --pdb # drop to PDB on first failure, then end test session
py.test-3 --pdb --maxfail=3 # drop to PDB for the first three failures
SETTING A BREAKPOINT / AKA SET_TRACE()
If you want to set a breakpoint and enter the pdb.set_trace() you can use a helper:
import pytest
def test_function():
...
pytest.set_trace() # invoke PDB debugger and tracing
In previous versions you could only enter PDB tracing if you disabled capturing on the command line via py.test-3 -s.
PROFILING TEST EXECUTION DURATION
To get a list of the slowest 10 test durations:
py.test-3 --durations=10
CREATING JUNITXML FORMAT FILES
To create result files which can be read by Hudson or other Continuous integration servers, use this invocation:
py.test-3 --junitxml=path
to create an XML file at path.
CREATING RESULTLOG FORMAT FILES
To create plain-text machine-readable result files you can issue:
py.test-3 --resultlog=path
and look at the content at the path location. Such files are used e.g. by the PyPy-test web page to show test results over several revi-
sions.
SENDING TEST REPORT TO POCOO PASTEBIN SERVICE
Creating a URL for each test failure:
py.test-3 --pastebin=failed
This will submit test run information to a remote Paste service and provide a URL for each failure. You may select tests as usual or add
for example -x if you only want to send one particular failure.
Creating a URL for a whole test session log:
py.test-3 --pastebin=all
Currently only pasting to the http://paste.pocoo.org service is implemented.
CALLING PY.TEST-3 FROM PYTHON CODE
New in version 2.0.
You can invoke py.test-3 from Python code directly:
pytest.main()
this acts as if you would call "py.test-3" from the command line. It will not raise SystemExit but return the exitcode instead. You can
pass in options and arguments:
pytest.main(['x', 'mytestdir'])
or pass in a string:
pytest.main("-x mytestdir")
You can specify additional plugins to pytest.main:
# content of myinvoke.py
import pytest
class MyPlugin:
def pytest_addoption(self, parser):
raise pytest.UsageError("hi from our plugin")
pytest.main(plugins=[MyPlugin()])
Running it will exit quickly:
$ python myinvoke.py
ERROR: hi from our plugin
AUTHOR
holger krekel at merlinux eu
COPYRIGHT
2011, holger krekel et alii
2.2 June 24, 2012 PY.TEST-3(1)