What IDE for Python on M1 Mac
Dear fellow programmers,
I am trying to implement this repository to experiment around. Unfortunately I am not able to get anything running as it throws several errors differing from IDE to IDE.
To exclude incompatibility issues with different IDE's and M1 Mac, I am interested in your opinion of the "way to go" setup for python code.
Thanks in advance :)
do you know?
how many words do you know
See also questions close to this topic
-
Python File Tagging System does not retrieve nested dictionaries in dictionary
I am building a file tagging system using Python. The idea is simple. Given a directory of files (and files within subdirectories), I want to filter them out using a filter input and tag those files with a word or a phrase.
If I got the following contents in my current directory:
data/ budget.xls world_building_budget.txt a.txt b.exe hello_world.dat world_builder.spec
and I execute the following command in the shell:
py -3 tag_tool.py -filter=world -tag="World-Building Tool"
My output will be:
These files were tagged with "World-Building Tool": data/ world_building_budget.txt hello_world.dat world_builder.spec
My current output isn't exactly like this but basically, I am converting all files and files within subdirectories into a single dictionary like this:
def fs_tree_to_dict(path_): file_token = '' for root, dirs, files in os.walk(path_): tree = {d: fs_tree_to_dict(os.path.join(root, d)) for d in dirs} tree.update({f: file_token for f in files}) return tree
Right now, my dictionary looks like this:
key:''
.In the following function, I am turning the empty values
''
into empty lists (to hold my tags):def empty_str_to_list(d): for k,v in d.items(): if v == '': d[k] = [] elif isinstance(v, dict): empty_str_to_list(v)
When I run my entire code, this is my output:
hello_world.dat ['World-Building Tool'] world_builder.spec ['World-Building Tool']
But it does not see
data/world_building_budget.txt
. This is the full dictionary:{'data': {'world_building_budget.txt': []}, 'a.txt': [], 'hello_world.dat': [], 'b.exe': [], 'world_builder.spec': []}
This is my full code:
import os, argparse def fs_tree_to_dict(path_): file_token = '' for root, dirs, files in os.walk(path_): tree = {d: fs_tree_to_dict(os.path.join(root, d)) for d in dirs} tree.update({f: file_token for f in files}) return tree def empty_str_to_list(d): for k, v in d.items(): if v == '': d[k] = [] elif isinstance(v, dict): empty_str_to_list(v) parser = argparse.ArgumentParser(description="Just an example", formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument("--filter", action="store", help="keyword to filter files") parser.add_argument("--tag", action="store", help="a tag phrase to attach to a file") parser.add_argument("--get_tagged", action="store", help="retrieve files matching an existing tag") args = parser.parse_args() filter = args.filter tag = args.tag get_tagged = args.get_tagged current_dir = os.getcwd() files_dict = fs_tree_to_dict(current_dir) empty_str_to_list(files_dict) for k, v in files_dict.items(): if filter in k: if v == []: v.append(tag) print(k, v) elif isinstance(v, dict): empty_str_to_list(v) if get_tagged in v: print(k, v)
-
Actaully i am working on a project and in it, it is showing no module name pip_internal plz help me for the same. I am using pycharm(conda interpreter
File "C:\Users\pjain\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\pjain\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\pjain\AppData\Local\Programs\Python\Python310\Scripts\pip.exe\__main__.py", line 4, in <module> File "C:\Users\pjain\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\__init__.py", line 4, in <module> from pip_internal.utils import _log
I am using pycharm with conda interpreter.
-
Looping the function if the input is not string
I'm new to python (first of all) I have a homework to do a function about checking if an item exists in a dictionary or not.
inventory = {"apple" : 50, "orange" : 50, "pineapple" : 70, "strawberry" : 30} def check_item(): x = input("Enter the fruit's name: ") if not x.isalpha(): print("Error! You need to type the name of the fruit") elif x in inventory: print("Fruit found:", x) print("Inventory available:", inventory[x],"KG") else: print("Fruit not found") check_item()
I want the function to loop again only if the input written is not string. I've tried to type return Under print("Error! You need to type the name of the fruit") but didn't work. Help
- Broken project in XCODE objective c
-
Can I use Xcode font on QtCreator?
After using QtCreator for a long time on Windows I was comfortable with it. But now I'm using it on macOS too and it feels different.
I noticed default font is different on macOS. And Xcode font perhaps looks better.
How can I use Xcode font on QtCreator on macOS?
-
OSX + Java + OpenSSL + org.apache.commons:commons-crypto = SegFault in OpenSslNative:initIDs
I had a simple Java class using Apache:commons-crypto to do encryption/decryption that was SegFaulting on me.
On OSX, I used Homebrew to install the latest OpenSSL to use.
Tracing down the issue, it occurred in the OpenSslNative:initIDs JNI linked native code somewhere. I found the c code here:
https://github.com/apache/commons-crypto/blob/master/src/main/native/org/apache/commons/crypto/cipher/OpenSslNative.c
https://github.com/apache/commons-crypto/blob/master/lib/include/config.h
Scanning through the code, I found that on OSX, the "libcrypto.dylib" is referenced. That library was correctly linked into the /usr/local/opt/openssl/lib directory.
-
Is there a word for obsessive IDE configuration?
This is a bit of a humor question. I hope it doesn't get downvoted for that...
But I'm also serious.
You know when you spend so much time bringing your IDE to the very pinnacle of efficiency and perfection that your actual work-delivery suffers?
I used to love emacs, but the ratio of tweaking-and-twiddling the IDE itself to the actual efficiency gains has diminished into negative territory. But even a simple IDE such as Sublime... I can spend a day fiddling with my syntax coloring because that magenta on the variable names clashes with the evergreen color of reserved words.
I know we could just call it "procrastination" -- but maybe there's a better one? (I have writer friends, who use the phrase: "vacuuming the cat.")
Is there a solid tech word or phrase that describes this phenomenon?
Or am I alone in this?
-
what is the bset IDE and course or book for jakartaEE and spring?
I am new to spring5 and I saw that in order to learn spring well, first, it is better to learn a little JEE and become more familiar with its basics, so I have two questions:
- First, what is the best idea for both spring and JakartaEE? Is it eclipse? Because I have seen many places that use eclipse, especially for JEE.
- Secondly, what is the best book and the best course for spring and JEE? That is, separately for each.
-
Issues connecting SQLedge to asp.net projects on m1 mac
Back Story:
So I've been recently developing some c# sharp projects using a m1 Mac and a sql image (sqledge) hosted in a docker container. When trying to connect using entity framework to the container I get the results below. NB. I am able to connect to the container using azure data factory and I have enabled remote connections on the server.
Connection String used:
"DefaultConnection": "Server=(localhost);Database=aspnet-Webapplogin-40736292-40D4-4306-A965-8CCBFEEE3176;User Id= sa; Password=password;Trusted_Connection=True;MultipleActiveResultSets=true;"
dotnet ef database update: returns the Following
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 35 - An internal exception was caught)
-
SQLAlchemy on Apple Mac M1
What's the recommended way to access Microsoft SQL Server on an Apple Mac M1 using python in a jupyter notebook?
pymssql works ok, but sql.io complains about its preference for SQLAlchemy
bcpy works ok
pyodbc.drivers is empty
SQLAlchemy does not seem to work
No doubt paths are mucked up here. Has anyone worked out the solution?