首页 \ 问答 \ 用什么软件打开*.pdf文件才能进行编辑?

用什么软件打开*.pdf文件才能进行编辑?

用什么软件打开*.pdf文件才能进行编辑?因为我用Potoshop打开是个合层的位图,我想大家知道有什么矢量软件打开它保持它的矢量图形的吗? 用ADOBE ACROBAT 打开是编辑不了的
更新时间:2023-09-15 09:09

最满意答案

测量执行时间,共测量三组,每组测量2次,最后是每组测试的总时间。

>>> import timeit
>>> timeit.Timer('print("this is a test")').repeat(3,2)
this is a test
this is a test
this is a test
this is a test
this is a test
this is a test
[1.0013580322265625e-05, 4.0531158447265625e-06, 3.0994415283203125e-06]

其他回答

使用timeit模块,先介绍下:
timeit 模块
timeit 模块定义了接受两个参数的 Timer 类。两个参数都是字符串。 第一个参数是你要计时的语句或者函数。 传递给 Timer 的第二个参数是为第一个参数语句构建环境的导入语句。 从内部讲, timeit 构建起一个独立的虚拟环境, 手工地执行建立语句,然后手工地编译和执行被计时语句。
一旦有了 Timer 对象,最简单的事就是调用 timeit(),它接受一个参数为每个测试中调用被计时语句的次数,默认为一百万次;返回所耗费的秒数。
Timer 对象的另一个主要方法是 repeat(), 它接受两个可选参数。 第一个参数是重复整个测试的次数,第二个参数是每个测试中调用被计时语句的次数。 两个参数都是可选的,它们的默认值分别是 3 和 1000000。 repeat() 方法返回以秒记录的每个测试循环的耗时列表。Python 有一个方便的 min 函数可以把输入的列表返回成最小值,如: min(t.repeat(3, 1000000))
你可以在命令行使用 timeit 模块来测试一个已存在的 Python 程序,而不需要修改代码。


再给你个例子,你就知道怎么做了。
# -*- coding: utf-8 -*-
#!/bin/env python

def test1():
    n=0
    for i in range(101):
        n+=i
    return n

def test2():
    return sum(range(101))

def test3():
    return sum(x for x in range(101))

if __name__=='__main__':
    from timeit import Timer
    t1=Timer("test1()","from __main__ import test1")
    t2=Timer("test2()","from __main__ import test2")
    t3=Timer("test3()","from __main__ import test3")
    print t1.timeit(1000000)
    print t2.timeit(1000000)
    print t3.timeit(1000000)
    print t1.repeat(3,1000000)
    print t2.repeat(3,1000000)
    print t3.repeat(3,1000000)
# -*- coding: UTF-8 -*-

from functools import wraps
import time

__author__ = 'lpe234'


def exec_time(func):
    """
    calc exec time
    :param func:
    :return:
    """
    @wraps(func)
    def _exec_time(*args, **kwargs):
        begin_time = time.time()
        func(*args, **kwargs)
        end_time = time.time()
        print 'total used {} seconds'.format(end_time-begin_time)
    return _exec_time


@exec_time
def xx():
    for i in range(999):
        for j in range(999):
            pass


xx()# result
python cc.py
total used 0.0237939357758 seconds

Process finished with exit code 0
有两种方法(我利用的是Python27):

1、加载import time模块,可以粗略的计算,如下:
        print "@%s, {%s} start" % (time.strftime("%X", time.localtime()), func.__name__)  
        back = func(args)  
        print "@%s, {%s} end" % (time.strftime("%X", time.localtime()), func.__name__) 
2、加载import timeit模块,这个是Python 特意计算代码块时间的工具,可以在命令行中输入help(timeit)即可看到模块里的函数。例如:
import timeit
def func1(x):
    pow(x, 2)

def func2(x):
    return x * x

v = 10000          #函数执行的次数,由于函数执行时间很短 所以计算调用10000次的时间

func1_test = 'func1(' + str(v) + ')'
func2_test = 'func2(' + str(v) + ')'

print timeit.timeit(func1_test, 'from __main__ import func1')
print timeit.timeit(func2_test, 'from __main__ import func2')

