python'没有名为gTTS的模块'在pycharm

时间:2017-08-19 06:13:39

标签: module pycharm

我正在使用gTTS模块,但我收到一个错误,它是

  

文件" C:/ Users / SeongWoo Min / Desktop / KOI_Programming   Files / NewGUIAccidentAlarm#.py",第6行,in       import gTTS ImportError:没有名为' gTTS'

的模块

但我已经把模块放到了项目中。

看看这个:

enter image description here

1 个答案:

答案 0 :(得分:0)

您无法直接导入//Tristan Shepherd #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> struct node { int num; struct node *next; }; struct tree { int numt; struct tree *left; struct tree *right; }; typedef struct node LINK; typedef struct tree branch; int searchList(int number, LINK *head) { LINK *current; current = head; while (current != NULL) { if (current->num == number) return 1; // Found it. current = current->next; } return 0; // Did not find it. } LINK *insertList(int number, LINK *head) { LINK *current, *temp; if (searchList(number, head) == 1) return head; temp = (LINK *)malloc(sizeof(LINK)); temp->num = number; if (head == NULL) { head = temp; temp->next = NULL; return head; } current = head; if (current->num == number) { temp->next = current; head = temp; return head; } current = head; while (current != NULL) { if (current->next == NULL || current->next->num == number) { temp->next = current->next; current->next = temp; return head; } current = current->next; } } void printList(LINK *head) { LINK *current; current = head; while (current != NULL) { printf("%i\n", current->num); current = current->next; } } LINK *freeList(LINK *head) { LINK *current, *temp; current = head; while (current != NULL) { temp = current; current = current->next; free(temp); } free(head); head = NULL; return head; } void freeTree(branch *leaf) { if(leaf != 0) { freeTree(leaf->left); freeTree(leaf->right); free(leaf); } } void insert(int new, branch **leaf) { if(*leaf == 0) { *leaf = (struct tree*) malloc(sizeof(struct tree)); (*leaf)->numt = new; (*leaf)->left = 0; (*leaf)->right = 0; } else if(new < (*leaf)->numt) { insert(new, &(*leaf)->left); } else if(new > (*leaf)->numt) { insert(new, &(*leaf)->right); } } void printInorder(branch *leaf) { if (leaf == NULL) return; printInorder(leaf->left); printf("%i ", leaf->numt); printInorder(leaf->right); } void printPreorder(branch *leaf) { if (leaf == NULL) return; printf("%i ", leaf->numt); printInorder(leaf->left); printInorder(leaf->right); } void printPostorder(branch *leaf) { if (leaf == NULL) return; printInorder(leaf->left); printInorder(leaf->right); printf("%i ", leaf->numt); } int main (void) { int t; FILE *stream = fopen("hw9.data", "r"); LINK *head; branch *leaf; head = NULL; int number; while (1) { fscanf(stream, "%i", &number); if (feof(stream)) break; insert(number, &leaf); head = insertList(number, head); } fclose(stream); printf("\nPrinting List: \n"); printList(head); printf("\n\nPrinting in order\n"); printInorder(leaf); printf("\n\nPrinting Pre order\n"); printPreorder(leaf); printf("\n\nPrinting Post order\n"); printPostorder(leaf); head = freeList(head); freeTree(leaf); head = NULL; return 0; }

请写如下:

gTTS