小编Mig*_*ome的帖子

Pyinstaller:生成-exe文件+文件夹(在--onefile模式下)

现在我正在使用Pyinstaller.我有一个脚本从img文件夹中获取图像..

/python
|----/img
|----|----icon1.ico
|----|----icon2.ico
|----maint.py
Run Code Online (Sandbox Code Playgroud)

我生成.exe的脚本是

pyinstaller.py --windowed --noconsole --clean --onefile maint.py
Run Code Online (Sandbox Code Playgroud)

问题是只生成.exe文件但是省略了整个文件夹/ img.

问题:为了自动获取.exe文件+/img文件夹,我需要在上一行中添加哪种附加语法?

2013年12月18日更新

我的意思是:执行pyinstaller.py脚本后,所有参数,我必须在/ dist文件夹中看到:.exe文件+/img文件夹,包含我的应用程序的所有图标或位图文件

谢谢

python user-interface packaging exe pyinstaller

16
推荐指数
1
解决办法
2万
查看次数

MySQL:未知的系统变量'tx_read_only'

我正在开发基于Java Swing的应用程序+ Hibernate + Mysql + Spring.当我测试CRUD操作时,我没有读取问题,但在insert语句系统中显示消息:

Unknown system variable `tx_read_only`
Run Code Online (Sandbox Code Playgroud)

我有最新版本的MySQl

  • 休眠4
  • Java注释

你能告诉我现在要解决的问题是什么吗?

java mysql spring hibernate

3
推荐指数
1
解决办法
6518
查看次数

为什么在JtextField.setDocument()中设置的PlainDocument()会排除文本的一个字符

有人知道为什么在JtextField中,当我设置setDocument()属性-class PlainDocument-当我执行程序时,它向我显示字段ok,但只有我可以输入N-1个字符,当我将maxlength prop设置为N字符长度.

// Block 1
txtPais.setDocument(new MaxLengthTextCntry());
Run Code Online (Sandbox Code Playgroud)

我有另一个内部设置最大长度的类

// Block 2    
public class MaxLengthTextCntry extends MaxLengthGeneric{  
    public MaxLengthTextCntry(  
        {  
            super(2);  
        }  
    }
Run Code Online (Sandbox Code Playgroud)

最后是MaxLengthGeneric

// Block 3
public abstract class MaxLengthGeneric extends PlainDocument {

        private int maxChars;

        public MaxLengthGeneric(int limit) {
            super();
            this.maxChars = limit;
        }

        public void insertString(int offs, String str, AttributeSet a)
                throws BadLocationException {
            if (str != null && (getLength() + str.length() < maxChars)) {
                super.insertString(offs, str, a);
            }
        }
    }
Run Code Online (Sandbox Code Playgroud)

维护块2,我用块1代替了块1

((AbstractDocument) txtRucnumero.getDocument()).setDocumentFilter(new …
Run Code Online (Sandbox Code Playgroud)

java swing maxlength jtextfield documentfilter

0
推荐指数
1
解决办法
2186
查看次数