Running .py files in MAMP - python

I'm using leaflet with omnivoire to display maps online.
As part of this I have three python files that take .gpx satnav data and turn it into co-ordinantes and markers for my leaflet map.
The problem seems to that the three files export.py, gpxplot.py and gpxplot.pyc aren't being parsed by MAMP.
If I change the file suffix to cgi then the .py files work, but what do I do about the .pyc file?

Related

how to read multiple wav files in python?

I want to read multiple wav files in a loop rather than reading every single one at one time
for, using os library, as I try to read files with this code I get error of file not found
The files are in different sub folder inside the main folder refer (GTZAN Dataset)
eg:
r = wav.read(directory+folder+r"\\"+file)
Since I've used OS library for pathing in this project, would like the answer in OS pathing format rather than regular pathing .
Note: I've declared directory in my code, it contains the original path in which a specific folder contains multiple wav files
I am able to get the folders and list them and also list the wav files in the subfolder but at the end not able to read them
The above code is the only I've tried since am using OS library pathing format.
I am able to get the folders and list them and also list the wav files in the subfolder but at the end not able to read them

Editing a file with non .txt extension from python

I am trying to read a file with the extension .wbjn (ANSYS Workbench journal file) with basically contains python code per se, from python and change some information in it. But python does not recognize the .wbjn file, so I had to rename the .wbjn to .txt and make the changes.
But the problem with this approach is that when I trying to save the .txt extension back to .wbjn, the contents of the file is erased.
How do I do this in a better way ? Is there a library to read files with such extensions or is there another logic to solve this problem ?

why is desktop.ini file created?

I made a program using tkinter (GUI module). basically it is a banking system that stores data in text files. I found that a desktop.ini file was created in that folder. why so? Is it harmful if I delete the file?
[.ShellClassInfo]
IconResource=C:\WINDOWS\System32\SHELL32.dll,27
[ViewState]
Mode=
Vid=
FolderType=Generic
👆 this is what is there in that file.
it's a windows config file and is not harmful or a vulnerability
According to https://answers.microsoft.com/en-us/windows/forum/all/there-are-these-random-desktopini-files-appearing/5bb923f5-6b06-4e07-a79e-a16c8bfc844a
You should not delete them.
A Desktop.ini file is a file that determines the way a folder is displayed by Windows. These files can be found in any folder, anywhere on your computer, as long as that folder has a custom appearance set for it. Desktop.ini files control things like the icon used for that folder and its localized name.
Deleting them will always regenerate them anyway. If you don't want to see them, turn off show hidden files and folders in File Explorer > View tab > uncheck hidden files.

How to include data files and directories that need to be changed or added with Pyinstaller?

The script needs to read from a .txt file with a list of items and based off that list, it creates a directory for each item. So just a simple with open() statement and then os.mkdir()..
The client will add account names to the txt file when they get new accounts, the program will create new directories for those new accounts. Files that are then placed in each directory for those accounts will get pandas stuff done to them and moved to an archive folder along with logging the events.
Since the program will be used by non-programmers, I'm using Pyinstaller.
When I go through the process, including the --add-file attribute, run the program, it says the txt file doesn't exist. I think I have an idea how to fix that but when I got the os.mkdir and with open statements to work by separating them out, it created them in the home folder and not the program folder. Path issue? And I only see documentation on how to include data files but not how to include changeable files.

Writing to XML files in Excel 2010 corrupts files

The project I'm working on requires that I programmatically change a .xlsx file to a .zip file, extract all of the files, then make alterations to the underlying XML that makes up an excel spreadsheet. However, I've found that whenever I attempt to write to the file that requires changes, the spreadsheet becomes corrupted once I re-zip the files and changes the extension back to .xlsx. I should note that if I manually change values within the xml files (for example, changing the name of "sheet1" to "test", there are no problems, but I need to do this using python if possible, so that isn't an option.
Does excel have some sort of checksum/integrity verifier that causes corruption when significant changes are made? If so, what does it look for and is there a way to get around it?
I'm using Windows 7 - 64 bit.

Categories

Resources