Add filters in python /u/lowkeyskinny Python Education

Add filters in python /u/lowkeyskinny Python Education

Super newbie . I need a detailed step by step guide on how to add filters in python to remove special characters in excel output . Remind you I am a completer newbie to python .

So my question is how to add filters in python to remove special characters in excel output ?

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

​r/learnpython Super newbie . I need a detailed step by step guide on how to add filters in python to remove special characters in excel output . Remind you I am a completer newbie to python . So my question is how to add filters in python to remove special characters in excel output ? submitted by /u/lowkeyskinny [link] [comments] 

Super newbie . I need a detailed step by step guide on how to add filters in python to remove special characters in excel output . Remind you I am a completer newbie to python .

So my question is how to add filters in python to remove special characters in excel output ?

submitted by /u/lowkeyskinny
[link] [comments]  Super newbie . I need a detailed step by step guide on how to add filters in python to remove special characters in excel output . Remind you I am a completer newbie to python . So my question is how to add filters in python to remove special characters in excel output ? submitted by /u/lowkeyskinny [link] [comments]

Read more

Why don’t Python devs like doctests? /u/Informal-Addendum435 Python Education

Why don’t Python devs like doctests? /u/Informal-Addendum435 Python Education

From reading this thread I have gathered the impression that Python devs don’t like doctest: https://forum.djangoproject.com/t/testing-django-with-doctest/25550/8

I think doctests are an antipattern for anything other than testing code examples in documentation to make sure they keep working. Specifically, they shouldn’t be part of your main testing strategy, especially as a beginner.

The romantic part of me misses doctests, but I think the tide has gone well away from it… — Q: are doctests really supported and developed in the stdlib still? I think _not really_… (like, they haven’t been removed but that’s about all we can say, unless I’ve missed something)

I really like doctests though.

What do other developers think are the problems with doctests?

submitted by /u/Informal-Addendum435
[link] [comments]

​r/learnpython From reading this thread I have gathered the impression that Python devs don’t like doctest: https://forum.djangoproject.com/t/testing-django-with-doctest/25550/8 I think doctests are an antipattern for anything other than testing code examples in documentation to make sure they keep working. Specifically, they shouldn’t be part of your main testing strategy, especially as a beginner. The romantic part of me misses doctests, but I think the tide has gone well away from it… — Q: are doctests really supported and developed in the stdlib still? I think _not really_… (like, they haven’t been removed but that’s about all we can say, unless I’ve missed something) I really like doctests though. What do other developers think are the problems with doctests? submitted by /u/Informal-Addendum435 [link] [comments] 

From reading this thread I have gathered the impression that Python devs don’t like doctest: https://forum.djangoproject.com/t/testing-django-with-doctest/25550/8

I think doctests are an antipattern for anything other than testing code examples in documentation to make sure they keep working. Specifically, they shouldn’t be part of your main testing strategy, especially as a beginner.

The romantic part of me misses doctests, but I think the tide has gone well away from it… — Q: are doctests really supported and developed in the stdlib still? I think _not really_… (like, they haven’t been removed but that’s about all we can say, unless I’ve missed something)

I really like doctests though.

What do other developers think are the problems with doctests?

submitted by /u/Informal-Addendum435
[link] [comments]  From reading this thread I have gathered the impression that Python devs don’t like doctest: https://forum.djangoproject.com/t/testing-django-with-doctest/25550/8 I think doctests are an antipattern for anything other than testing code examples in documentation to make sure they keep working. Specifically, they shouldn’t be part of your main testing strategy, especially as a beginner. The romantic part of me misses doctests, but I think the tide has gone well away from it… — Q: are doctests really supported and developed in the stdlib still? I think _not really_… (like, they haven’t been removed but that’s about all we can say, unless I’ve missed something) I really like doctests though. What do other developers think are the problems with doctests? submitted by /u/Informal-Addendum435 [link] [comments]

Read more

Pywinauto – detecting and connecting to a second pop up with the same window title? /u/I_P_L Python Education

Pywinauto – detecting and connecting to a second pop up with the same window title? /u/I_P_L Python Education

