How do i import an image in pygame on mac? [closed] - python

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed last year.
Improve this question
So im trying to load an image with pygame but i don't know exactly what its supposed to look and all the examples I've seen are from people on windows and the ones on mac don't seem to help.
This is what I'm currently trying but it doesn't work and says there is no such file or directory as this.
sky_surface = pygame.image.load('/Macintosh HD/Users/Amin/Desktop/Sky.png').convert()
I do have an image called 'Sky.png' on my desktop.
screenshot of image directory as shown in finder

Actually, Macintosh HD should not be a part of the pathname -- the correct path should be, in your case here, /Users/Amin/Desktop/Sky.png.
MacOS (I'm on Monterey now) should have a feature to copy a pathname of a file. In Finder you may right-click on a file to get the context menu and then press option key. You should see the Copy ... as Pathname entry. This will copy the valid pathname to your clipboard -- and as you'll see, it won't contain Macintosh HD prefix.

Related

Encoding a hyperlink in CSV formatted file doesn't work [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 months ago.
Improve this question
The problem is here;
f'=HYPERLINK("http://{os.getenv("OPTION_HOST_IP")}:8000/test/opt?sec={final_list[1]}&st={summary_row[4]}&exp={summary_row[1]}&cp={final_list[6]}", "Daily")'
This just returns text in LibreOffice.
What should I do?
The other article told me to use double quotes, but that doesn't work for me either.
The cell in LibreOffice has this even though this is the correct format this is not an instant hyperlink. I still need to double click and then LibreOffice understood this is a hyperlink
=HYPERLINK("http://IP/test/opt?sec=C&str=290.0&exp=2006-08-25&cp=C", "Daily")
When opening your csv in Libre Office, in the text import pop up that shows up, you should check "Evaluate formulas" option.

File not found but file exist in directory [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
I am trying to run the following code on ubuntu but getting file not found error. But same code is working fine on my windows machine
...
for elem in items['stats']:
f = open(r"\root\bot_python\list.txt", "r+")
...
Because the path separator is different between Ubuntu and Windows. See Path separator for Windows and Unix and separator for both Linux and Windows. For python, you could use os.path.join to parse your file path before reading it. Btw, pathlib is also a good option if you're familiar with some object-oriented concepts.
You should use double back slash instead of single. Like this:
...
for elem in items['stats']:
f = open(r"\\root\\bot_python\\list.txt", "r+")
...
I think you need root permission to access the file see you are trying to access a file inside root directory...
Try Running the python script with "sudo python file_name.py"
Maybe it solves your issue.
And use backward slashes for spaces whenever possible.

Are all the dependencies available in this tiny compiler written in python to get this to work [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
https://github.com/AZHenley/teenytinycompiler.git
Can you get this to run I got it from this website:
http://web.eecs.utk.edu/~azh/blog/teenytinycompiler1.html
I followed this tutorial and it failed to load the source file.
I am new to python.
this is a screenshot of when I ran the python project
You never pass in the source file. The command you have now only starts the TeenyTiny compiler. You can pass in the source file as follows.
"C:/Users/Ackeem/AppData/Local/Programs/Python/Python39/python.exe" "C:/Users/Ackeem/Desktop/teenyTIny Compiler/teenytinycompiler/part2/teenytiny.py" "C:/Users/Ackeem/Desktop/teenyTIny Compiler/teenytinycompiler/part2/hello.tiny"
Your code did run but there were no parameters passed to it.
sys.argv is the object that holds parameters being passed.

Python (Pycharm): [Errno 2] No such file or directory [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 5 years ago.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Improve this question
I'm pretty new to Python and I'm trying to read a CSV file with Pandas. However I get the following error:
C:\Python\python.exe "C:/Users/Niels Hoogeveen/PycharmProjects/HelloWorld/HelloWorld.py"
C:\Python\python.exe: can't open file 'C:/Users/Niels Hoogeveen/PycharmProjects/HelloWorld/HelloWorld.py': [Errno 2] No such file or directory
I tried the absolute path, but I get the same error time and time again.
See the screenshot below.
What do I need to do?
screenshot of my code and error
Your file is called test.py instead of HelloWorld.py
By the way, it's possible that '/' must be replaced by '\'
Your Python file's name is not HelloWorld.py, it is test.py. :) Just change the name in the PyCharm terminal and it should start to work.

iPython notebook not loading [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
So my iPython notebook comes up in my browser (chrome) and when I open my specific notebook a new tab opens. However the work does not load up! The page also freezes. Is this an iPython issue or something wrong with the file? Was working yesterday. I've restared comp etc. but no luck
Update: just tried renaming notebook to open again with no luck
Update 2: One has now shown up - but can't do anything with it! Is iPython simply extremely extremely slow...
Is it possible that one of the cells got a lot of output data?
if so,
try editing the file manually (with notepad++ or something like this), and delete cell's output

Categories

Resources