首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看Python
from maya.cmds import*
from  YJ_Bone_SearchAndReplace_Name import*
from YJ_ParentShape import*
from YJ_Creat_Curve import*
#############Rig 
###########
def YJ_CreatBlendCoL_T(NodeName,InObj1,InObj2,OutObj):
    shadingNode('blendColors', asUtility=1,n=NodeName)
    connectAttr('%s.t'%InObj1,'%s.color1'%NodeName,f=1)
    connectAttr('%s.t'%InObj2,'%s.color2'%NodeName,f=1)
    connectAttr('%s.output'%NodeName,'%.t'%OutObj,f=1)

......................
阅读全部 | zhuqingting 贴于 2013年7月17日 17:51     hide bbsi
#===============================================================================
# author: yangjie
# mobilePhone:15850792203
# QQ:691633493
# E-mail:691633493@qq.com
#===============================================================================
from maya.cmds import*
import maya.mel as yjm
import os
def YJ_weighiTool():
    if(window('YJWeightWin',q=1,ex=1)):
     deleteUI('YJWeightWin',window=1)
......................
阅读全部 | zhuqingting 贴于 2013年7月17日 11:04     hide bbsi
最近在学习python,楼主练习写个程序遇到个问题,好像是全局变量的问题吧,我用return时能正常,但写GUI时不会用return了,结果读不进数据,有python高手请指导下。

普通程序:(能正常执行)
#读取路权矩阵
def readdata(D0,S0,D1,S1,list):
    fpr=open("d.txt")   
    k=0
    for line in fpr:
        k+=1
        D0[k]={}
        S0[k]={}
        S1[k]={}
......................
阅读全部 | lenhal 贴于 2012年12月16日 00:17     hide bbsi
# 在这里找到一个解决方案 http://www.linuxdiyf.com/viewarticle.php?id=145791
# 不过几十个文件挨个改太麻烦了,用这个脚本可以自动修改,放在/usr/share/applications/kde4/里面运行
# 记得运行前备份kde4文件夹

import os
for f in os.listdir('.'):
    s = open(f).read()
    if not 'OnlyShowIn=KDE' in s:
        s = s + "\nOnlyShowIn=KDE"
        file(f, 'w').write(s)
        print f

......................
阅读全部 | 静夜思 贴于 2012年3月28日 23:07     hide bbsi
#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import os
from django import template
from django.conf import settings

register = template.Library()

class SassNode(template.Node):
    def __init__(self, format_string):
        self.format_string = format_string
......................
阅读全部 | 静夜思 贴于 2012年3月15日 21:46     hide bbsi
#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import os
from django import template
from django.conf import settings

register = template.Library()

class SassNode(template.Node):
    def __init__(self, format_string):
        self.format_string = format_string
......................
阅读全部 | 静夜思 贴于 2012年3月15日 08:16     hide bbsi
#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import commands
import os
import re
import urllib
import urllib2

"""
这段脚本能帮你自动下载安装最新版的rails,如果缺少相关的gem包则递归下载相应的gem包,直到安装成功为止
by BCCN.静夜思 2011.11.11
......................
阅读全部 | 静夜思 贴于 2011年11月12日 09:01     hide bbsi
#!/usr/bin/env python
# -*- coding: UTF-8 -*-

'''
检测XP系统进程和系统服务
把可疑的进程和服务列出来(以我自己的电脑为参考)
启动项检测挺麻烦的,我的电脑上只有3个(只有一个ctfmon.exe是必需的,另两个是google相关的update程序),到“CCleaner-工具-启动”查看和设置可以了
使用本脚本可以一定程度上检测恶意程序,追求更高的安全还得靠杀毒软件
2011.11.07 BCCN.静夜思
'''

import os
......................
阅读全部 | 静夜思 贴于 2011年11月7日 12:35     hide bbsi
#!/usr/bin/python
# -*- coding: UTF-8 -*

'''
传言需要写10万行代码才能真正熟手,统计一下你写了多少行代码了
把本代码保存为.py为后缀的文件放在你要统计的文件夹里面,双击运行即可,前提是你的系统装了python
注意要保存为UTF-8编码的文件
by BCCN.静夜思
'''

import os

......................
阅读全部 | 静夜思 贴于 2011年10月28日 09:24     hide bbsi
#!/usr/bin/python
# -*- coding: UTF-8 -*-

#方法一
l = ['aadfds','dsa', 'dcver','weiry','11111']
l = [x for x in l if 'a' not in x]      #列表解析
print l

#方法二
l = ['aadfds','dsa', 'dcver','weiry','11111']
l = filter(lambda x:'a' not in x, l)    #filter
print l
......................
阅读全部 | 静夜思 贴于 2011年10月28日 06:15     hide bbsi
上一页 17 18 19 20 21 22 23 24 25 26 下一页