Custom interpreter /u/Orbi_Adam Python Education

Custom interpreter /u/Orbi_Adam Python Education

I want to write a minimalistic version of the python interpreter for my os project

submitted by /u/Orbi_Adam
[link] [comments]

​r/learnpython I want to write a minimalistic version of the python interpreter for my os project submitted by /u/Orbi_Adam [link] [comments] 

I want to write a minimalistic version of the python interpreter for my os project

submitted by /u/Orbi_Adam
[link] [comments]  I want to write a minimalistic version of the python interpreter for my os project submitted by /u/Orbi_Adam [link] [comments]

Read more

Please help me i don’t understand how to solve this without elif function /u/Disastrous-Jello1992 Python Education

Please help me i don’t understand how to solve this without elif function /u/Disastrous-Jello1992 Python Education

Please fix the program so that there is always either a 10 % or a 15 % bonus, but never both.

# Fix the program points = int(input("How many points are on your card? ")) if points < 100: points *= 1.1 print("Your bonus is 10 %") if points >= 100: points *= 1.15 print("Your bonus is 15 %") print("You now have", points, "points") 

I want to know how to solve this just by using if statement and no elif or other advanced stuff

submitted by /u/Disastrous-Jello1992
[link] [comments]

​r/learnpython Please fix the program so that there is always either a 10 % or a 15 % bonus, but never both. # Fix the program points = int(input(“How many points are on your card? “)) if points < 100: points *= 1.1 print(“Your bonus is 10 %”) if points >= 100: points *= 1.15 print(“Your bonus is 15 %”) print(“You now have”, points, “points”) I want to know how to solve this just by using if statement and no elif or other advanced stuff submitted by /u/Disastrous-Jello1992 [link] [comments] 

Please fix the program so that there is always either a 10 % or a 15 % bonus, but never both.

# Fix the program points = int(input("How many points are on your card? ")) if points < 100: points *= 1.1 print("Your bonus is 10 %") if points >= 100: points *= 1.15 print("Your bonus is 15 %") print("You now have", points, "points") 

I want to know how to solve this just by using if statement and no elif or other advanced stuff

submitted by /u/Disastrous-Jello1992
[link] [comments]  Please fix the program so that there is always either a 10 % or a 15 % bonus, but never both. # Fix the program points = int(input(“How many points are on your card? “)) if points < 100: points *= 1.1 print(“Your bonus is 10 %”) if points >= 100: points *= 1.15 print(“Your bonus is 15 %”) print(“You now have”, points, “points”) I want to know how to solve this just by using if statement and no elif or other advanced stuff submitted by /u/Disastrous-Jello1992 [link] [comments]

Read more

Linux When to have pip install global packages if at all? /u/Ajax_Minor Python Education

Linux When to have pip install global packages if at all? /u/Ajax_Minor Python Education

So I was told you should always use a virtual environment when working with python. After I saw that linux will use python it made sense as installing python packages or modify that python could change how your system operates. Are there any acceptations to this rule?

Just starting some new projects and setting up the virtual environments, it would be nice to have the tools like poetry and uv to help that setup process. PIP also has an update. This stuff shouldn’t effect the system but to be safe I have have touched the global environment at all. Is that the best way to do it?

Should there be other considerations for things like g++ and cargo when working on my Linux system?

submitted by /u/Ajax_Minor
[link] [comments]

​r/learnpython So I was told you should always use a virtual environment when working with python. After I saw that linux will use python it made sense as installing python packages or modify that python could change how your system operates. Are there any acceptations to this rule? Just starting some new projects and setting up the virtual environments, it would be nice to have the tools like poetry and uv to help that setup process. PIP also has an update. This stuff shouldn’t effect the system but to be safe I have have touched the global environment at all. Is that the best way to do it? Should there be other considerations for things like g++ and cargo when working on my Linux system? submitted by /u/Ajax_Minor [link] [comments] 

So I was told you should always use a virtual environment when working with python. After I saw that linux will use python it made sense as installing python packages or modify that python could change how your system operates. Are there any acceptations to this rule?

Just starting some new projects and setting up the virtual environments, it would be nice to have the tools like poetry and uv to help that setup process. PIP also has an update. This stuff shouldn’t effect the system but to be safe I have have touched the global environment at all. Is that the best way to do it?

Should there be other considerations for things like g++ and cargo when working on my Linux system?