I’m trying to work on some basic automation for a data entry task (raising invoices). At one point in the middle of the script I need to manually input something and then click an “add” button between two and three times. So I would set the script to wait. After this, a new window pops up with the exact same title as the currently open window. I should add the program to raise invoices is a (very old) VBA GUI, so it’s already a bit of a hodgepodge of workarounds since a lot of the time I have to manually send the mouse to click on coordinates to select text boxes.

This means, annoyingly, I can’t use wait(). Does anyone have any good ideas for a workaround? What I’ve tried so far are:

  • Detecting when I click on the button. Unfortunately doesn’t work as it can be either two or three times, so I’d need something else to catch it.
  • Trying to read for elements on the new window which are unique to it. Doesn’t work because all that’s on this window are blank text fields, which the previous window also has.
  • Setting the script to wait until I press a hotkey to continue – it works technically, but is inelegant and not truly automated.

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

​r/learnpython I’m trying to work on some basic automation for a data entry task (raising invoices). At one point in the middle of the script I need to manually input something and then click an “add” button between two and three times. So I would set the script to wait. After this, a new window pops up with the exact same title as the currently open window. I should add the program to raise invoices is a (very old) VBA GUI, so it’s already a bit of a hodgepodge of workarounds since a lot of the time I have to manually send the mouse to click on coordinates to select text boxes. This means, annoyingly, I can’t use wait(). Does anyone have any good ideas for a workaround? What I’ve tried so far are: Detecting when I click on the button. Unfortunately doesn’t work as it can be either two or three times, so I’d need something else to catch it. Trying to read for elements on the new window which are unique to it. Doesn’t work because all that’s on this window are blank text fields, which the previous window also has. Setting the script to wait until I press a hotkey to continue – it works technically, but is inelegant and not truly automated. submitted by /u/I_P_L [link] [comments] 

I’m trying to work on some basic automation for a data entry task (raising invoices). At one point in the middle of the script I need to manually input something and then click an “add” button between two and three times. So I would set the script to wait. After this, a new window pops up with the exact same title as the currently open window. I should add the program to raise invoices is a (very old) VBA GUI, so it’s already a bit of a hodgepodge of workarounds since a lot of the time I have to manually send the mouse to click on coordinates to select text boxes.

This means, annoyingly, I can’t use wait(). Does anyone have any good ideas for a workaround? What I’ve tried so far are:

  • Detecting when I click on the button. Unfortunately doesn’t work as it can be either two or three times, so I’d need something else to catch it.
  • Trying to read for elements on the new window which are unique to it. Doesn’t work because all that’s on this window are blank text fields, which the previous window also has.
  • Setting the script to wait until I press a hotkey to continue – it works technically, but is inelegant and not truly automated.

submitted by /u/I_P_L
[link] [comments]  I’m trying to work on some basic automation for a data entry task (raising invoices). At one point in the middle of the script I need to manually input something and then click an “add” button between two and three times. So I would set the script to wait. After this, a new window pops up with the exact same title as the currently open window. I should add the program to raise invoices is a (very old) VBA GUI, so it’s already a bit of a hodgepodge of workarounds since a lot of the time I have to manually send the mouse to click on coordinates to select text boxes. This means, annoyingly, I can’t use wait(). Does anyone have any good ideas for a workaround? What I’ve tried so far are: Detecting when I click on the button. Unfortunately doesn’t work as it can be either two or three times, so I’d need something else to catch it. Trying to read for elements on the new window which are unique to it. Doesn’t work because all that’s on this window are blank text fields, which the previous window also has. Setting the script to wait until I press a hotkey to continue – it works technically, but is inelegant and not truly automated. submitted by /u/I_P_L [link] [comments]

Read more

How do I make portable python not SO SLOW !? /u/DontKnowButIDo Python Education

How do I make portable python not SO SLOW !? /u/DontKnowButIDo Python Education

Hello !

I use portable python more than python itself, but I always had one problem:

IT’S SUPER SLOOOOOOOOOOOOOOW !

Any way to speed it up a little ? Especially for the CMD and imports.

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

​r/learnpython Hello ! I use portable python more than python itself, but I always had one problem: IT’S SUPER SLOOOOOOOOOOOOOOW ! Any way to speed it up a little ? Especially for the CMD and imports. submitted by /u/DontKnowButIDo [link] [comments] 

Hello !

I use portable python more than python itself, but I always had one problem:

IT’S SUPER SLOOOOOOOOOOOOOOW !

Any way to speed it up a little ? Especially for the CMD and imports.

submitted by /u/DontKnowButIDo
[link] [comments]  Hello ! I use portable python more than python itself, but I always had one problem: IT’S SUPER SLOOOOOOOOOOOOOOW ! Any way to speed it up a little ? Especially for the CMD and imports. submitted by /u/DontKnowButIDo [link] [comments]

Read more

Struggling with CI/CD Errors – Any Advice or Tools? /u/nice2-meetu Python Education

Struggling with CI/CD Errors – Any Advice or Tools? /u/nice2-meetu Python Education

Hi everyone, I’m a first-year CS student, and I seem to be always struggling with errors in my CI/CD pipeline. Are there any tools you use to automatically detect and fix these errors? If not, how do you usually fix them just manually? I seem to spend a lot of time on it although my code is getting much better but even more experienced devs say they run into errors a lot. What tools would make my life easier?

Any advice or suggestions?

submitted by /u/nice2-meetu
[link] [comments]

​r/learnpython Hi everyone, I’m a first-year CS student, and I seem to be always struggling with errors in my CI/CD pipeline. Are there any tools you use to automatically detect and fix these errors? If not, how do you usually fix them just manually? I seem to spend a lot of time on it although my code is getting much better but even more experienced devs say they run into errors a lot. What tools would make my life easier? Any advice or suggestions? submitted by /u/nice2-meetu [link] [comments] 

Hi everyone, I’m a first-year CS student, and I seem to be always struggling with errors in my CI/CD pipeline. Are there any tools you use to automatically detect and fix these errors? If not, how do you usually fix them just manually? I seem to spend a lot of time on it although my code is getting much better but even more experienced devs say they run into errors a lot. What tools would make my life easier?

Any advice or suggestions?

submitted by /u/nice2-meetu
[link] [comments]  Hi everyone, I’m a first-year CS student, and I seem to be always struggling with errors in my CI/CD pipeline. Are there any tools you use to automatically detect and fix these errors? If not, how do you usually fix them just manually? I seem to spend a lot of time on it although my code is getting much better but even more experienced devs say they run into errors a lot. What tools would make my life easier? Any advice or suggestions? submitted by /u/nice2-meetu [link] [comments]

Read more

Botting ? Pokemon ? /u/Subiesaver107 Python Education

Botting ? Pokemon ? /u/Subiesaver107 Python Education

Hey guys I know this might be a weird ask but. I’m a HUGE pokemon collector and I continually miss the latest drops because of bots I can only assume I can’t nearly checkout manually fast enough and I can’t get my hands on any product which is kind of shitty as I don’t want to pay resale prices.

I’m wondering if anyone has any experience coding a checkout bot, Refreshes page Adds item to cart Then checkout?

I know it can be done as i believe everyone else is already doing it but I can’t find anything online to buy one anywheres or anything of the sorts.

I am willing to pay for this project.

Im also useless when coming to coding as I only ever took one high-school equivalent course 7 years ago. But if it’s not super hard I’d be willing to learn and hopefully I could code it myself.

Any help is super appreciated!!!

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

​r/learnpython Hey guys I know this might be a weird ask but. I’m a HUGE pokemon collector and I continually miss the latest drops because of bots I can only assume I can’t nearly checkout manually fast enough and I can’t get my hands on any product which is kind of shitty as I don’t want to pay resale prices. I’m wondering if anyone has any experience coding a checkout bot, Refreshes page Adds item to cart Then checkout? I know it can be done as i believe everyone else is already doing it but I can’t find anything online to buy one anywheres or anything of the sorts. I am willing to pay for this project. Im also useless when coming to coding as I only ever took one high-school equivalent course 7 years ago. But if it’s not super hard I’d be willing to learn and hopefully I could code it myself. Any help is super appreciated!!! submitted by /u/Subiesaver107 [link] [comments] 

Hey guys I know this might be a weird ask but. I’m a HUGE pokemon collector and I continually miss the latest drops because of bots I can only assume I can’t nearly checkout manually fast enough and I can’t get my hands on any product which is kind of shitty as I don’t want to pay resale prices.

I’m wondering if anyone has any experience coding a checkout bot, Refreshes page Adds item to cart Then checkout?