print timeit.repeat(func1_test, 'from __main__ import func1')
print timeit.repeat(func2_test, 'from __main__ import func2')
starttime=time()
run('some thing')
usetime=time()-starttime
print usetime
n=0时执行到了for i in range(2,n),这个range是个空列表[],故一次也不会进入for循环执行“ fibs.append(fibs[-1] + fibs[-2])”,,直接返回[1,1],故不报错
n=1返回[1]
n=2返回[1,1]
n=3及以上,进入for循环,fibs每次增加一个元素,其值为倒数第1个和倒数第2个元素之和
改为if ... elif...else可以如下:
def fib(n):
    if n<1:
        return none
    elif n == 1:
        return [1]
    elif n == 2:
        return [1, 1]
    else:
        fibs = [1, 1]
        for i in range(2, n):
            fibs.append(fibs[-1] + fibs[-2])
    return fibs
print (fib(10))

相关问答

更多
  • find()函数,当在字符串中查找某个字符的时候,没有找到返回-1。用法如下: print "sssfdvww".find("a")
  • print函数是python语言中的一个输出函数,可以输出以下几种内容 1. 字符串和数值类型 可以直接输出 >>> print( 1) 1 >>> print( "Hello World") Hello World 2.变量 无论什么类型,数值,布尔,列表,字典...都可以直接输出 >>> x = 12 >>> print(x) 12 >>> s = 'Hello' >>> print(s) Hello >>> L = [ 1, 2, 'a'] >>> print(L) [ 1, 2, 'a'] >>> ...
  • count = 0 while b==2: count += 1 if count >= 10000: break ...
  • 测量执行时间,共测量三组,每组测量2次,最后是每组测试的总时间。 >>> import timeit >>> timeit.Timer('print("this is a test")').repeat(3,2) this is a test this is a test this is a test this is a test this is a test this is a test [1.0013580322265625e-05, 4.0531158447265625e-06, 3.09944152 ...
  • 输出指的是最终的输出结果 r-'-'-'a-b-c,使用双引号包裹 print("r'''abc") "-'c-c-'-',使用转义 print("\"'cc''") => "-\"-'-c-c-'-'
  • python 问题[2023-06-21]

    这。。。本身得出的pwd是有问题的,你可以试着将pwd打印出来看下。如果你要进入目录,可以试着用os.chdir()
  • 这是适用于计算的科学符号。 E-05意味着10的权力-5: 8.73194...E-05 = 8.73194 * 10^(-5) = 0.000 087 319 4... That's scientific notation applied to computing. E-05 means 10 to the power of -5: 8.73194...E-05 = 8.73194 * 10^(-5) = 0.000 087 319 4...
  • 使用检查模块。 >>> import inspect >>> inspect.getargspec(func) (['a', 'b', 'c'], None, None, None) 返回元组的第一部分就是你要找的东西。 Use the inspect module. >>> import inspect >>> inspect.getargspec(func) (['a', 'b', 'c'], None, None, None) The first part of returned tuple is ...
  • 如果.py文件的当前默认Windows应用程序当前是python2 (即C:\python27\python.exe )而不是新的py.exe启动程序,则只需更改文件类型的默认Windows应用程序即可。 右键单击文件 - >属性 - >单击默认应用程序的更改按钮,然后将其更改为python3可执行文件。 如果该文件的默认应用程序是py.exe Windows启动程序,您可以在脚本中添加一个shebang行来强制python可执行文件,启动程序应该尊重它。 将其添加为文件的第一行 #!C:\python3\ ...
  • 这不是计算问题,也不是写入文件:大部分时间都是通过将结果从其内部二进制表示转换为基10表示而消耗的。 这需要时间二进制的位数,这里你有很多位。 如果您将输出行替换为: outputFile.writelines(hex(x)) 你会发现它运行得非常快。 转换为十六进制表示只需要时间线性的位数。 如果你真的需要输出基数为10的巨型整数,请使用decimal模块来代替。 这在与基数10相关的表示中进行内部计算,然后转换为十进制字符串需要在十进制数字的数量上呈线性。 但是,您需要提前将小数上下文的精度设置为“足 ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。