最简单去运行一个luigi task的方式是通过luigi命令行工具。

示例代码:

# my_module.py, available in your sys.path
import luigi class MyTask(luigi.Task):
x = luigi.IntParameter()
y = luigi.IntParameter(default=45) def run(self):
print self.x + self.y

在命令行上运行:

(my_python_env)[root@hadoop26 pythonCode]# PYTHONPATH='' luigi --module my_module MyTask --x  --y  --local-scheduler

或者可以选择这种方式运行:

(my_python_env)[root@hadoop26 pythonCode]# python -m luigi --module my_module MyTask --x  --local-scheduler

注意:如果一个参数的名字中含有'_',在命令行中你需要替代为'-'。例如MyTask有一个参数名字是'my_parameter',你需要这么赋值:

luigi --module my_module MyTask --my-parameter 100 --local-scheduler

luigi学习7--running from command line的更多相关文章

  1. Error running 'xxx': Command line is too long. Shorten command line for xxx

    跑单元测试时,报错如下: Error running 'xxx': Command line is too long. Shorten command line for xxx 解决方案: 在项目所在 ...

  2. 运行springboot项目报错 Error running 'ResourceApplication': Command line is too long. Shorten comma

    方法1 IDEA 运行报错:Error running '***': Command line is too long 技术标签: IDEA     Error running 'Test': Com ...

  3. idea报错:Error running $classname: Command line is too long. Shorten command line for $classname.

    Command line is too long 打印的变量太长了,超过了限制,这都会报错...我只想知道idea基于什么原理会报这个错... 解决 1.按照提示修改该类的配置,选择jar manif ...

  4. idea启动springboot项目报Error running 'ServiceStarter': Command line is too long. Shorten command line for ServiceStarter or also for Application

    解决办法:在.idea文件夹下面的workspace.xml中的 <component name="PropertiesComponent">标签下面添加: <p ...

  5. idea 启动 Error running 'XxGatewayApplication': Command line is too long. Shorten command line for XxGatewayApplication or also for Spring Boot default

    在idea workspace里 <component name="PropertiesComponent">标签下加入 <property name=" ...

  6. Error running 'App': Command line is too long. Shorten command line for App or also for Spring Boot default configuration.

    找到标签 <component name="PropertiesComponent">.在标签里加一行  : <property name="dynam ...

  7. IDEA命令行缩短器助你解决此问题:Command line is too long. Shorten command line...

    生命太短暂,不要去做一些根本没有人想要的东西.本文已被 https://www.yourbatman.cn 收录,里面一并有Spring技术栈.MyBatis.JVM.中间件等小而美的专栏供以免费学习 ...

  8. idea运行main方法报错,提示Shorten command line for xxx

    在Intell IDEA运行main函数的时候遇到了如下错误: Error running' xxxxxx': Command line is too long. Shorten command li ...

  9. IntelliJ IDEA 运行项目的时候提示 Command line is too long 错误

    在 IntelliJ IDEA 项目运行的时候收到了下面的错误提示: Error running 'Application': Command line is too long. Shorten co ...

  10. Intellij IDEA中Springboot启动报Command line is too long错误

    启动报错:Error running 'CmsFrontApplication': Command line is too long. Shorten command line for CmsFron ...

随机推荐

  1. zookeeper 监控 —— 阿里taokeeper

    TaoKeeper是一个围绕ZooKeeper做的监控与报表系统. 主要功能如下: 能够统计ZK集群连接数,Watcher数目 ,节点数等系列信息,并按一定规则进行一些聚合操作; 能够通过设置一些阈值 ...

  2. 动态添加js文件.

    方法一: $.getScript(url,callback); 这个方法是对$.ajax({ })的封装.默认是异步的而且是带有缓存的. 缓存对于用户来说,是个好东西,但是对于开发者来说可就是日了狗的 ...

  3. js判断手机是的操作系统

    var browser = { versions: function() { var u = navigator.userAgent, app = navigator.appVersion; retu ...

  4. mybatis的动态sql

    案例一: insert语句,然后获取这条语句的id值. <insert id="insertBook" parameterType="modle.Book" ...

  5. linux locate: command not found

    装好系统发现使用locate查找文件,提示 -bash: locate: command not found yum install locate 无效,看来locate不是软件名称 [root@ce ...

  6. cocos2dx 锁定30帧设置

    修改代码: AppDelegate.cpp // set FPS. the default value is 1.0/60 if you don't call this pDirector->s ...

  7. [ZOJ 1004] Anagrams by Stack (简单搜索)

    题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1004 题目大意:给你个栈,给你源串和目标串,按字典序输出符合要求 ...

  8. ReverseBits

    eclipse没问题,leetcode 1不能通过,超出int最大值了,但是怎么转无符号? /*Write a function that takes an unsigned integer and ...

  9. Regional Changchun Online--Alisha’s Party

    Alisha's Party Time Limit: 3000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) ...

  10. FileZilla - Windows XP经典软件系列

    官网: https://filezilla-project.org/ 下载: http://sourceforge.net/projects/filezilla/ 版本:V3.9.0.1 (支持XP最 ...