I know it can be done as i believe everyone else is already doing it but I can’t find anything online to buy one anywheres or anything of the sorts.

I am willing to pay for this project.

Im also useless when coming to coding as I only ever took one high-school equivalent course 7 years ago. But if it’s not super hard I’d be willing to learn and hopefully I could code it myself.

Any help is super appreciated!!!

submitted by /u/Subiesaver107
[link] [comments]  Hey guys I know this might be a weird ask but. I’m a HUGE pokemon collector and I continually miss the latest drops because of bots I can only assume I can’t nearly checkout manually fast enough and I can’t get my hands on any product which is kind of shitty as I don’t want to pay resale prices. I’m wondering if anyone has any experience coding a checkout bot, Refreshes page Adds item to cart Then checkout? I know it can be done as i believe everyone else is already doing it but I can’t find anything online to buy one anywheres or anything of the sorts. I am willing to pay for this project. Im also useless when coming to coding as I only ever took one high-school equivalent course 7 years ago. But if it’s not super hard I’d be willing to learn and hopefully I could code it myself. Any help is super appreciated!!! submitted by /u/Subiesaver107 [link] [comments]

Read more

Help me create a script /u/Charrleyy Python Education

Help me create a script /u/Charrleyy Python Education

So I don’t really post on reddit much but I have been having an issue recently so I reach out for your help.

I have a EXE file that opens a test console for a USB Controller. This USB controller does not work directly with windows regardless of what drivers I install so I have given up on that so far. Navigating the test console I am able to achieve a live log of the position data of where the axis’s of the usb controller is. What I need is to be able to take that position data given in the console and send it to a virtual joystick (vjoy) where Windows will be able to use that as a game controller.

What Ive tried.
Im not good at all with python and admit to using a lot of chat gpt to help me write this code. I know chat gpt can be wrong in so many ways but it was really the only thing that I got as ive researched this exact issue online and havent found much. I have tried using the subprocess.popen utility with python but what ive found is that the exe bypasses stdout and writes directly to the console.

import subprocess import time try: # Start the EXE and capture its output process = subprocess.Popen( ['D:\Charlie\Documents\C2ProTestCon.exe'], # Path to your EXE stdout=subprocess.PIPE, # Capture standard output stderr=subprocess.STDOUT, # Merge stderr with stdout stdin=subprocess.PIPE, # Enable sending commands text=True, # Ensure text mode bufsize=0, # Unbuffered output universal_newlines=True ) time.sleep(0.5) print("==== Program Output Start ====") # Print output line by line while True: output = process.stdout.readline() # Read one line from stdout if output == '' and process.poll() is not None: # Process has ended break if output: # Print non-empty lines print(output.strip()) except FileNotFoundError as e: print(f"Error: The file was not found. Check the path.nDetails: {e}") except Exception as e: print(f"Error: {e}") finally: print("==== Program Outputg End ====") 

I don’t really know what to do from here on out. The EXE is pretty old (2011). If you do not know the exact solution but could at least point me in a direction that could lead to a solution I would greatly appreciate your help. If anyone would like a video of the consoles output or even the exact exe file let me know and I will provide all I can.

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

​r/learnpython So I don’t really post on reddit much but I have been having an issue recently so I reach out for your help. I have a EXE file that opens a test console for a USB Controller. This USB controller does not work directly with windows regardless of what drivers I install so I have given up on that so far. Navigating the test console I am able to achieve a live log of the position data of where the axis’s of the usb controller is. What I need is to be able to take that position data given in the console and send it to a virtual joystick (vjoy) where Windows will be able to use that as a game controller. What Ive tried. Im not good at all with python and admit to using a lot of chat gpt to help me write this code. I know chat gpt can be wrong in so many ways but it was really the only thing that I got as ive researched this exact issue online and havent found much. I have tried using the subprocess.popen utility with python but what ive found is that the exe bypasses stdout and writes directly to the console. import subprocess import time try: # Start the EXE and capture its output process = subprocess.Popen( [‘D:\Charlie\Documents\C2ProTestCon.exe’], # Path to your EXE stdout=subprocess.PIPE, # Capture standard output stderr=subprocess.STDOUT, # Merge stderr with stdout stdin=subprocess.PIPE, # Enable sending commands text=True, # Ensure text mode bufsize=0, # Unbuffered output universal_newlines=True ) time.sleep(0.5) print(“==== Program Output Start ====”) # Print output line by line while True: output = process.stdout.readline() # Read one line from stdout if output == ” and process.poll() is not None: # Process has ended break if output: # Print non-empty lines print(output.strip()) except FileNotFoundError as e: print(f”Error: The file was not found. Check the path.nDetails: {e}”) except Exception as e: print(f”Error: {e}”) finally: print(“==== Program Outputg End ====”) I don’t really know what to do from here on out. The EXE is pretty old (2011). If you do not know the exact solution but could at least point me in a direction that could lead to a solution I would greatly appreciate your help. If anyone would like a video of the consoles output or even the exact exe file let me know and I will provide all I can. submitted by /u/Charrleyy [link] [comments] 