submitted by /u/Ajax_Minor
[link] [comments]  So I was told you should always use a virtual environment when working with python. After I saw that linux will use python it made sense as installing python packages or modify that python could change how your system operates. Are there any acceptations to this rule? Just starting some new projects and setting up the virtual environments, it would be nice to have the tools like poetry and uv to help that setup process. PIP also has an update. This stuff shouldn’t effect the system but to be safe I have have touched the global environment at all. Is that the best way to do it? Should there be other considerations for things like g++ and cargo when working on my Linux system? submitted by /u/Ajax_Minor [link] [comments]

Read more

Sufficient space so why values of price_usd column showing as Ellipsis? /u/DigitalSplendid Python Education

Sufficient space so why values of price_usd column showing as Ellipsis? /u/DigitalSplendid Python Education

https://www.canva.com/design/DAGaj7yYbTk/LaB28KM466c5mM54QGYCAg/edit?utm_content=DAGaj7yYbTk&utm_campaign=designshare&utm_medium=link2&utm_source=sharebutton

Working with Pandas library, if Ellipsis as a value shows up under a column of a dataframe, one of the reasons could be lack of space to display? If so, why even during displaying as a single column, it shows Ellipsis for all the values under price_usd column? How to troubleshoot? Using Jupyter notebook.

Thanks!

submitted by /u/DigitalSplendid
[link] [comments]

​r/learnpython https://www.canva.com/design/DAGaj7yYbTk/LaB28KM466c5mM54QGYCAg/edit?utm_content=DAGaj7yYbTk&utm_campaign=designshare&utm_medium=link2&utm_source=sharebutton Working with Pandas library, if Ellipsis as a value shows up under a column of a dataframe, one of the reasons could be lack of space to display? If so, why even during displaying as a single column, it shows Ellipsis for all the values under price_usd column? How to troubleshoot? Using Jupyter notebook. Thanks! submitted by /u/DigitalSplendid [link] [comments] 

https://www.canva.com/design/DAGaj7yYbTk/LaB28KM466c5mM54QGYCAg/edit?utm_content=DAGaj7yYbTk&utm_campaign=designshare&utm_medium=link2&utm_source=sharebutton

Working with Pandas library, if Ellipsis as a value shows up under a column of a dataframe, one of the reasons could be lack of space to display? If so, why even during displaying as a single column, it shows Ellipsis for all the values under price_usd column? How to troubleshoot? Using Jupyter notebook.

Thanks!

submitted by /u/DigitalSplendid
[link] [comments]  https://www.canva.com/design/DAGaj7yYbTk/LaB28KM466c5mM54QGYCAg/edit?utm_content=DAGaj7yYbTk&utm_campaign=designshare&utm_medium=link2&utm_source=sharebutton Working with Pandas library, if Ellipsis as a value shows up under a column of a dataframe, one of the reasons could be lack of space to display? If so, why even during displaying as a single column, it shows Ellipsis for all the values under price_usd column? How to troubleshoot? Using Jupyter notebook. Thanks! submitted by /u/DigitalSplendid [link] [comments]

Read more

Unable to open files with spaces in between /u/Plastic_Ad_7733 Python Education

Unable to open files with spaces in between /u/Plastic_Ad_7733 Python Education

I was trying to learn the Image library and wanted to setup a function which checks if the path is valid because why not, and I found that I can’t open files if the folders have a space in the name, for example, "E:New foldermovie.png". I wonder if I was doing something wrong or is it just impossible to open a file with spaces in the name.

This is the code I used

def file_path_check(): path = input("Enter file path: ") os.startfile((path)) 

and the error I receive when I use the above file path

Enter file path: "E:New foldermovie.png" Traceback (most recent call last): File "E:vscode_projectspython_projectsfile.py", line 4, in <module> os.startfile((path)) ~~~~~~~~~~~~^^^^^^^^ FileNotFoundError: [WinError 2] The system cannot find the file specified: '"E:\New folder\movie.png"' 

submitted by /u/Plastic_Ad_7733
[link] [comments]

​r/learnpython I was trying to learn the Image library and wanted to setup a function which checks if the path is valid because why not, and I found that I can’t open files if the folders have a space in the name, for example, “E:New foldermovie.png”. I wonder if I was doing something wrong or is it just impossible to open a file with spaces in the name. This is the code I used def file_path_check(): path = input(“Enter file path: “) os.startfile((path)) and the error I receive when I use the above file path Enter file path: “E:New foldermovie.png” Traceback (most recent call last): File “E:vscode_projectspython_projectsfile.py”, line 4, in <module> os.startfile((path)) ~~~~~~~~~~~~^^^^^^^^ FileNotFoundError: [WinError 2] The system cannot find the file specified: ‘”E:\New folder\movie.png”‘ submitted by /u/Plastic_Ad_7733 [link] [comments] 

