Package Gttts Python 3.7

Someone can help me with python?I installed the package G.t.t.s in python 3.7 but it dont work and I dont know why.Can someone help me to fix it?

This is my code:

from gtts import gTTS
import os
f = open("c:\temp\test.txt","r")
lines = f.readlines()
f.close()                          
tts = gTTS(text=str(lines),lang='en-uk')
tts.save("test.mp3")
os.system("start test.mp3")

And this is my error:

Traceback (most recent call last):
File "C:/Python 3.7/Pythontest.py", line 7, in 
tts.save("test.mp3")
File "C:Python 3.7libsite-packagesgttstts.py", line 247, in save
self.write_to_fp(f)
File "C:Python 3.7libsite-packagesgttstts.py", line 187, in write_to_fp
part_tk = self.token.calculate_token(part)
File "C:Python 3.7libsite-packagesgtts_tokengtts_token.py", line 28, in 
calculate_token
seed = self._get_token_key()
File "C:Python 3.7libsite-packagesgtts_tokengtts_token.py", line 62, in 
_get_token_key
a = re.search("a\\x3d(-?d+);", tkk_expr).group(1)
AttributeError: 'NoneType' object has no attribute 'group'

Wilcoxon Signed Rank Test in Python (Reporting Seigel’s T vs W?)

While using the Wilcoxon signed rank test in scypy over a subset of populations, I noticed that my test score was reported as zero for an array of differences whose distribution of medians is heavily skewed positive (n=2500, with sign function large and positive). I then noticed that scypy seems to be reporting Siegel’s T for the test statistic, and not W-per their documentation.

I’ve been trying to find some documentation on how Siegel’s T is defined so I can approximate W and determine if my paired medians over each population are significantly different in either direction, but outside of Wikipedia have been unable to find a mention, let alone a derivation. Could someone help me ‘convert’ between the two? Thanks!

How to write the data back into SAP HANA Cloud when using Python

I can connect to the HANA Cloud using the code below and execute successfully:

 # Connecting to the Database and without the Column Name
 connection = pyhdb.connect('localhost', 30111, 'RRR', 'PsW')
 cursor = connection.cursor()
 cursor.execute("""
            SELECT * FROM PAL.VEGETARIAN_PREDICTION
                     """)
  # ab = cursor.fetchall()
  data = pd.DataFrame(cursor.fetchall())

Now I got the dataframe, but how can I input the data back to the HANA Cloud Platform? Any coding can provide? Thanks.

Recommended folder structure for managing Python libraries and ArcGIS/ArcPy [on hold]

I’m writing scripts in Python, and some of them I am turning into “tools” in ArcGIS to pass along to others on my team that don’t use Python or any coding.

My questions are:

  1. What is the best structure for my “C:Python27” folder for handling ArcGIS and any additional libraries (e.g., GDAL)… should I put all add-on libraries in a separate folder (e.g., “C:Python27OtherLibs”) instead of the “C:Python27]ArcGIS10.6”?
  2. Should everyone else on my team have the same folder structure I do to ensure they can run the script tools?

Change the resolution and size of a raster with GDAL in Python

I am quite new to GDAL and Python but want to use it to create groundwater models in FloPy.

I have a raster with rivers (roughly drawn) and a DEM raster. The resolution of the river-raster is higher than that of the DEM. Thereby the river-raster only covers a part of the total area of the DEM-map:

raster with roughly the rivers and the DEM in the back

What I want is the following:
1) Apply the resolution of the DEM to the river-raster
2) Extend the river-raster so it has the same extent as the DEM by filling it with no-data values within the boundaries of the DEM.

In QGIS it works easily by saving the river raster with a different extent and resolution but since I want to do this for whole batches it would be nice if I learn how to do this with GDAL in Python.

Python Необходимо чтобы в секунду цикл выполнялся не более 20…

Необходимо чтобы в секунду цикл выполнялся не более 20 раз. Как можно этого добиться?

Wilcoxin-Sign Rank Test Python (Reporting Seigal’s T vs W?)

while using the Wilcoxin Signed rank test in scypy over a subset of populations, I noticed that my test score was reported as zero for an array of differences whose distribution of medians is heavily skewed positive (n=2500, with sign function large and positive). I then noticed that scypy seems to be reporting siegal’s t for the test statistic, and not W-per their documentation.

I’ve been trying to find some documentation on how siegal’s T is defined so I can approximate w and determine if my paired medians over each population are significantly different in either direction, but outside of wikipedia have been unable to find derivation-let alone mention. Could someone help me ‘convert’ between the two? Thanks!

What are the tools to analyze Python (obfuscated) bytecode?

Recently on Reddit ReverseEngineering I stumbled on a self-modifying code in Python. Looking at the Github repository was quite instructive and I found picture of the Python bytecode program exposed in CFG form:

enter image description here

I am wondering if there are tools to perform static analysis on Python bytecode program with some nice features (such as generating the CFG or allowing to manipulate the code, …) ?