So I don’t really post on reddit much but I have been having an issue recently so I reach out for your help.

I have a EXE file that opens a test console for a USB Controller. This USB controller does not work directly with windows regardless of what drivers I install so I have given up on that so far. Navigating the test console I am able to achieve a live log of the position data of where the axis’s of the usb controller is. What I need is to be able to take that position data given in the console and send it to a virtual joystick (vjoy) where Windows will be able to use that as a game controller.

What Ive tried.
Im not good at all with python and admit to using a lot of chat gpt to help me write this code. I know chat gpt can be wrong in so many ways but it was really the only thing that I got as ive researched this exact issue online and havent found much. I have tried using the subprocess.popen utility with python but what ive found is that the exe bypasses stdout and writes directly to the console.

import subprocess import time try: # Start the EXE and capture its output process = subprocess.Popen( ['D:\Charlie\Documents\C2ProTestCon.exe'], # Path to your EXE stdout=subprocess.PIPE, # Capture standard output stderr=subprocess.STDOUT, # Merge stderr with stdout stdin=subprocess.PIPE, # Enable sending commands text=True, # Ensure text mode bufsize=0, # Unbuffered output universal_newlines=True ) time.sleep(0.5) print("==== Program Output Start ====") # Print output line by line while True: output = process.stdout.readline() # Read one line from stdout if output == '' and process.poll() is not None: # Process has ended break if output: # Print non-empty lines print(output.strip()) except FileNotFoundError as e: print(f"Error: The file was not found. Check the path.nDetails: {e}") except Exception as e: print(f"Error: {e}") finally: print("==== Program Outputg End ====") 

I don’t really know what to do from here on out. The EXE is pretty old (2011). If you do not know the exact solution but could at least point me in a direction that could lead to a solution I would greatly appreciate your help. If anyone would like a video of the consoles output or even the exact exe file let me know and I will provide all I can.

submitted by /u/Charrleyy
[link] [comments]  So I don’t really post on reddit much but I have been having an issue recently so I reach out for your help. I have a EXE file that opens a test console for a USB Controller. This USB controller does not work directly with windows regardless of what drivers I install so I have given up on that so far. Navigating the test console I am able to achieve a live log of the position data of where the axis’s of the usb controller is. What I need is to be able to take that position data given in the console and send it to a virtual joystick (vjoy) where Windows will be able to use that as a game controller. What Ive tried. Im not good at all with python and admit to using a lot of chat gpt to help me write this code. I know chat gpt can be wrong in so many ways but it was really the only thing that I got as ive researched this exact issue online and havent found much. I have tried using the subprocess.popen utility with python but what ive found is that the exe bypasses stdout and writes directly to the console. import subprocess import time try: # Start the EXE and capture its output process = subprocess.Popen( [‘D:\Charlie\Documents\C2ProTestCon.exe’], # Path to your EXE stdout=subprocess.PIPE, # Capture standard output stderr=subprocess.STDOUT, # Merge stderr with stdout stdin=subprocess.PIPE, # Enable sending commands text=True, # Ensure text mode bufsize=0, # Unbuffered output universal_newlines=True ) time.sleep(0.5) print(“==== Program Output Start ====”) # Print output line by line while True: output = process.stdout.readline() # Read one line from stdout if output == ” and process.poll() is not None: # Process has ended break if output: # Print non-empty lines print(output.strip()) except FileNotFoundError as e: print(f”Error: The file was not found. Check the path.nDetails: {e}”) except Exception as e: print(f”Error: {e}”) finally: print(“==== Program Outputg End ====”) I don’t really know what to do from here on out. The EXE is pretty old (2011). If you do not know the exact solution but could at least point me in a direction that could lead to a solution I would greatly appreciate your help. If anyone would like a video of the consoles output or even the exact exe file let me know and I will provide all I can. submitted by /u/Charrleyy [link] [comments]

