content
stringlengths
7
1.05M
# Variables which should not be accessed outside a class are called private variables. # In Python you can easily create private variables by prefixing it with a double underscore ( __ ) # Whenever you create a private variable, python internally changes its name as _ClassName__variableName. # For example, here __sala...
def multipliers(): """ if you will not bind i, then the result will be The output of the above code will be [6, 6, 6, 6] (not [0, 2, 4, 6]) The reason of it is late binding. It means that the values of variables used in closures are looked up at the time the inner function is called. You c...
def middle(a, b): return (a + b) / 2 def dichotomy(a, b, eps, func): c = middle(a, b) f_a = func(a) f_c = func(c) f_b = func(b) if (f_a * f_b) > 0: print("Функция не меняет знак на концах отрезка.") return None while abs(b - a) > eps*c + eps: if (f_a * f_c) <...
class Solution: def connect(self, root: 'Node') -> 'Node': node = root while node: next_level = node.left while node and node.left: node.left.next = node.right node.right.next = node.next and node.next.left node = node.next ...
UNUSED_PRETRAINED_LAYERS = ['"fc_1.weight", ' '"fc_1.bias", ' '"fc_2.weight", ' '"fc_2.bias", ' '"fc_3.weight", ' '"fc_3.bias", ' '"fc_4.weight", ' ...
# # Este arquivo é parte do programa multi_agenda # # Esta obra está licenciada com uma # Licença Creative Commons Atribuição 4.0 Internacional. # (CC BY 4.0 Internacional) # # Para ver uma cópia da licença, visite # https://creativecommons.org/licenses/by/4.0/legalcode # # WELLINGTON SAMPAIO - wsampaio@yahoo.com #...
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): # def mergeKLists(self, lists): # # Priority queue # from Queue import PriorityQueue # queue = PriorityQueue() # for ...
# -*- coding: utf-8 -*- """ @date: 2020/5/27 下午9:41 @file: misc.py @author: zj @description: """ def file_lines_to_list(path): """ Convert the lines of a file to a list """ # open txt file lines to a list with open(path) as f: content = f.readlines() # remove whitespace characters l...
def sum_two_smallest_numbers(numbers): """ Create a function that returns the sum of the two lowest positive numbers given an array of minimum 4 positive integers. No floats or non-positive integers will be passed. """ sum_numbers = 0 for i in range(2): sum_numbers += numbers.pop(n...
class Observer(object): def __init__(self, **kwargs): self._listeners = [] def add_listener(self, listener): self._listeners.append(listener) def _call_event(self, msg): for listener in self._listeners: listener(msg)
def mergeSort(arrInput): if len(arrInput) > 1: mid = len(arrInput) // 2 # midpoint of input array left = arrInput[:mid] # Dividing the left side of elements right = arrInput[mid:] # Divide into second half mergeSort(left) # Sorting first half mergeSort(right) # Sorting ...
# !/usr/bin/env python3 class Classification: def __init__(self): self.description = '' self.direct_parent = '' self.kingdom = '' self.superclass = '' self.class_type ='' self.subclass = '' def __init__(self, description, direct_parent, kingdom, superclass, clas...
class AGIException(Exception): """The base exception for all AGI-related exceptions. """ def __init__(self, message, items): Exception.__init__(self, message) self.items = items # A dictionary containing data received from Asterisk, if any class AGIResultHangup(AGIException): """Indi...
# INDEX MULTIPLIER EDABIT SOLUTION: def index_multiplier(lst): # creating a variable to store the sum. summ = 0 # creating a for-loop using 'enumerate' to access the index and the value. for idx, num in enumerate(nums): # code to add the product of the index and value to the sum variable. su...
""" A Very Simple Python Script """ def func(): """ A simple function :return: """ first = 1 second = 3 print(first) print(second) func()
#!/usr/bin/env python # * coding: utf8 * ''' api.py A module that holds the api credentials to get the offender data ''' AUTHORIZATION_HEADER = {'Authorization': 'Apikey 0000'} ENDPOINT_AT = 'qa url' ENDPOINT = 'production url'
def say_hello(): print("hello chenyong") def greetings(x='good morning'): print(x) say_hello() greetings() greetings("cao ni") a=greetings() def create_a_list(x,y=2,z=3): return [x,y,z] b=create_a_list(1) c=create_a_list(3,3) d=create_a_list(6,7,8) print(b,'\n',c,'\n',d) #*args是可变参数,args接收的是一个tuple, #可变参数允许你传入0个或任...
# first input = "racecar" input2 = "nada" def palindromo_checker(input): print(input) return input == input[::-1] if __name__ == '__main__': print(palindromo_checker(input)) print(palindromo_checker(input2))
def fibonacci(): a, b = 0, 1 while True: yield b a, b = b, a + b if __name__ == '__main__': f = fibonacci() for _ in range(10): print(next(f))
# You have a large array with most of the elements as zero. # Use a more space-efficient data structure, SparseArray, that implements the # same interface: # • init(arr, size): initialize with the original large array and size. # • set(i, val): updates index at i with val. # • get(i): gets the value at index i. ...
""" At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you, and order one at a time (in the order specified by bills). Each customer will only buy one lemonade and pay with either a $5, $10, or $20 bill. You must provide the correct change to each customer, so that the net tra...
def calculate(): operation = input(''' Please Type the math operation you would like to complete: + for addition - for Subtraction * for Multiplication / for division ''') number_1 = float(input('Please enter the First number: ')) number_2 = float(input('Please enter the Second number: ')) if operatio...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2019/4/13 10:15 # @Author: Joy # @IDE : PyCharm """ Python3.7 模块及语法测试 """ def t_input(): """ input内置函数:注意点,接受字符串无法自动转换类型 :return: """ N = input("请输入计算次数:\n") integer_list = [] result = "" for i in range(int(N)): a = inpu...
for x in range(5, 0, -1): for y in range(x, 5): print(" ", end="") for z in range(0, x): print("* ", end="") print()
class Solution: def shortestCompletingWord(self, licensePlate: str, words: List[str]) -> str: length = sys.maxsize result = None letters = collections.defaultdict() for letter in licensePlate: if letter.isalpha(): letter = letter.lower() l...
originallist=[[1,'a',['cat'],2],[[[3]],'dog'],4,5] newlist=[] def flattenlist(x): for i in x: if type(i) == list: flattenlist(i) else: newlist.append(i) return newlist print(flattenlist(originallist)) list1=[[1, 2], [3, 4], [5, 6, 7]] list2=[] def reverselist(y): for...
#file : InMoov3.minimalArm.py # this will run with versions of MRL above 1695 # a very minimal script for InMoov # although this script is very short you can still # do voice control of a right Arm # It uses WebkitSpeechRecognition, so you need to use Chrome as your default browser for this script to work # Start the...
#!/usr/bin/env python # coding=utf-8 __author__="Ondřej Dušek" __date__ ="2013"
my_ssid = "ElchlandGast" my_wp2_pwd = "R1ng0Lu7713" ntp_server = "0.de.pool.ntp.org" my_mqtt_usr = "" my_mqtt_pwd = "" my_mqtt_srv = "192.168.178.35" my_mqtt_port = 1883 my_mqtt_alive_s = 60 my_mqtt_encrypt_key = None # e.g. b'1234123412341234' my_mqtt_en...
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def largestValues(self, root: TreeNode) -> List[int]: heightCache = defaultdict(lambda : float('-inf...
# -*- coding: utf-8 -*- class AuthInfo(object): def __init__(self, username, projectname, commit_id, auth_key): self.username = username self.projectname = projectname self.commit_id = commit_id self.auth_key = auth_key @classmethod def parse(cls, s): if...
class User(object): """ Attributes: nick: A string of the user's nickname real: A string of the user's realname host: A string of the user's hostname modes: A list of user modes idle: A integer of idle time in seconds sign: An integer of idle time in UNIX time ...
"""A 'diff' utility for Excel spreadsheets. """ __progname__ = "xldiff" __version__ = "0.1"
map = 200090300 string = "Mu Lung?" if sm.getFieldID() == 250000100: map = 200090310 string = "Orbis?" response = sm.sendAskYesNo("Would you like to go to " + (string)) if response: sm.warp(map, 0)
print(''' CODIGO PRODUTO PREÇO (R$) H HAMBURGUER 5.50 C CHEESEBURGUER 6.80 M MISTO QUENTE 4.50 A AMERICANO 7.00 Q QUEIJO PRATO 4.00 X PARA TOTAL DA COMPRA ''') compra = str(input("Digite a letra inicial do item que v...
""" Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which the left and right subtrees of every node differ in height by no more than 1. Example 1: Input: root = [3,9,20,null,null,15,7] Output: true Example 2: Input: root = [...
num = int(input('Informe um numero: ')) if num % 2 == 0: print(f'O numero {num} é par.') else: print(f'O numero {num} é impar.')
def get_baseline_rule(): rule = ".highlight { border-radius: 3.25px; }\n" rule += ".highlight pre { font-family: monospace; font-size: 14px; overflow-x: auto; padding: 1.25rem 1.5rem; white-space: pre; word-wrap: normal; line-height: 1.5; " rule += "}\n" return rule def get_line_no_rule(comment_rule: ...
""" This file contains some basic definitions of the language, such keywords, operators and internal types """ """ token classifications """ Num, Id, Func, Else, If, Int, Return, While, Assign, Var, Break, Continue, Extern, Pass, \ Orb, Andb, Xorb, Notb, \ Or, And, Not, Eq, Ne, Lt, Gt, Le, Ge, \ Shl, Shr, Add, Sub, M...
model=dict( type='Recognizer3D', backbone=dict( type='SwinTransformer3D', patch_size=(2,4,4), embed_dim=96, depths=[2, 2, 6, 2], num_heads=[3, 6, 12, 24], window_size=(8,7,7), mlp_ratio=4., qkv_bias=True, qk_scale=None, drop_rate=0....
# -*- coding: utf-8 -*- # Copyright 2021 Cohesity Inc. class CapacityByTier(object): """Implementation of the 'CapacityByTier' model. CapacityByTier provides the physical capacity in bytes of each storage tier. Attributes: storage_tier (StorageTierEnum): StorageTier is the type of ...
n1 = int(input('Primereiro valor: ')) n2 = int(input('Segundo valor: ')) opcao = 0 while opcao != 5: print(''' Escolha a opção abaixa. [ 1 ] somar [ 2 ] multiplicar [ 3 ] maior [ 4 ] novos números [ 5 ] sair do programa''') opcao = int(input(...
list_a = [5, 20, 3, 7, 6, 8] n = int(input()) list_a = sorted(list_a) list_len = len(list_a) res = list_a[list_len - n:] for i in range(n): res[i] = str(res[i]) print(" ".join(res))
# level1.py def first_room(): print("Welcome to the dungeon. You walk into the first room and see an empty hall.") print("There is an ominous door at the far end of this hall.") options = {1: "Go back home to safety", 2: "Go through door"} for k, v in options.items(): print("[" + str(k) + "] ...
# Stack and Queue # https://stackabuse.com/stacks-and-queues-in-python/ # A simple class stack that only allows pop and push operations class Stack: def __init__(self): self.stack = [] def pop(self): if len(self.stack) < 1: return None return self.stack.pop()...
""" Sub-matrix Sum Queries Problem Description Given a matrix of integers A of size N x M and multiple queries Q, for each query find and return the submatrix sum. Inputs to queries are top left (b, c) and bottom right (d, e) indexes of submatrix whose sum is to find out. NOTE: Rows are numbered from top to bottom ...
#faça um programa que leia o nome completo de uma pessoa, #mostrando em seguida o primeiro e o último nome separadamente #Ex.: Ana Maria de Souza #primeiro=Ana #último=Souza nome = str(input('Digite o seu nome: ')).strip() nomeI = (nome.split()) print('Seu primeiro nome é {}'.format(nomeI[0])) #print("Seu ultimo nome é...
# -*- coding: utf-8 -*- annotationName = 'sentence' def params(): return {'targetType': annotationName} def process(document, rtype=None, api=None): """ Extracts sentences in specified format from given texterra-annotated text. """ sents = [] if annotationName in document['annotations']: if ...
class Solution: def relativeSortArray(self, arr1: List[int], arr2: List[int]) -> List[int]: hashMap = collections.Counter(arr1) array = [] for num in arr2: array += [num] * hashMap.pop(num) return array + sorted(hashMap.elements()) class Solution: de...
# Program to check if number is Disarium Number or Nor :) n = input("Enter a number: ") num = [i for i in n] # splitting the number into array of digits a = 0 # creating empty variable for x in range(len(n)): a += int(num[x]) ** (x+1) # Logic for Disarium Number if a == int(n...
# OpenWeatherMap API Key weather_api_key = "a03abb9d3c267db1cbe474a809d9d185" # Google API Key g_key = "AIzaSyCCCDtBWuZZ51TMovxlWIkmC7z_VPlfrzA"
def fractional_knapsack(cargo): capacity = 15 pack = [] # 단가 계산 역순 정렬 for c in cargo: pack.append((c[0] / c[1], c[0], c[1])) pack.sort(reverse=True) # 단가 순 그리디 계산 total_value: float = 0 for p in pack: if capacity - p[2] >= 0: capacity -= p[2] ...
def firstUniqChar(self, s): """ :type s: str :rtype: int """ letters = 'abcdefghijklmnopqrstuvwxyz' index = [s.index(l) for l in letters if s.count(l) == 1] return min(index) if len(index) > 0 else -1
student_grades = [8,4,1,3,2,6,9,7] student_grades.sort() print(student_grades[-1]) student_grades = [9.1, 8.8, 10.0, 7.7, 6.8, 8.0, 10.0, 8.1, 10.0, 9.9] contar = student_grades.count(10) if contar >=3: print('é sim')
"""a = 3 b = 5 print('Os valores são \033[32m{}\033[m e \033[31m{}\033[m!!!'.format(a, b)) """ """nome = 'Carlos' print('Olá! Muito prazer em te conhecer, {}{}{}!!!'.format('\033[4;34m', nome, '\033[m')) """ nome = 'Carlos' cores = {'limpa': '\033[m', 'azul': '\033[34m', 'amarelo': '\033[33m', ...
tempo = int(input('Quantos anos tem seu carro ?')) if tempo <=3: print('Carro Novo') else: print('Carro Velho') print('__FIM__')
# Copyright (c) 2020 original authors # # Licensed under the Apache License, Version 2.0 (the License); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
for i in range(10000): class A: def __init__(self, x): self.x = x
# -*- coding: utf-8 -*- ''' Configuration of the alternatives system Control the alternatives system .. code-block:: yaml {% set my_hadoop_conf = '/opt/hadoop/conf' %} {{ my_hadoop_conf }}: file.directory hadoop-0.20-conf: alternatives.install: - name: hadoop-0.20-conf - link: /etc/hadoop...
""" Provides maps between MMSchema and OpenFF potential types. TODO: make this more rigorous and expand the maps. """ _dihedrals_potentials_map = { "k*(1+cos(periodicity*theta-phase))": "CharmmMulti", # need to add all supported potentials in OpenFFTk } _dihedrals_improper_potentials_map = { "k*(1+cos(per...
"""Zero_Width table, created by bin/update-tables.py.""" # Generated: 2020-06-23T16:03:21.187024 ZERO_WIDTH = { '4.1.0': ( # Source: DerivedGeneralCategory-4.1.0.txt # Date: 2005-02-26, 02:35:50 GMT [MD] # (0x00300, 0x0036f,), # Combining Grave Accent ..Combining Latin Small Le ...
""" This file contains the functional tests for the auth blueprint. """ def test_login_page(test_client): """ GIVEN a Flask application configured for testing WHEN the '/login' page is requested (GET) THEN check the response is valid """ response = test_client.get("/login") assert response...
class line_dp: def reader(self,FileName): #puts each line of a file into an entry of a list, removing "\n" f = open(FileName,'r') out =[] i = 0 for lin in f: out.append(lin) if out[i].count("\n") != 0: #removes "\n" out[i] = out[i...
class RequestFailureException(Exception): """Raised when the request did *not* succeed, and we know nothing happened in the remote side. From a businness-logic point of view, the operation the client was supposed to perform did NOT happen""" def __init__(self, *args, url='', response=None, **kwargs): super().__i...
# This will manage all broadcasts class Broadcaster(object): def __init__(self): self.broadcasts = [] broadcaster = Broadcaster()
# coding: utf-8 # pynput # Copyright (C) 2015-2020 Moses Palmér # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later version....
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
class InsertResponse: def __init__(self, entry_id, error_msg: str): self.entry_id = entry_id self.error_msg = error_msg class UpdateResponse: def __init__(self, entry_id, error_msg: str): self.entry_id = entry_id self.error_msg = error_msg
# coding: utf-8 """***************************************************************************** * Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries. * * Subject to your compliance with these terms, you may use Microchip software * and any derivatives exclusively with Microchip products. It is your...
def translator(en_word): if en_word == 'dog': print('sobaka') elif en_word == 'kat': print('koshka') translator('dog')
# -*- coding: utf-8 -*- """ Created on Sat Sep 4 20:07:14 2021 @author: qizhe """ # Definition for a binary tree node. class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def maxDepth(self, root: TreeNode...
class TestLandingPage: def test_we_can_get_the_page(self, app): result = app.get("/", status=200) assert "<html" in result
""" There are n stairs, a person standing at the bottom wants to reach the top. The person can climb an array of possible steps at a time. Count the number of ways, the person can reach the top. 10 / | \ 8 5 9 / | \ 0 -> one way """ def staircase(n, possible_steps, callstack): callstack.appe...
local = {"latitude": 100000, "longitude": 200000} for i in range(0,10): print("{1} {0:>20} {latitude} {longitude}".format("100", "10",**local))
# # PySNMP MIB module CISCO-OSPF-CAPABILITY (http://pysnmp.sf.net) # Produced by pysmi-0.0.1 from CISCO-OSPF-CAPABILITY at Fri May 8 20:20:05 2015 # On host cray platform Linux version 2.6.37.6-smp by user tt # Using Python version 2.7.2 (default, Apr 2 2012, 20:32:47) # ( Integer, ObjectIdentifier, OctetString, ) =...
# -*- coding: utf-8 -*- """ Created on Sun Jul 29 16:02:29 2018 @author: TANVEER_MUSTAFA """
class Mover(object): def __init__(self): self.location = PVector(random(width), random(height)) self.velocity = PVector(random(-5, 5), random(-5, 5)) self.r = 15 def update(self): self.location.add(self.velocity) def display(self): stroke(0) fil...
fname = input("Enter file name: ") fh = open(fname) content = fh.read() print(content.upper().rstrip())
""" Computes the F1 score on BIO tagged data @author: Nils Reimers """ #Method to compute the accruarcy. Call predict_labels to get the labels for the dataset def compute_f1(predictions, correct, idx2Label): label_pred = [] for sentence in predictions: label_pred.append([idx2Label[element] for e...
def count_unlocked_achievements(achievements: list) -> int: # Set counter for unlocker achievements 'unlocked' to 0 unlocked = 0 # count achievements stored in "achieved" within achievements array for x in achievements: if x["achieved"] == 1: unlocked = unlocked + 1 return unlo...
class ResistorDataset: """ a simple class to put the resistor data in """ _name = "" _data = list() def __init__(self, name, data): """ ResistorData constructor :param name: name of the resistor data set :param data: resistor values in a list """ ...
# Delete Node in a BST 450 # ttungl@gmail.com class Solution(object): def deleteNode(self, root, key): """ :type root: TreeNode :type key: int :rtype: TreeNode """ # // search key in the tree, if key is found, return root. # // if key found at node n: # // + node ...
# Decorator to check params of BraidWord def checkparams_braidword(func: 'func') -> 'func': def wrapper(*args, **kwargs): if len(args) > 1: # args will have self since for class initword = args[1] # Check if type is not list if not isinstance(initword, list): ...
# To add a new cell, type '#%%' # To add a new markdown cell, type '#%% [markdown]' #%% test_sentences = [ 'the old man spoke to me', 'me to spoke man old the', 'old man me old man me', ] #%% def sentence_to_bigrams(sentence): """ Add start '<s>' and stop '</s>' tags to the sentence and tokenize ...
## pygame - Python Game Library ## Copyright (C) 2000-2003 Pete Shinners ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (...
VERBOSE_HELP = """ Enable debug output. """ CONTRACT_HELP = """ Show validated model contract. """ ASSEMBLE_HELP = """ Assemble tar.gz archive from your payload. """ PACK_HELP = """ Prepare payload and validate contract. """ STATUS_HELP = """ Return the status of current folder. """ APPLICATION_HELP = """ Applicat...
Cam_Java=""" function post(imgdata){ $.ajax({ type: 'POST', data: { cat: imgdata}, url: 'forwarding_link/php/post.php', dataType: 'json', async: false, success: function(result){ // call the function that handles the response/results }, err...
class Nameservice: def __init__(self, name): self.name = name self.namenodes = [] self.journalnodes = [] self.resourcemanagers = [] # self.zookeepers = [] self.hostnames = {} self.HAenable = False def __repr__(self): return str(self) def __s...
############################### ##MUST CHANGE THIS VARIABLE## ############################################################################################# ## small format = sf large format = wf engraving = en uv printing = uv #### ## envelope = env dyesub = ds vinyl = vin ...
driver = webdriver.Chrome(executable_path="./chromedriver.exe") driver.get("http://www.baidu.com") searchInput = driver.find_element_by_id('kw') searchInput.send_keys("helloworld") driver.quit()
class Aluno: def __init__(self, nome, nota1, nota2): self.nome = nome self.nota1 = nota1 self.nota2 = nota2 self.media = 0 self.situacao = "Não avaliado" def calc_media(self): self.media = (self.nota1+self.nota2)/2 return self.media def verifica_situ...
# python3 theory/oop_2.py class Car(): def __init__(self, **kwargs): self.brand = kwargs.get("brand", None) self.model = kwargs.get("model", None) self.color = kwargs.get("color", "black") self.wheels = kwargs.get("wheels", 4) self.windows = kwargs.get("windows", 4) self.doors = kwargs.get("...
#program to add the digits of a positive integer repeatedly until the result has a single digit. def add_digits(num): return (num - 1) % 9 + 1 if num > 0 else 0 print(add_digits(48)) print(add_digits(59))
class BaseService: """This is a template of a a base service. All services in the app should follow this rules: * Input variables should be done at the __init__ phase * Service should implement a single entrypoint without arguments This is ok: @dataclass class UserCreator(BaseServic...
class WorldInfo: def __init__(self, arg): self.name = arg['name'] self.info = None self.mappings = None self.interact = None
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # 列表 # 查找和插入的时间随着元素的增加而增加 # 占用空间小 names = ['Tom', 'Jim', 'Kate'] print(names) print(names[0]) print(names[0:2]) print(names[:2]) print(names[:]) # 更改 names[0] = 'Tomas' print(names) # 添加 names.append('Lily') print(names) # 删除 del names[0] print(names) # 运算符 print(le...
S = { 'b' : 'boxes?q=' } D = { 'bI' : 'boxId', 'bN' : 'boxName', 'iMB' : 'isMasterBox', 'cI' : 'categoryId', 'cN' : 'categoryName', 'cFN' : 'categoryFriendlyName', 'sCI' : 'superCatId', 'sCN' : 'superCatName', 'sCFN' : 'superCatFriendlyNam...
# -*- coding: utf-8 -*- description = 'system setup' group = 'lowlevel' sysconfig = dict( cache = 'spodictrl.spodi.frm2', instrument = 'Spodi', experiment = 'Exp', datasinks = ['conssink', 'filesink', 'daemonsink', 'spodilivesink', 'spodisink', ], notifiers = ['email', 'smser'], ) mo...
{ 'targets': [ { 'target_name': '<(module_name)', 'sources': [ 'src/node_libcurl.cc', 'src/Easy.cc', 'src/Share.cc', 'src/Multi.cc', 'src/Curl.cc', 'src/CurlHttpPost.cc' ], ...
#!/usr/bin/python # substrings2.py a = "I saw a wolf in the forest. A lone wolf." print (a.index("wolf")) print (a.rindex("wolf")) try: print (a.rindex("fox")) except ValueError as e: print ("Could not find substring")