I was trying to learn the Image library and wanted to setup a function which checks if the path is valid because why not, and I found that I can’t open files if the folders have a space in the name, for example, "E:New foldermovie.png". I wonder if I was doing something wrong or is it just impossible to open a file with spaces in the name.

This is the code I used

def file_path_check(): path = input("Enter file path: ") os.startfile((path)) 

and the error I receive when I use the above file path

Enter file path: "E:New foldermovie.png" Traceback (most recent call last): File "E:vscode_projectspython_projectsfile.py", line 4, in <module> os.startfile((path)) ~~~~~~~~~~~~^^^^^^^^ FileNotFoundError: [WinError 2] The system cannot find the file specified: '"E:\New folder\movie.png"' 

submitted by /u/Plastic_Ad_7733
[link] [comments]  I was trying to learn the Image library and wanted to setup a function which checks if the path is valid because why not, and I found that I can’t open files if the folders have a space in the name, for example, “E:New foldermovie.png”. I wonder if I was doing something wrong or is it just impossible to open a file with spaces in the name. This is the code I used def file_path_check(): path = input(“Enter file path: “) os.startfile((path)) and the error I receive when I use the above file path Enter file path: “E:New foldermovie.png” Traceback (most recent call last): File “E:vscode_projectspython_projectsfile.py”, line 4, in <module> os.startfile((path)) ~~~~~~~~~~~~^^^^^^^^ FileNotFoundError: [WinError 2] The system cannot find the file specified: ‘”E:\New folder\movie.png”‘ submitted by /u/Plastic_Ad_7733 [link] [comments]

Read more

Any advice on how to install PIP into a windows system? /u/MiracleNamedHope Python Education

Any advice on how to install PIP into a windows system? /u/MiracleNamedHope Python Education

I’m using the IDLE Shell downloaded from Python.org version 3.13.1 (which is most recent version of the IDLE Shell available for download from this site). I’ve been trying to install Pip for a few hours, and I can’t believe how stuck I am.

W3 Schools recommends us to https://pypi.org/project/pip/

From here we are routed to install PIP at https://pip.pypa.io/en/stable/installation/

And this is where things start to go off the rails. While this ultimately seems to be the same site I got the IDLE Shell from (or some localized project within that Python.org site), now they seem to be wanting me to just ignore the IDLE Shell environment that I got from them altogether. And now they seem to be wanting me to just run Python on my Windows PowerShell, where it seems it wants me to run:

C:> py -m ensurepip --upgrade

Are they telling me to get out of the IDLE Shell and install PIP by just plugging that code into the Windows command line? And when I do this, it tells me: Requirement already satisfied: pip in c:

Ok great, But I want PIP in the IDLE, not the Windows PowerShell.

And in addition to all of this, I have read pages on “bootstrapping”, which take me here: https://bootstrap.pypa.io/get-pip.py

So I’m just dizzy and blown away by my inability to understand this process. I am sorry if I’m asking a stupid question, and I did spend some considerable time before bothering the community. But not being able to get my bearings, I humbly ask if anyone has any insights or pointers on why I can’t achieve this understanding and execute the process. Thank you for your time in reading and any time in responding.

submitted by /u/MiracleNamedHope
[link] [comments]

​r/learnpython I’m using the IDLE Shell downloaded from Python.org version 3.13.1 (which is most recent version of the IDLE Shell available for download from this site). I’ve been trying to install Pip for a few hours, and I can’t believe how stuck I am. W3 Schools recommends us to https://pypi.org/project/pip/ From here we are routed to install PIP at https://pip.pypa.io/en/stable/installation/ And this is where things start to go off the rails. While this ultimately seems to be the same site I got the IDLE Shell from (or some localized project within that Python.org site), now they seem to be wanting me to just ignore the IDLE Shell environment that I got from them altogether. And now they seem to be wanting me to just run Python on my Windows PowerShell, where it seems it wants me to run: C:> py -m ensurepip –upgrade Are they telling me to get out of the IDLE Shell and install PIP by just plugging that code into the Windows command line? And when I do this, it tells me: Requirement already satisfied: pip in c: Ok great, But I want PIP in the IDLE, not the Windows PowerShell. And in addition to all of this, I have read pages on “bootstrapping”, which take me here: https://bootstrap.pypa.io/get-pip.py So I’m just dizzy and blown away by my inability to understand this process. I am sorry if I’m asking a stupid question, and I did spend some considerable time before bothering the community. But not being able to get my bearings, I humbly ask if anyone has any insights or pointers on why I can’t achieve this understanding and execute the process. Thank you for your time in reading and any time in responding. submitted by /u/MiracleNamedHope [link] [comments] 