Read more

How do i pass a flask app.logger to another python file? /u/migustapapaya Python Education

How do i pass a flask app.logger to another python file? /u/migustapapaya Python Education

app.py:

from flask import Flask, request, url_for import os from auth.logger import hi from logging.config import dictConfig dictConfig({ 'version': 1, 'formatters': {'default': { 'format': '[%(asctime)s] %(levelname)s in %(module)s: %(message)s', }}, 'handlers': {'wsgi': { 'class': 'logging.StreamHandler', 'stream': 'ext://flask.logging.wsgi_errors_stream', 'formatter': 'default' }}, 'root': { 'level': 'INFO', 'handlers': ['wsgi'] } }) app = Flask(__name__) .route("/test") def test(): hi() return "Test" 

auth/logger.py

import logging log = logging.getLogger('app.hi') def hi(): print(log.parent) log.warning('warning test') 

The parent printed out is <Logger app (INFO)>. But why am I not able to log the warning out?

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

​r/learnpython app.py: from flask import Flask, request, url_for import os from auth.logger import hi from logging.config import dictConfig dictConfig({ ‘version’: 1, ‘formatters’: {‘default’: { ‘format’: ‘[%(asctime)s] %(levelname)s in %(module)s: %(message)s’, }}, ‘handlers’: {‘wsgi’: { ‘class’: ‘logging.StreamHandler’, ‘stream’: ‘ext://flask.logging.wsgi_errors_stream’, ‘formatter’: ‘default’ }}, ‘root’: { ‘level’: ‘INFO’, ‘handlers’: [‘wsgi’] } }) app = Flask(__name__) .route(“/test”) def test(): hi() return “Test” auth/logger.py import logging log = logging.getLogger(‘app.hi’) def hi(): print(log.parent) log.warning(‘warning test’) The parent printed out is <Logger app (INFO)>. But why am I not able to log the warning out? submitted by /u/migustapapaya [link] [comments] 

app.py:

from flask import Flask, request, url_for import os from auth.logger import hi from logging.config import dictConfig dictConfig({ 'version': 1, 'formatters': {'default': { 'format': '[%(asctime)s] %(levelname)s in %(module)s: %(message)s', }}, 'handlers': {'wsgi': { 'class': 'logging.StreamHandler', 'stream': 'ext://flask.logging.wsgi_errors_stream', 'formatter': 'default' }}, 'root': { 'level': 'INFO', 'handlers': ['wsgi'] } }) app = Flask(__name__) .route("/test") def test(): hi() return "Test" 

auth/logger.py

import logging log = logging.getLogger('app.hi') def hi(): print(log.parent) log.warning('warning test') 

The parent printed out is <Logger app (INFO)>. But why am I not able to log the warning out?

submitted by /u/migustapapaya
[link] [comments]  app.py: from flask import Flask, request, url_for import os from auth.logger import hi from logging.config import dictConfig dictConfig({ ‘version’: 1, ‘formatters’: {‘default’: { ‘format’: ‘[%(asctime)s] %(levelname)s in %(module)s: %(message)s’, }}, ‘handlers’: {‘wsgi’: { ‘class’: ‘logging.StreamHandler’, ‘stream’: ‘ext://flask.logging.wsgi_errors_stream’, ‘formatter’: ‘default’ }}, ‘root’: { ‘level’: ‘INFO’, ‘handlers’: [‘wsgi’] } }) app = Flask(__name__) .route(“/test”) def test(): hi() return “Test” auth/logger.py import logging log = logging.getLogger(‘app.hi’) def hi(): print(log.parent) log.warning(‘warning test’) The parent printed out is <Logger app (INFO)>. But why am I not able to log the warning out? submitted by /u/migustapapaya [link] [comments]

Read more