当前位置: 首页>>代码示例>>Python>>正文


Python Convert.SAVE_LOCATION方法代码示例

本文整理汇总了Python中convert.Convert.SAVE_LOCATION方法的典型用法代码示例。如果您正苦于以下问题:Python Convert.SAVE_LOCATION方法的具体用法?Python Convert.SAVE_LOCATION怎么用?Python Convert.SAVE_LOCATION使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在convert.Convert的用法示例。


在下文中一共展示了Convert.SAVE_LOCATION方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Convert

# 需要导入模块: from convert import Convert [as 别名]
# 或者: from convert.Convert import SAVE_LOCATION [as 别名]
"""
This file is an exmaple for running the conversion script
"""

import sys
# Yeah this is a hack
sys.path.append('.')
sys.path.append('../')

from convert import Convert
from datetime import datetime, timedelta

convert = Convert()
convert.CSV_FILE_LOCATION = 'examples/BostonCruiseTerminalSchedule.csv'
convert.SAVE_LOCATION = 'examples/arrive.ics'
convert.HEADER_COLUMNS_TO_SKIP = 2
convert.NAME = 3
convert.START_DATE = 7
convert.END_DATE = 8
convert.DESCRIPTION = 6
convert.LOCATION = 9

convert.read_csv()
i = 0
while i < len(convert.csv_data):
    row = convert.csv_data[i]
    start_date = row[2] + '-'+row[convert.START_DATE]
    try:
        row[convert.START_DATE] = datetime.strptime(start_date, '%m/%d/%y-%H:%M')
        row[convert.END_DATE] = row[convert.START_DATE]+timedelta(hours=1)
        i += 1
开发者ID:AyeJayTwo,项目名称:csv-to-ical,代码行数:33,代码来源:arrive.py

示例2: Convert

# 需要导入模块: from convert import Convert [as 别名]
# 或者: from convert.Convert import SAVE_LOCATION [as 别名]
"""
Converts a Toggl CSV to ICS.
"""


import sys
# Yeah this is a hack
sys.path.append('.')

from convert import Convert
from datetime import datetime

convert = Convert()
convert.CSV_FILE_LOCATION = 'toggl.csv'
convert.SAVE_LOCATION = 'toggl.ics'
convert.HEADER_COLUMNS_TO_SKIP = 2
convert.NAME = 2
togglPROJECT = 3
togglDESCRIPTION = 5
togglUSERNAME = 0
convert.START_DATE = 7
togglSTART_TIME = 8
convert.END_DATE = 9
togglEND_TIME = 10
convert.DESCRIPTION = 12
convert.LOCATION = 13

convert.read_csv()
for row in convert.csv_data:
    row[convert.NAME] = row[convert.NAME]+' - '+row[togglPROJECT]+': '+row[togglDESCRIPTION]+' - '+row[togglUSERNAME]
    row[convert.START_DATE] = datetime.strptime(row[convert.START_DATE]+' '+row[togglSTART_TIME], '%Y-%m-%d %H:%M:%S')
开发者ID:aairey,项目名称:toggl-csv_to_ics,代码行数:33,代码来源:toggl-csv_to_ics.py

示例3: Convert

# 需要导入模块: from convert import Convert [as 别名]
# 或者: from convert.Convert import SAVE_LOCATION [as 别名]
"""
This file is an exmaple for running the conversion script
"""

import sys
# Yeah this is a hack
sys.path.append('.')
sys.path.append('../')

from convert import Convert
from datetime import datetime

convert = Convert()
convert.CSV_FILE_LOCATION = 'examples/BostonCruiseTerminalSchedule.csv'
convert.SAVE_LOCATION = 'examples/day.ics'
convert.HEADER_COLUMNS_TO_SKIP = 2
convert.NAME = 3
convert.START_DATE = 2
convert.END_DATE = 2
convert.DESCRIPTION = 6
convert.LOCATION = 9

convert.read_csv()
for row in convert.csv_data:
    row[convert.START_DATE] = datetime.strptime(row[convert.START_DATE], '%m/%d/%y').date()
    
convert.make_ical()
convert.save_ical()
开发者ID:AyeJayTwo,项目名称:csv-to-ical,代码行数:30,代码来源:day.py

示例4: Convert

# 需要导入模块: from convert import Convert [as 别名]
# 或者: from convert.Convert import SAVE_LOCATION [as 别名]
"""
This file is an exmaple for running the conversion script
"""

import sys
# Yeah this is a hack
sys.path.append('.')
sys.path.append('../')

from convert import Convert
from datetime import datetime, timedelta

convert = Convert()
convert.CSV_FILE_LOCATION = 'home/mwynn/csv.csv'
convert.SAVE_LOCATION = 'home/mwynn/calendar-converted.ics'

convert.read_csv()


convert.make_ical()
convert.save_ical()
开发者ID:bvankat,项目名称:calendar-import,代码行数:23,代码来源:calendar.py

示例5: Convert

# 需要导入模块: from convert import Convert [as 别名]
# 或者: from convert.Convert import SAVE_LOCATION [as 别名]
"""
This file is an exmaple for running the conversion script
"""

import sys
# Yeah this is a hack
sys.path.append('.')
sys.path.append('../')

from convert import Convert
from datetime import datetime, timedelta

convert = Convert()
convert.CSV_FILE_LOCATION = 'examples/BostonCruiseTerminalSchedule.csv'
convert.SAVE_LOCATION = 'examples/depart.ics'
convert.HEADER_COLUMNS_TO_SKIP = 2
convert.NAME = 3
convert.START_DATE = 7
convert.END_DATE = 8
convert.DESCRIPTION = 6
convert.LOCATION = 9

convert.read_csv()
i = 0
while i < len(convert.csv_data):
    row = convert.csv_data[i]
    start_date = row[2] + '-'+row[convert.END_DATE]
    try:
        row[convert.START_DATE] = datetime.strptime(start_date, '%m/%d/%y-%H:%M')
        row[convert.END_DATE] = row[convert.START_DATE]+timedelta(hours=1)
        i += 1
开发者ID:AyeJayTwo,项目名称:csv-to-ical,代码行数:33,代码来源:depart.py


注:本文中的convert.Convert.SAVE_LOCATION方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。