การสร้่าง Python module ให้ install executable script ลงใน /usr/bin

  • warning: realpath() [function.realpath]: SAFE MODE Restriction in effect. The script whose uid is 1005 is not allowed to access /tmp owned by uid 0 in /var/www/sites/sugree/codenone.com/subdomains/www/html/includes/file.inc on line 190.
  • warning: realpath() [function.realpath]: SAFE MODE Restriction in effect. The script whose uid is 1005 is not allowed to access /tmp owned by uid 0 in /var/www/sites/sugree/codenone.com/subdomains/www/html/includes/file.inc on line 190.

การสร้่าง Python module ให้ install executable script ลงใน /usr/bin ควรทำอย่างไรครับ?
ใช้ install additional file? หรือว่าควรใช้ท่าอื่น ต้องเรียก chmod 755 ตอนไหน? ทำอย่างไรให้ portable (แบบใช้บน windows หรือ os อื่นๆ นอกจาก unix-like ได้ด้วย)

veer's picture

แล้วก็ทำเป็นละ :-P
setup(..., scripts=[scripts/my_script], ...
มันแก้ header ให้ด้วย สมมุติว่า python เราอยู่ใน /usr/pkg/bin มันก็ใส่ให้ โดยที่ใน script ของเราก็ใส่ #! python ไว้มันก็แก้ๆ ให้เอง

veer's picture

ใช้ setuptools แล้วเจ๊งตอน zip ด้วยอะ มันบอก memory error -_-'
เลยต้องการมาใช้ distutils ไปพลางๆ

ย้าย Codenone

ประกาศย้าย Codenone ไปใช้ Forum ของ Blognone แทนครับ ตามไปตั้งกระทู้ต่อได้ที่ Codenone Forum (รายละเอียดอ่านจากกระทู้ ย้าย Codenone ไปรวมกับ Blognone)

กระทู้เก่าๆ จะย้ายตามไปในภายหลัง ตอนนี้ปิดการโพสต์กระทู้ไว้ เหลือไว้เฉพาะอ้างอิงเท่านั้น