I’m using the IDLE Shell downloaded from Python.org version 3.13.1 (which is most recent version of the IDLE Shell available for download from this site). I’ve been trying to install Pip for a few hours, and I can’t believe how stuck I am.

W3 Schools recommends us to https://pypi.org/project/pip/

From here we are routed to install PIP at https://pip.pypa.io/en/stable/installation/

And this is where things start to go off the rails. While this ultimately seems to be the same site I got the IDLE Shell from (or some localized project within that Python.org site), now they seem to be wanting me to just ignore the IDLE Shell environment that I got from them altogether. And now they seem to be wanting me to just run Python on my Windows PowerShell, where it seems it wants me to run:

C:> py -m ensurepip --upgrade

Are they telling me to get out of the IDLE Shell and install PIP by just plugging that code into the Windows command line? And when I do this, it tells me: Requirement already satisfied: pip in c:

Ok great, But I want PIP in the IDLE, not the Windows PowerShell.

And in addition to all of this, I have read pages on “bootstrapping”, which take me here: https://bootstrap.pypa.io/get-pip.py

So I’m just dizzy and blown away by my inability to understand this process. I am sorry if I’m asking a stupid question, and I did spend some considerable time before bothering the community. But not being able to get my bearings, I humbly ask if anyone has any insights or pointers on why I can’t achieve this understanding and execute the process. Thank you for your time in reading and any time in responding.

submitted by /u/MiracleNamedHope
[link] [comments]  I’m using the IDLE Shell downloaded from Python.org version 3.13.1 (which is most recent version of the IDLE Shell available for download from this site). I’ve been trying to install Pip for a few hours, and I can’t believe how stuck I am. W3 Schools recommends us to https://pypi.org/project/pip/ From here we are routed to install PIP at https://pip.pypa.io/en/stable/installation/ And this is where things start to go off the rails. While this ultimately seems to be the same site I got the IDLE Shell from (or some localized project within that Python.org site), now they seem to be wanting me to just ignore the IDLE Shell environment that I got from them altogether. And now they seem to be wanting me to just run Python on my Windows PowerShell, where it seems it wants me to run: C:> py -m ensurepip –upgrade Are they telling me to get out of the IDLE Shell and install PIP by just plugging that code into the Windows command line? And when I do this, it tells me: Requirement already satisfied: pip in c: Ok great, But I want PIP in the IDLE, not the Windows PowerShell. And in addition to all of this, I have read pages on “bootstrapping”, which take me here: https://bootstrap.pypa.io/get-pip.py So I’m just dizzy and blown away by my inability to understand this process. I am sorry if I’m asking a stupid question, and I did spend some considerable time before bothering the community. But not being able to get my bearings, I humbly ask if anyone has any insights or pointers on why I can’t achieve this understanding and execute the process. Thank you for your time in reading and any time in responding. submitted by /u/MiracleNamedHope [link] [comments]

Read more

Please help. /u/vampiriams Python Education

Please help. /u/vampiriams Python Education

Okay, so let me start by saying I know NOTHING about Python. When I say nothing, it means I can just print stuff and I don’t even know where I’m putting it. Where am I supposed to put it? I don’t know.

I joined this course a while ago because I like to familiarize myself with what I suck at, tech being one of them. So I decided to give it a shot. I’m in high school and I had a break so I thought why not. Well, despite being in the whole beginner level, I am still lost. I have no idea what I’m doing. What even is Linear Regression? I have no logic for the Python language at all. I feel bad because the instructor kept adding like two minutes to solve the exercises because I just didn’t know how to begin them and everyone else was done. Now I’m embarrassed to even ask if this is the beginner level? Like I do not believe I can be this dense. However this course keeps proving me wrong!

The point is, does anyone recommend some videos in YouTube or books on how to even understand what I’m typing? I know this was a heavily dumb idea and a rather impulsive decision from my part but I do want to at least try and persevere through this. Please help, I would heavily thank you.

submitted by /u/vampiriams
[link] [comments]

