最简单去运行一个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. python 之编码问题详解

    前在一个项目中遇到用post提交一个xml,xml中含有中文,对于单独的py文件,使用urllib2.urlopen完全ok,但在django中使用就一直报编码错误,然后在网上看到这篇文章不错,决定m ...

  2. dubbo的代码项目结构

    dubbo 的项目(Project)包含下面模块(Module): 这些模块的功能描述如下: dubbo-admin  dubbo的管理平台 dubbo-demo  包含生产者.消费者.接口定义的du ...

  3. sql server远程访问Oracle数据库

    在sql server上新建了连接服务器后 在指定的链接服务器上执行指定的传递查询. 该服务器是 OLE DB 数据源. OPENQUERY 可以在查询的 FROM 子句中引用,就好象它是一个表名. ...

  4. [Uva 10085] The most distant state (BFS)

    题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...

  5. SQLSERVER的兼容级别

    今天采用SQL Mannager 2008连接远程的sqlserver数据库,之后弹出一个对话框,修改SQL兼容级别,当时每太注意,一下点击了确定按钮,结果导致两个系统SQL只想全部出错,幸亏发现的早 ...

  6. [C# 基础知识系列]C#中易混淆的知识点

    一.引言 今天在论坛中看到一位朋友提出这样的一个问题,问题大致(问题的链接为:http://social.msdn.microsoft.com/Forums/zh-CN/52e6c11f-ad28-4 ...

  7. 关于NopCommerce3.6版用户登录详解

    一.登录方式 Nop登录方式有两种(且只能选择一种方式登录):一种是用用户名登录,另一种是用户注册邮箱登录,这个在后台可配置: 第一种:用户名登录 后台配置路径在商城设置à设置管理à客户设置:使用用户 ...

  8. MSP430F149学习之路——按键与LED

    代码 /*********************************** 程序功能:用按键控制LED状态 缺点:按键按下后无法改变LED灯的状态,可以利用板上的复位键^~^ ********** ...

  9. Cnetos7下,已经能访问tomcat

    进入/usr/local/apache-tomcat-8.0.24/bin 中 执行:./startup.sh开启tomcat 再执行如下 systemctl stop firewalld.servi ...

  10. ubuntu 开发环境搭建 lisp gcc python perl mysql

    一: lisp sudo apt-get install emacs sudo apt-get install sbcl sudo apt-get install slime emacs里 Alt+x ...