​r/learnpython Okay, so let me start by saying I know NOTHING about Python. When I say nothing, it means I can just print stuff and I don’t even know where I’m putting it. Where am I supposed to put it? I don’t know. I joined this course a while ago because I like to familiarize myself with what I suck at, tech being one of them. So I decided to give it a shot. I’m in high school and I had a break so I thought why not. Well, despite being in the whole beginner level, I am still lost. I have no idea what I’m doing. What even is Linear Regression? I have no logic for the Python language at all. I feel bad because the instructor kept adding like two minutes to solve the exercises because I just didn’t know how to begin them and everyone else was done. Now I’m embarrassed to even ask if this is the beginner level? Like I do not believe I can be this dense. However this course keeps proving me wrong! The point is, does anyone recommend some videos in YouTube or books on how to even understand what I’m typing? I know this was a heavily dumb idea and a rather impulsive decision from my part but I do want to at least try and persevere through this. Please help, I would heavily thank you. submitted by /u/vampiriams [link] [comments] 

Okay, so let me start by saying I know NOTHING about Python. When I say nothing, it means I can just print stuff and I don’t even know where I’m putting it. Where am I supposed to put it? I don’t know.

I joined this course a while ago because I like to familiarize myself with what I suck at, tech being one of them. So I decided to give it a shot. I’m in high school and I had a break so I thought why not. Well, despite being in the whole beginner level, I am still lost. I have no idea what I’m doing. What even is Linear Regression? I have no logic for the Python language at all. I feel bad because the instructor kept adding like two minutes to solve the exercises because I just didn’t know how to begin them and everyone else was done. Now I’m embarrassed to even ask if this is the beginner level? Like I do not believe I can be this dense. However this course keeps proving me wrong!

The point is, does anyone recommend some videos in YouTube or books on how to even understand what I’m typing? I know this was a heavily dumb idea and a rather impulsive decision from my part but I do want to at least try and persevere through this. Please help, I would heavily thank you.

submitted by /u/vampiriams
[link] [comments]  Okay, so let me start by saying I know NOTHING about Python. When I say nothing, it means I can just print stuff and I don’t even know where I’m putting it. Where am I supposed to put it? I don’t know. I joined this course a while ago because I like to familiarize myself with what I suck at, tech being one of them. So I decided to give it a shot. I’m in high school and I had a break so I thought why not. Well, despite being in the whole beginner level, I am still lost. I have no idea what I’m doing. What even is Linear Regression? I have no logic for the Python language at all. I feel bad because the instructor kept adding like two minutes to solve the exercises because I just didn’t know how to begin them and everyone else was done. Now I’m embarrassed to even ask if this is the beginner level? Like I do not believe I can be this dense. However this course keeps proving me wrong! The point is, does anyone recommend some videos in YouTube or books on how to even understand what I’m typing? I know this was a heavily dumb idea and a rather impulsive decision from my part but I do want to at least try and persevere through this. Please help, I would heavily thank you. submitted by /u/vampiriams [link] [comments]

Read more

Readline prompt disappear /u/Stunning-Mix492 Python Education

Readline prompt disappear /u/Stunning-Mix492 Python Education

I got the following code :

import readline from colorama import Fore, Style def prompt(): print(Fore.RED + 'prompt' + Style.RESET_ALL + '> ', end='', flush=True) readline.set_pre_input_hook(prompt) # Read input lines from stdin, preserving history while True: line = input() print(line) readline.add_history(line) 

When I press up and down key to browse history, the prompt disappear. Is it fixable ?

submitted by /u/Stunning-Mix492
[link] [comments]

​r/learnpython I got the following code : import readline from colorama import Fore, Style def prompt(): print(Fore.RED + ‘prompt’ + Style.RESET_ALL + ‘> ‘, end=”, flush=True) readline.set_pre_input_hook(prompt) # Read input lines from stdin, preserving history while True: line = input() print(line) readline.add_history(line) When I press up and down key to browse history, the prompt disappear. Is it fixable ? submitted by /u/Stunning-Mix492 [link] [comments] 

I got the following code :

import readline from colorama import Fore, Style def prompt(): print(Fore.RED + 'prompt' + Style.RESET_ALL + '> ', end='', flush=True) readline.set_pre_input_hook(prompt) # Read input lines from stdin, preserving history while True: line = input() print(line) readline.add_history(line) 

When I press up and down key to browse history, the prompt disappear. Is it fixable ?

submitted by /u/Stunning-Mix492
[link] [comments]  I got the following code : import readline from colorama import Fore, Style def prompt(): print(Fore.RED + ‘prompt’ + Style.RESET_ALL + ‘> ‘, end=”, flush=True) readline.set_pre_input_hook(prompt) # Read input lines from stdin, preserving history while True: line = input() print(line) readline.add_history(line) When I press up and down key to browse history, the prompt disappear. Is it fixable ? submitted by /u/Stunning-Mix492 [link] [comments]

Read more