#python modules not found error
Explore tagged Tumblr posts
Note
Hey there! I have a question about opening on a Dell computer! I hope you can help!
So, I've tried both the 64 bit and 32 bit versions of the game, they both are not opening properly. I managed to get the 32 to open once, before I had to hop off for a while and shut the game.
I'm now not able to get it to open, again...
It gives me an error along the lines of: "failed to load Python DLL (a bunch of other stuff) Loadlibrary: The specified module could not be found."
I tried doing what another person suggested, which, was to make suret the file wasn't in quarantine. Which, I checked, it's nowhere to be found in my anti virus program.
Again, I hope you can help, because it's starting to annoy me to pieces 😭. Thank you!
sorry, i'm not a good person to ask for tech help with the game. you have better chances to get help by joining clangen's discord server (we have tech help forums there) or by asking the account dedicated to clangen, @officialclangen (but that blog might not be able to help with technical issues either, so discord is best option)
2 notes
·
View notes
Text
Natural Text to Speech (python)
Microsoft Edge has very good, natural-sounding Text to Speech voices used in its "Read Aloud" feature. You can utilize these voices using python and a module called edge-tts (edge text to speech) to generate audio files of whatever text you like, including subtitles (for free).
Install python if you haven't already
Use pip to install edge-tts in your favorite command line
Run the CLI commands or create a new .py file. I suggest starting with this basic audio generation example.
Replace the TEXT variable contents with your string of choice. I recommend creating separate .txt files then reading them with the program, which allows you to cleanly scale your program to generate multiple files at once. (Imagine crawling your Obsidian vault to generate audio versions of all of your files!)
Choose your voice. You can use the Read Aloud feature in Edge to try out the different available voices (their quality varies). Their programatic voice names are found here. Note that not all voices are available, depending on your region, and trying to use one out of your region will throw an error. Read the footnotes. I'm still early in testing the different voices, but if you want to start on the right foot, Ava, or "en-US-AvaMultilingualNeural" is very good.
If you run the above example, it will generate a file called test.mp3 in the directory of the .py file. It's definitely performant. I ran a ~10k word file and it took a couple of minutes to generate (~23 MB with a running length of 1 hour and 3 minutes).
Have fun!
Added voice samples for the two I like the most, Ava and Brian multilingual.
3 notes
·
View notes
Text
Python Day 2
Today I am starting off with exercise 13. Exercise 13 introduces the concepts of variables, modules, and argv.
[ID: Exercise 13 code. It imports the argv module from sys, then uses argv to create 4 variables, script, first, second, and third. Next print() is used to print out the different variables /ID]
When calling the program I was confused as to why I got the error of too many variables. Looking into this I found that the first variable of 'argv' is always going to be the script. I then fixed that and added in script as the first variable.
Next for the study drill I wrote a new variable and updated the code to print the retrieved information.
Alrighty then - onto exercise 14. Exercise 14 is about practicing prompts and variables.
In the study drills I updated the script with a new prompt and print statement.
Exercise 15 is a simple program that prints out the contents of a file. An important thing to note is to always close the file when doing things like this!
Exercise 16 practices making a copy of a file and then updating it with 3 lines from user input.
I ended up running into the issue where it was saying that it couldn't read the file. I ended up finding out that .read() starts from the cursor position - and if the cursor is at the end of the file from writing it you will not have your file printed.
Exercise 17 is practicing copying files over and was relatively simple.
#learn python with F.M.#learn to code#learn python#coding resources#python#coding#lpthw#transgender programmer#codeblr#code#image undescribed#Sorry for not adding ID folks - my spoons are too low
4 notes
·
View notes
Text
Tips for managing exceptions and debugging Python code.
Managing exceptions and debugging effectively in Python is crucial for writing reliable and maintainable code. Here are some key tips to help with exception handling and debugging:
1. Use Try-Except Blocks Wisely
Wrap only the code that might raise an exception in try blocks.
Catch specific exceptions instead of using a general except Exception to avoid masking unexpected issues.
pythontry: result = 10 / 0 except ZeroDivisionError as e: print(f"Error: {e}")
2. Use the Else Clause in Try-Except Blocks
The else clause runs only if no exception occurs, keeping your code cleaner.
pythontry: num = int(input("Enter a number: ")) except ValueError: print("Invalid input! Please enter a number.") else: print(f"Valid number: {num}")
3. Leverage Finally for Cleanup
The finally block runs regardless of whether an exception occurred, useful for resource cleanup.
pythontry: file = open("data.txt", "r") content = file.read() except FileNotFoundError: print("File not found!") finally: file.close() # Ensures the file is closed even if an error occurs
4. Raise Custom Exceptions for Clarity
Define custom exceptions when the built-in ones don’t convey the specific issue.
python class CustomError(Exception): passdef check_value(val): if val < 0: raise CustomError("Negative values are not allowed.")try: check_value(-5) except CustomError as e: print(f"Custom Exception Caught: {e}")
5. Use Logging Instead of Print
The logging module provides better error tracking, filtering, and logging to files.
pythonimport logginglogging.basicConfig(level=logging.ERROR, filename="error.log")try: value = int("abc") except ValueError as e: logging.error(f"ValueError occurred: {e}")
6. Debug with Python Debugger (pdb)
The built-in pdb module allows interactive debugging.
pythonimport pdbdef buggy_function(): x = 10 y = 0 pdb.set_trace() # Execution will pause here for debugging return x / ybuggy_function()
Use commands like n (next line), s (step into), c (continue), q (quit).
7. Use Assertions for Debugging
Use assert to check conditions during development.
pythondef process_data(data): assert isinstance(data, list), "Data must be a list" return sum(data) / len(data)process_data("Not a list") # Raises AssertionError
8. Handle Multiple Exceptions Separately
Avoid catching multiple exception types in a single block if they need different handling.
pythontry: num = int(input("Enter a number: ")) result = 10 / num except ValueError: print("Invalid number!") except ZeroDivisionError: print("Cannot divide by zero!")
9. Use Tracebacks for Better Error Analysis
The traceback module provides detailed error information.
pythonimport tracebacktry: 1 / 0 except Exception: print(traceback.format_exc())
10. Use IDE Debugging Tools
Modern IDEs like PyCharm, VS Code, and Jupyter Notebooks have built-in debuggers that allow breakpoints and step-through debugging.
0 notes
Text
I've been feeling bad about my nerd skill atrophy since getting married and having kids and losing the ability to spend a day dicking around on the computer. a couple months ago I noticed the OS on my home server was too old for security updates, so I upgraded to the newest version, which broke both Plex and Subsonic. this has been extra bad because I watch/listen to stuff I've watched/listened to a million times to keep myself on task while I'm doing chores, so with those out of commission I've been watching YouTube and taking an hour to load the dishwasher.
I felt a pang of aptitude last week, so I dug in and started troubleshooting Plex. I searched for error messages in a new way, I guess, because after about 10 minutes I found a suggestion to delete the server from my account, and delete the preferences file from the server. boom, now the kids can watch their shows, and I can watch Mr Show.
Subsonic is harder, because since I started using it, it has forked a few times, so there are way fewer people running it, let alone running it on Tomcat 8 on FreeBSD. so I stepped back and reconsidered: if something else will do the same thing and be easier to setup and maintain, it's better. so, I forgot everything I never really learned about Tomcat (complicated as fuck) and started downloading Python modules.
so now I learned the basics of setting up PostgreSQL, got Supysonic (a Python implementation of the quasi-standard created by the multitude of forks) working better than Subsonic did, and I have new motivation for starting my related personal projects. thank you estrogen!
#trans#trans fem#transfem#technology#freebsd#plex#Python#supysonic#subsonic#postgresql#nerd shit#estrogen#mr show#home server
1 note
·
View note
Text
Web Scraping 103 : Scrape Amazon Product Reviews With Python –
Amazon is a well-known e-commerce platform with a large amount of data available in various formats on the web. This data can be invaluable for gaining business insights, particularly by analyzing product reviews to understand the quality of products provided by different vendors.
In this guide we will look into web scraping steps to extract amazon reviews of a particular product and save it in excel or csv format. Since manually copying information online can be tedious, in this guide we’ll focus on scraping reviews from Amazon. This hands-on experience will enhance our practical understanding of web scraping techniques.
Before we start, make sure you have Python installed in your system, you can do that from this link: python.org. The process is very simple, just install it like you would install any other application.
Now that everything is set let’s proceed:
How to Scrape Amazon Reviews Using Python
Install Anaconda using this link: https://www.anaconda.com/download . Be sure to follow the default settings during installation. For more guidance, please click here.
We can use various IDEs, but to keep it beginner-friendly, let’s start with Jupyter Notebook in Anaconda. You can watch the video linked above to understand and get familiar with the software.
Steps for Web Scraping Amazon Reviews:
Create New Notebook and Save it. Step 1: Let’s start importing all the necessary modules using the following code:
import requests from bs4 import BeautifulSoup import pandas as pd
Step 2: Define Headers to avoid getting your IP blocked. Note that you can search my user agent on google to get your user agent details and replace it below “User-agent”: “here goes your useragent below”.
custom_headers = { "Accept-language": "en-GB,en;q=0.9", "User-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1 Safari/605.1.15", }
Step 3: Create a python function, to fetch the webpage, check for errors and return a BeautifulSoup object for further processing.
# Function to fetch the webpage and return a BeautifulSoup object def fetch_webpage(url): response = requests.get(url, headers=headers) if response.status_code != 200: print("Error in fetching webpage") exit(-1) page_soup = BeautifulSoup(response.text, "lxml") return page_soup
Step 4: Inspect Element to find the element and attribute from which we want to extract data, Lets Create another function to select the div and attribute and set it to variable , extract_reviews identifies review-related elements on a webpage, but it doesn’t yet extract the actual review content. You would need to add code to extract the relevant information from these elements (e.g., review text, ratings, etc.).
Function to extract reviews from the webpage def extract_reviews(page_soup): review_blocks = page_soup.select('div[data-hook="review"]') reviews_list = []
Step 5: Below code processes each review element and extracts the customer’s name (if available), and stores it in the customer variable. If no customer information is found, customer remains none.
#for review in review_blocks: author_element = review.select_one('span.a-profile-name') customer = author_element.text if author_element else None rating_element = review.select_one('i.review-rating') customer_rating = rating_element.text.replace("out of 5 stars", "") if rating_element else None title_element = review.select_one('a[data-hook="review-title"]') review_title = title_element.text.split('stars\n', 1)[-1].strip() if title_element else None content_element = review.select_one('span[data-hook="review-body"]') review_content = content_element.text.strip() if content_element else None date_element = review.select_one('span[data-hook="review-date"]') review_date = date_element.text.replace("Reviewed in the United States on ", "").strip() if date_element else None image_element = review.select_one('img.review-image-tile') image_url = image_element.attrs["src"] if image_element else None
Step 6: The purpose of this function is to process scraped reviews. It takes various parameters related to a review (such as customer, customer_rating, review_title, review_content, review_date, and image URL), and the function returns the list of processed reviews.
review_data = { "customer": customer, "customer_rating": customer_rating, "review_title": review_title, "review_content": review_content, "review_date": review_date, "image_url": image_url } reviews_list.append(review_data) return reviews_list
Step 7: Now, Let’s initialize a search_url variable with an Amazon product review page URL
def main(): review_page_url = "https://www.amazon.com/BERIBES-Cancelling-Transparent-Soft-Earpads-Charging-Black/product- reviews/B0CDC4X65Q/ref=cm_cr_dp_d_show_all_btm?ie=UTF8&reviewerType=all_reviews" page_soup = fetch_webpage(review_page_url) scraped_reviews = extract_reviews(page_soup)
Step 8: Now let’s print(“Scraped Data:”, data) scraped review data (stored in the data variable) to the console for verification purposes.
# Print the scraped data to verify print("Scraped Data:", scraped_reviews)
Step 9: Next, Create a dataframe from the data which will help organize data into tabular form.
# create a DataFrame and export it to a CSV file reviews_df = pd.DataFrame(data=scraped_reviews)
Step 10: Now exports the DataFrame to a CSV file in current working directory
reviews_df.to_csv("reviews.csv", index=False) print("CSV file has been created.")
Step 11: below code construct acts as a protective measure. It ensures that certain code runs only when the script is directly executed as a standalone program, rather than being imported as a module by another script.
# Ensuring the script runs only when executed directly if __name__ == '__main__': main()
Result:
Why Scrape Amazon Product Reviews?
Scraping Amazon product reviews can provide valuable insights for businesses. Here’s why you should consider it:
● Feedback Collection: Every business needs feedback to understand customer requirements and implement changes to improve product quality. Scraping reviews allows businesses to gather large volumes of customer feedback quickly and efficiently.
● Sentiment Analysis: Analyzing the sentiments expressed in reviews can help identify positive and negative aspects of products, leading to informed business decisions.
● Competitor Analysis: Scraping allows businesses to monitor competitors’ pricing and product features, helping to stay competitive in the market.
● Business Expansion Opportunities: By understanding customer needs and preferences, businesses can identify opportunities for expanding their product lines or entering new markets.
Manually copying and pasting content is time-consuming and error-prone. This is where web scraping comes in. Using Python to scrape Amazon reviews can automate the process, reduce manual errors, and provide accurate data.
Benefits of Scraping Amazon Reviews
● Efficiency: Automate data extraction to save time and resources.
● Accuracy: Reduce human errors with automated scripts.
● Large Data Volume: Collect extensive data for comprehensive analysis.
● Informed Decision Making: Use customer feedback to make data-driven business decisions.
I found an amazing, cost-effective service provider that makes scraping easy. Follow this link to learn more.
Conclusion
Now that we’ve covered how to scrape Amazon reviews using Python, you can apply the same techniques to other websites by inspecting their elements. Here are some key points to remember:
● Understanding HTML: Familiarize yourself with HTML structure. Knowing how elements are nested and how to navigate the Document Object Model (DOM) is crucial for finding the data you want to scrape.
● CSS Selectors: Learn how to use CSS selectors to accurately target and extract specific elements from a webpage.
● Python Basics: Understand Python programming, especially how to use libraries like requests for making HTTP requests and BeautifulSoup for parsing HTML content.
● Inspecting Elements: Practice using browser developer tools (right-click on a webpage and select “Inspect” or press Ctrl+Shift+I) to examine the HTML structure. This helps you find the tags and attributes that hold the data you want to scrape.
● Error Handling: Add error handling to your code to deal with possible issues, like network errors or changes in the webpage structure.
● Legal and Ethical Considerations: Always check a website’s robots.txt file and terms of service to ensure compliance with legal and ethical rules of web scraping.
By mastering these areas, you’ll be able to confidently scrape data from various websites, allowing you to gather valuable insights and perform detailed analyses.
1 note
·
View note
Text
Top 10 Python Coding Secrets in 2023: A Journey through Sourabh Chandrakar Books
Python, a versatile and powerful programming language, continues to evolve, offering developers new tools and techniques to enhance their coding experience. In this article, we will explore the top 10 secret Python coding tips in 2023, drawing inspiration from the invaluable insights found in Sourabh Chandrakar books.
1.Mastering List Comprehensions:
In Sourabh Chandrakar books, you'll find a treasure trove of knowledge on list comprehensions. These concise and readable expressions allow you to create lists in a single line, boosting both efficiency and code elegance. Dive deep into his works to uncover advanced techniques for harnessing the full potential of list comprehensions.
2.Context Managers for Resource Management:
Proper resource management is crucial in Python development.Sourabh Chandrakar emphasizes the use of context managers, and his books delve into the intricacies of the with statement. Learn how to streamline your code and ensure efficient handling of resources like files and database connections.
3.Decorators Demystified:
SourabhChandrakarbooks provide an in-depth exploration of decorators, a powerful Python feature for modifying or extending functions and methods. Unlock the secrets of creating your own decorators to enhance code modularity and reusability.
4.Understanding Generators and Iterators:
Generators and iterators play a pivotal role in optimizing memory usage and enhancing performance. Sourabh Chandrakar insights into these concepts will equip you with the knowledge to write efficient, memory-friendly code.
5.Exploiting the Power of Regular Expressions:
Regular expressions are a potent tool for string manipulation and pattern matching. Sourabh Chandrakar books offer practical examples and tips for mastering regex in Python, enabling you to write robust and flexible code for text processing.
6.Optimizing Code with Cython:
Take your Python code to the next level by exploring the world of Cython. Chandrakar expertise in this area is evident in his books, guiding you through the process of integrating C-like performance into your Python applications.
7.Advanced Error Handling Techniques:
Sourabh Chandrakar places a strong emphasis on writing robust and error-tolerant code. Delve into his books to discover advanced error handling techniques, including custom exception classes and context-specific error messages.
8.Harnessing the Power of Enums:
Enums provide a clean and readable way to represent symbolic names for values. Sourabh Chandrakar's books shed light on leveraging Enums in Python to enhance code clarity and maintainability.
9.Mastering the asyncio Module:
Asynchronous programming is becoming increasingly important in modern Python development. Explore Chandrakar insights into the asyncio module, uncovering tips for efficient asynchronous code design.
10.The Art of Unit Testing:
Comprehensive unit testing is a hallmark of professional Python development. Sourabh Chandrakar books guide you through the art of writing effective unit tests, ensuring the reliability and maintainability of your codebase.
Conclusion:
In the dynamic world of Python development, staying ahead requires constant learning and exploration. Sourabh Chandrakar books serve as a valuable resource, offering deep insights into advanced Python coding techniques. By incorporating these top 10 secret Python coding tips into your skill set, you'll be well-equipped to tackle the challenges of 2023 and beyond. Happy coding!
1 note
·
View note
Text
The Seven Key Elements of Software Testing
The Seven Key Elements of Software Testing
Testing reveals that there are flaws.-python with selenium course
Testing enables us to show the presence of occurrences rather than their absence in a product. It is feasible to lessen the likelihood that incidents not yet identified will continue in the system after they have been reported and later fixed, but it is difficult to confirm and exceedingly improbable that there will be no occurrences at all.
Testing in its entirety is not feasible
Testing every conceivable set of data and activities across all of a software's features is typically not a practical option, barring exceptional circumstances, due to time, expense, or resource constraints. It is quite easy to take these elements into account while developing our strategy and creating test cases.
Initial testing - selenium and cucumber
This alliance is quite helpful when testing starts early in the software development process since it enables incidents to be found before the product fully develops. If these accidents weren't discovered until later stages, the cost of repair would be much higher.
Problem Clustering
When compared to the other components of a product, there are typically some modules and capabilities that are more prone to conceal issues (of higher priority). The 80/20 Rule, which claims that roughly 80% of results result from 20% of causes, is connected to this theory. This could be translated as follows in more exact terms: Not all software components are equally pertinent.
Paradox of pesticides
Repeatedly doing the same tests on a system's stable portion has a tendency to make it more difficult to find newly discovered incidents. Therefore, it is crucial that we continually examine and update our testing method as well as make sure that we thoroughly investigate all of the components that make up the product in order to maximize the likelihood of discovering events.
Testing depends on the situation
Depending on the system and the surroundings we want to verify, we will decide on the technique and the kinds of tests to run. For instance, testing for an e-commerce system will differ from testing for medical software. The techniques we employ
The fallacy of absence of errors
Assume that all the incidents that a certain system had noticed have now been resolved. After that, a fresh test cycle is run, after which additional instances are not found. However, the absence of any discovered mistakes does not necessarily suggest that the software is effective. This parameter does not represent its utility; rather, it measures how well a product can meet client expectations.
Understanding and putting these ideas into practice gives us a unique perspective that allows us to structure our testing strategy and work more accurately and efficiently.
Automate vs Manual Cross-Browser Testing: Explore the key differences in automation and manual software testing in our comprehensive Selenium automation with Python Join our Automation Testing Classes to master manual and automation software testing techniques, and earn a Certification for Test Automation to boost your career in quality assurance.
#python with selenium course#learn selenium with python#selenium with python course#python selenium course#selenium python course#learn python for selenium#selenium webdriver#selenium webdriver driver#python selenium tutorial#Selenium automation with Python#selenium webdriver python
0 notes
Text
The Fundamentals Of Software Engineering For Aspiring Professionals
In the current age, the continuous progress in technology is giving rise to new software each day. As per the statistical analysis of TrueList, there are around 26.9 million developers worldwide, which explains the significance of software in human lives.
But for one to be proficient in development strategies, they must know the fundamentals of software engineering. This article discusses the most important principles that are responsible for making software successful.

The Most Important Principles Of Software Development
The given fundamentals are part of every good software engineering course:
Modularity
The concept of modularity instructs that software should be divided into smaller, reusable parts or modules that can be created and tested individually. It is especially beneficial for managing large applications and simplifying the development process.
An ideal module should function independently and have specific goals. It should be easy to use and must be compiled separately. Furthermore, modular design should allow efficient implementation.
Abstraction
It refers to the process of exposing only selective details of a component for increasing efficiency and providing convenience to the developer. Mainly, abstraction can be done using two methods:
Data Abstraction: Details of data components are invisible to the user.
Functional Abstraction: Details of functions are not visible to the user.
Abstraction is done at various levels of the process and helps in refining the final product. It is one of the most important fundamentals of software engineering.
Design Strategy
A good path for designing software is mandatory for a developer. It helps to streamline multiple operations and facilitates a continuous workflow, thereby increasing productivity. Depending on the purpose, intricacy, and size of the software, any of the following design approaches can be used:
Top-Down Approach: In this approach, the main element is continuously divided into parts and subparts, thus forming a hierarchy. The division is performed until the lowest level of the component is found. This method ensures development based on priority.
Bottom-Up Approach: Development starts by using the lowest components to create more complex ones. The process continues until all the parts are composed into a single unit. This approach is best suited for creating new systems out of existing ones.
Incremental Approach: It involves developing and executing one small component of the application at a time.
Iterative Approach: In this approach, a new stage is built upon the contents of the previous one.
Agile Approach: This method involves an adaptive development approach in which the design constantly evolves according to changing requirements.
Reusability
A critical part of the fundamentals of software engineering, it refers to the quality that allows the reuse of components in building new software. Reusability plays a crucial role in providing a sustainable way of using valuable resources like the time and energy of developers. Additionally, it is necessary for reducing the possibility of errors.
Encapsulation
The process of attaching a component’s data to a single unit and hiding its internal structure is known as encapsulation. It prevents the object from external interference by controlling the access. Encapsulation is one of the most important fundamentals of software engineering that is used in Object Oriented Programming (OOP) languages like Java and Python.
Testing
The fundamentals of software engineering are incomplete without testing. It is done to ensure that an application is bug-free and meets the technical as well as user requirements. Examining software is important not only for identifying errors but also improving its quality, efficiency, and accuracy.
There are two ways to test a software product:
Manual: In manual testing, a development professional acts as a user and analyses the product for any discrepancies. It involves several stages like unit testing, integration testing, etc. and delivers insights into user experience.
Automated: Unlike manual examination, automated testing is done using specified software created by experts using scripts. It is used to repeatedly test the application without spending extra time or effort.

Maintenance
Software maintenance describes the practice of regularly updating and modifying the product after its launch in the market or delivery to the customer. The updates can maintain the health of the application as well as keep it on par with market trends.
The following are the main aspects of maintenance:
Bug Removal: Removing errors is crucial for the application’s functioning.
Enhancement: Adding new features to the product.
Performance Optimisation: Adjusting the application for improving its speed, reliability and efficiency.
Porting/Migration: Adapting the product for running on new software or hardware arrangements.
Re-engineering: Improving the software’s design and scalability.
Documentation: Maintaining the user manual, design files, and other documents.
You can also read.... Web Development Courses in Lucknow
Conclusion
The fundamentals of software engineering incorporate a wide variety of tasks, elements, and functions. A developer needs to have extensive knowledge of these concepts since they form the base of all development processes and strategies. The principles mentioned in this article are included in the best software development course with the ultimate aim of transforming aspiring individuals into experts coveted by recruiters of top companies.
0 notes
Text
Learn Python Modules in 1 Minute | Python Modules Tutorial for Beginners and Students
Hi, a new #video on #python #modules is published on #codeonedigest #youtube channel. Learn the #programming with python #module in 1 minute. Enjoy #coding with python #modules #python #pythontutorial #pythonmodule #pythonmodules #pythonmodulesforbeginn
What is Python Module? Python module is a code library that contains a set of functions that you may want to include in your application. A module allows you to logically organize your Python code. The Grouping of code into a module makes it easier to understand and use. Simply, a module is a file consist of Python code like functions, classes and variables. For example, when building a…

View On WordPress
#python#python explained#python module#python module for beginners#python modules#python modules and libraries#python modules for beginners#python modules for data science#python modules for hacking#python modules for tracking#python modules import error#python modules install#python modules list#python modules not found error#python modules search path#python tutorial#python tutorial for beginners#python tutorial for beginners in hindi#python tutorial in hindi
0 notes
Text
100 days of code : day 4
(29/03/2023)
Hello, how are you everyone?
Yesterday I started the 4th I studied about the random module but I had an anxiety attack and I didn't finish. (I'm better)
Today I finished the random and we started the array. But there's still a little bit left to finish. And during the afternoon I had several ideas of things I want to learn and I had a slight outbreak because there are so many things and how to organize myself.
But something I want to share is that I don't feel like I learn from Professor Angela, her teaching is not bad and she gives a lot of exercises.
BUT my head feels that something is missing and I know that I don't really think with it, precisely because the answers are easily accessible, which makes it easier to procrastinate or, in a slight error, look for the answer (no, I don't want moralistic advice on how this is wrong, I have a conscience, I'm just sharing my logic)
And why doesn't it seem to me that I'm learning algorithms and data structure, even though today, for example, I've seen array.
So, accessing the free university on github (I'll make a post, but I'll leave a link here too) I found the Brazilian version and saw a course on Introduction to Computer Science with Python and I loved it, because then I feel like I'm going to algorithms and data structure, and it's taught by the best college in my country (my dream included)
And then for me to stop feeling like a fraud and REALLY try hard.
I decided to make my own roadmap (not the official version yet) It will basically be:
Introduction to computer science part 1 and 2
Exercises from the algorithm course in python (I did it last year, but I really want to do it and make an effort this year)
Graphs
Data structure
Object orientation
programming paradigms
Git and GitHub
Clean Code
Design system
Solid
And only after that go back to 100 days (but now managing to do algorithm exercises for example) So then it would be:
100 days of code
django
Apis
Database
Practice projects.
Another thing I wanted to share (but I'll probably talk more about it in another post) is how the pressure/hurry of wanting to get a job is screwing up my studies.
I WILL NOT be able to learn things effectively on the run.
So I talked to myself and decided that this year I'm going to focus on learning as best I can, but without rushing to get a job (I have the privilege of living with my mother and she supports me) and then next year I'll go back to the call center to pay my bills and then look for a job in the area
I want to feel confident in my code, I want to REALLY know what to do and do it well.
But it won't be in a hurry, so I prefer peace to be able to learn in the best way and everything I want than to freak out and not leave the place.
Anyway, if you've read this essay so far I thank you and I wish you well UHEUHEUHEUHUEH
#100daysofcode#pythonforbeginners#pythonprogramming#pythoncode#coding#javascript#software engineer#software development#computerscience#comp sci#computing#computers#algorithms#datastructure#womanintech#woman in stem#study community#studyspo#study hard#studyblr community#studyblog
25 notes
·
View notes
Note
hey, i started following you recently and ur bio says ur a hacker? any tips on where to start? hacking seems like a v cool/fun way to learn more abt coding and cybersecurity/infrastructure and i'd like to explore it but there's so much on the internet and like, i'm not trying to get into anything illegal. thanks!
huh, an interesting question, ty!
i can give more tailored advice if you hit me up on chat with more specifics on your background/interests.
given what you've written here, though, i'll just assume you don't have any immediate professional aspirations (e.g. you just want to learn some things, and you aren't necessarily trying to get A Cyber Security Job TM within the next three months or w/e), and that you don't know much about any specific programming/computering domain yet.
(stuff under cut because long)
first i'd probably just try to pick some interesting problem that you think you can solve with tech. this doesn't need to be a "hacking" project at first; i was just messing around with computers for ages before i did anything involving security/exploitation.
if you don't already know how to program, you should ideally pick a problem you can solve via programming. for instance: i learned a lot back in the 2000s, when play-by-post forum RPGs were in vogue. see, i'd already been messing around, building my own personal sites, first just with HTML & CSS, and later on with Javascript and PHP. and i knew the forum software everyone used (InvisionPowerBoard) was written in PHP. so when one of the admins at my RPG complained that they'd like the ability to set multiple profile pictures, i was like, "hey i'm good at programming, want me to create a mod to do that," and then i just... did. so then they asked me to program more features, and i got all the sexy nerd cred for being Forum Mod Queen, and it was a good time, i learned a lot.
(i also got to be the person who was frantically IMed at 2am because wtf the forum is down and there's an inscrutable error, what do??? basically sysadmining! also, much less sexy! still, i learned a lot!)
the key thing is that it's gotta be a problem that's interesting to you: as much as i love making dorky sites in PHP, half the fun was seeing other people using my stuff, and i think the era of forum-based RPGs has passed. but maybe you can apply some programming talents to something that you are interested in—maybe you want to make a silly Chrome extension to make people laugh, a la Cloud to Butt, or maybe you'd like to make a program that converts pixel art into cross-stitching patterns, maybe you want to just make a cool adventure game on those annoying graphing calculators they make you use in class, or make a script for some online game you play, or make something silly with Arduino (i once made a trash can that rolled toward me when i clapped my hands; it was fun, and way easier than you'd think!), whatever.
i know a lot of hacker-types who got their start doing ROM hacking for video games—replacing the character art or animations or whatever in old NES games. that's probably more relevant than the PHP websites, at least, and is probably a solid place to get started; in my experience those communities tend to be reasonably friendly to questions. pick a small thing you want to do & ask how to do it.
also, a somewhat unconventional path, but—once i knew how to program a bit of Python, i started doing goofy junk, like, "hey can i implemented NamedTuple from scratch,” which tends to lead to Python metaprogramming, which leads to surprising shit like "oh, stack frames are literally just Python objects and you can manually edit them in the interpreter to do deliberately horrendous/silly things, my god this language allows too much reflection and i'm having too much fun"... since Python is a lot of folks' first language these days, i thought i'd point that out, since i think this is a pretty accessible start to thinking about How Programs Actually Work under the hood. allison kaptur has some specific recommendations on how to poke around, if you wanna go that route.
it's reasonably likely you'll end up doing something "hackery" in the natural course of just working on stuff. for instance, while i was working on the IPB forum software mods, i became distressed to learn that everyone was using an INSECURE version of the software! no one was patching their shit!! i yelled at the admins about it, and they were like "well we haven't been hacked yet so it's not a problem," so i uh, decided to demonstrate a proof of concept? i downloaded some sketchy perl script, kicked it until it worked, logged in as the admins, and shitposted a bit before i logged out, y'know, to prove my point.
(they responded by banning me for two weeks, and did not patch their software. which, y'know, rip to them; they got hacked by an unrelated Turkish group two months later, and those dudes just straight-up deleted the whole website. i was a merciful god by comparison!)
anyway, even though downloading a perl script and just pointing it at a website isn't really "hacking" (it's the literal definition of script kiddie, heh)—the point is i was just experimenting a lot and trying a lot of stuff, which meant i was getting comfortable with thinking of software as not just some immutable relic, but something you can touch and prod in unexpected ways.
this dovetails into the next thing, which is like, just learn a lot of stuff. a boring conventional computer science degree will teach you a lot (provided you take it seriously and actually try to learn shit); alternatively, just taking the same classes as a boring conventional computer science degree, via edX or whatever free online thingy, will also teach you a lot. ("contributing to open source" also teaches you a lot but... hngh... is a whole can of worms; send a follow-up ask if you want that rant.)
here's where i should note that "hacking" is an impossibly broad category: the kind of person who knows how to fuck with website authentication tokens is very different than someone who writes a fuzzer, who is often quite different than someone who looks at the bug a fuzzer produces and actually writes a program that can exploit that bug... so what you focus on depends on what you're interested in. i imagine classes with names like "compilers," "operating systems," and "networking" will teach you a lot. but, like, idk, all knowledge is god-breathed and good for teaching. hell, i hear some universities these days have actual computer security classes? that's probably a good thing to look at, just to get a sense of what's out there, if you already know how to program.
also be comfortable with not knowing everything, but also, learn as you go. the bulk of my security knowledge came when i got kinda airdropped into a work team that basically hired me entirely on "potential" (lmao), and uh, prior to joining i only had the faintest idea what a hypervisor was? or the whole protection ring concept? or ioctls or sandboxing or threat models or, fuck, anything? i mostly just pestered people with like 800 questions and slowly built up a knowledge base, and remember being surprised & delighted when i went to a security conference a year later and could follow most of the talks, and when i wound up at a bar with a guy on the xbox security team and we compared our security models a bunch, and so on. there wasn't a magic moment when i "got it", i was just like, "okay huh this dude says he found a ring-0 exploit... what does that mean... okay i think i got that... why is that a big deal though... better ask somebody.." (also: reading an occasional dead tree book is a good idea. i owe my firstborn to Robert Love's Linux Kernel Development, as outdated as it is, and also O'Reilly's kookaburra book gave me a great overview of web programming back in the day, etc. you can learn a lot by just clicking around random blogs, but you’ll often end up with a lot of random little facts and no good mental scaffolding for holding it together; often, a decent book will give you that scaffolding.)
(also, it's pretty useful if you can find a knowledgable someone to pepper with random questions as you go. finding someone who will actively mentor you is tricky, but most working computery folks are happy to tell you things like "what you're doing is actually impossible, here's why," or "here's a tutorial someone told me was good for learning how to write a linux kernel module," or "here's my vague understanding of this concept you know nothing about," or "here's how you automate something to click on a link on a webpage," which tends to be handier than just google on its own.)
if you're reading this and you're like "ok cool but where's the part where i'm handed a computer and i gotta break in while going all hacker typer”—that's not the bulk of the work, alas! like, for sure, we do have fun pranking each other by trying dumb ways of stealing each other's passwords or whatever (once i stuck a keylogger in a dude's keyboard, fun times). but a lot of my security jobs have involved stuff like, "stare at this disassembly a long fuckin' time to figure out how the program pointer got all fucked up," or, "write a fuzzer that feeds a lot of randomized input to some C++ program, watch the program crash because C++ is a horrible language for writing software, go fix all the bugs," or "think Really Hard TM about all the settings and doohickeys this OS/GPU/whatever has, think about all the awful things someone could do with it, threat model and sandbox accordingly." occasionally i have done cool proof-of-concept hacks but honestly writing exploits can kinda be tedious, lol, so like, i'm only doing that if it's the only way i can get people to believe that Yes This Is Actually A Problem, Fix Your Code
"lua that's cool and all but i wanted, like, actual links and recommendations and stuff" okay, fair. here's some ideas:
microcorruption: very fun embedded security CTF; teaches you everything you need to know as you're doing it.
cryptopals crypto challenges: very fun little programming exercises that teach you a lot of fundamental cryptography concepts as you're going along! you can do these even as a bit of a n00b; i did them in Python for the lulz
the binary bomb lab is hilariously copied by, like, so many CS programs, lol, but for good reason. it's accessible and fun and is the first time most people get to feel like a real hacker! (requires you know a bit of C beforehand)
ctftime is a good way to see when new CTFs ("capture the flag"s; security-focused competitions) are coming up. or, sometimes CTFs post their source code, so you can continue trying them after the CTF is over. i liked Stripe's CTFs when they were going, because they focused on "web stuff", and "web stuff" was all i really knew at the time. if you're more interested in staring at disassembly, there's CTFs focused on that sort of thing too.
azeria has good ARM assembly & exploitation tutorials
also, like, lots of good talks out there; just watching defcon/cansecwest/etc talks until something piques your interest is very fun. i'd die on a battlefield for any of Christopher Domas's talks, but he assumes a lot of specific x86/OS knowledge, lol, so maybe don’t start with that. oh, Julia Evans's blog is honestly probably pretty good for just learning a lot of stuff and really beginner-friendly?
oh and wrt legality... idk, i haven't addressed it here since it hasn't come up in my own work much, tbh. if you're just getting started you're kind of unlikely to Break The Law without, y'know, realizing maybe you're doing something a bit gray-area? and you can cross that bridge when you come to it? Real Hacking TM is way more of a pain-in-the-ass than doing CTFs and such, and you'll learn way more with the latter, so who cares lol just do the fun thing
21 notes
·
View notes
Text
[Something awesome] iteration #3
For this iteration, I would like to update my progress about setting up raspberry pi and installing necessary software in performing my facial recognition door knob system.
Firstly, I ordered all the component from this website. Then I just knew that UNSW CREATE society has an official website that can make an order as well. I should have ordered from it because the basic kit including fundamental components such as power adapter and sd-card are a bit cheaper.
And once everything has arrived, this is how it looks like. 2 wires on the right side are power adapter and HDMI connecting to monitor and the rest 2 on other side are for mouse and keyboard
Setting up and Software installation
Fortunately, the website I order it provided my an OS installed inside SD card, so I did not need to worry about installing it myself. This operating system is linex-based called Raspbian, which is easy for us to use because I had thought that I had to deal with some lower-level os as this is my first time working on raspberry pi.
Next step is to install all the important software or modules including python3, numpy and openCV, to run my Haar-cascade facial detection program (implemented in python) from my previous iteration.
As Raspbian has python2 and python3 installed with a given os. So i could skip this part. Additionally, numpy is very easy to install by executing this command.
sudo apt-get install python3-numpy
The most difficult part that I spent almost 3 hours is openCV module. With the several trails and error in trying to install it. I ended up reinstalling os to reset all the messy installation 2 times before found a good resource guiding me to finish my installation. The links are provided below
How to install openCV in raspberry pi
Video tutorial
Warning of step 7
STEP 7 cd ~/opencv-3.4.1/ mkdir build cd build cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.4.1/modules \ -D ENABLE_PRECOMPILED_HEADERS=OFF \ -D BUILD_EXAMPLES=ON ..
Be aware of step 7 in the given link, make sure you execute command perfectly correct because it would make opencv_contrib module installation fail and you might have to repeat all the steps from 7 again (it takes 2 hours to finish step 9 due to the computational performance of raspberry pi 3 model b+).
opencv_contrib is an extension part of openCV including advanced tools such as face prediction which is very important in our project.
Once everything has finished, it should be able to import openCV module in python code and check its version
Testing camera with openCV module
To make sure that openCV module I installed is correct and an external 5m camera connecting to the board can work correctly, so I need only a simplest program that can check the module and the camera at the same time.
After searching through an internet, I found a nice resource creating program in taking photo through external camera on raspberry pi. I spent a couple of hours working on it and created a simple program to take a photo from the camera through openCV. This program is just taking a photo and storing it as JPEG in a given directory and here is the result of the iteration today.
Video of camera testing
My resource for making this test program
2 notes
·
View notes
Text
30 days of Python: 3/30
My study spot today:

I am progressing veeeeery slowly through this challenge, haha. I don’t think I’ve managed two days in a row since I started :X But “slow but steady wins the race”, and I’ve learned by now that sticktoitiveness is more important than glamorous study habits.
The other day, as I approached the end of Step 1 of the tutorial, I ran into a challenge. Lynn suggests going and finding your own data and using the new function you’ve just created to process it as well. So I found some data on real estate transactions in Sacramento (thrills and chills, I know – but the point is to graph it and so on, it doesn’t need to be super interesting), and gave it a shot.
But the command line didn’t like my new file, and spat out this error message at me: “_csv.Error: new-line character seen in unquoted field”
I’ll be the first to admit that I do get intimidated by reading the docs, and I realized the problem here was clearly my lack of understanding of the Python csv module I was working with. There’s no point in just copying out every line of the tutorial by hand if you don’t really understand what you’re doing.
So, I copied the error message and pasted it into Google, found a StackOverflow conversation about that exact error, and one person suggested “opening the file using universal newline mode”. I had no idea what this meant, so I took a deep breath and dove into the docs. After spending a few minutes reading them, I felt much more motivated – it’s not as scary as it looks! I found a description of the exact parameters that the csv.reader() method takes, messed around with a little trial and error – and it worked! I was absolutely thrilled to see my huge ugly flood of real-estate data appear in the command line :D
I still want to try the “extra credit” challenges she mentions at the very end of the page, although they’d be a big step up:
“You can continue to play around; try >>> help(parse.parse) to see our docstring, see what happens if you feed the parse function a different file, delimiter, or just a different variable. Challenge yourself to see if you can create a new file to save the parsed data, rather than just a variable.”
#thirtydaypythonchallenge#thirtydayprogrammingchallenge#stemblr#women in stem#women who code#chiseling away#read the docs#python#data viz#return to this
3 notes
·
View notes
Text
Beginner to Advanced Debugging in Python
What is Debugging in Python?
Developers often find themselves in situations where the code they’ve written is not working quite right. When that happens, a developer debugs their code by instrumenting, executing and inspecting the code to determine what state of the application does not match the assumptions of how the code should be correctly running.
There has never been an unexpectedly short debugging period in the history of computers.
In general, Debugging is the process of identifying and fixing errors or defects in software code, hardware, or any other system. It involves examining the program’s behavior and identifying the root cause of any errors or unexpected behavior that occur.
The goal of debugging is to identify and resolve issues that prevent the software or system from functioning correctly. This involves analyzing the code, inspecting variables and data structures, and testing different scenarios to determine the cause of the error. Once the root cause of the problem is identified, developers can make changes to the code to fix the issue.
Now specific for python language, A debugger is a program that can help you find out what is going on in a computer program. You can stop the execution at any prescribed line number, print out variables, continue execution, stop again, execute statements one by one, and repeat such actions until you have tracked down abnormal behavior and found bugs.
How does the debugging process work?
1. Error identification
2. Error analysis
3. Fix and validation
Conclusion
In this blog, we covered a few basic and common uses of debugging with examples:
- types of errors where you can use debugging
- common techniques for debugging like printing expressions
- explored python debugger module (pdb)
- commands used during debugging mode
- stepping through code in Pycharm IDE
- using breakpoints
- modifying values in-between execution of code
- displaying expressions
- displaying values at different point in code execution
Originally published by: Beginner to Advanced Debugging in Python
#Debugging in Python#codinglife#advanced#beginners guide#writing#pythondevelopment#What is Debugging in Python?#Python Debugger#Displaying Expressions
0 notes
Text
Why learning unit testing is important in Python
Have any idea what is a unit test? The term unit test refers to a code section developed to test other areas of code, often a single function or method. They are a key step in software development because they guarantee that code functions as intended and proactively identifies flaws. You will frequently have to update particular modules and refactor code as necessary when working on a big project. However, if another module relies on the changed module, such modifications may have unintended effects. Sometimes, this can render current functionality useless. Unit tests allow you to verify that small, isolated units of code work as intended and will enable you to correct inconsistencies resulting from updates and refactoring. Additionally, testing is a great practice that can save time and resources by identifying and resolving errors before they become significant concerns. Here will see in detail:
Facilitates safe refactoring
You can add features to the program throughout the SDLC, which results in modifications to the code if you employ CI/CD procedures in your project development. Developers verify each unit for defects, correct errors, and connect tested units to other product components during unit testing, simplifying and increasing the coding process's agility.
Improves the quality of code
Unexpected edge cases are the cause of many errors in software development. You can eventually run into a severe bug in your application if you forget to anticipate even one input. When writing unit tests, you carefully consider all the edge situations for each function in your application. The functions receive various inputs, and you make sure they act as you anticipate. You should consider the design and what it needs to do before writing the code. As a result, your code will be cleaner and easier to maintain because even the most minor feature of your program matters. A code that is easier to alter and maintain is always simpler to understand by completing the python certification online.
Provides quick access to code documentation
Unit testing offers system documentation that enables developers to understand what features are offered by a unit and how to use them. Any software engineer who needs to know what features a module offers and how to use it may look at the unit tests to gain a general idea of the module's interface, which is highly helpful in the event of a developer change.
Reduces costs
The price of finding, identifying, and fixing a mistake on a unit level of software testing is far cheaper than the price of doing the same on other levels of software testing. When faults are found later, it typically necessitates several system modifications and a time and money investment. Unit testing minimizes costs by cutting down on development time.
Catch your coding errors faster
You can detect issues quickly if you undergo the best online python course on a reputable platform. This may occasionally take place before your exams are completed. You discover that your function doesn't perform exactly as you expected it to or outputs data in a different structure than you anticipated as you construct a test while considering the input and output data's intended appearance.
A test that fails will certainly expose problems as well. Sometimes the issues are with the way your function handles the data. In other cases, it is an excellent realization that your function is not performing as expected. This is particularly useful when working with huge python data frames or other intricate data structures.
Secure from breaking your code when you update
Have you ever returned to your code a year later to make a minor modification, only to find that it has suddenly stopped working? You may use unit testing to ensure your code produces the desired results even after changes. This can be especially helpful if you are requested to update code written by someone else or that you authored years ago. Once you have developed some tests against the original code, you can make modifications without being concerned that you are overlooking a cleverly subtle edge case.
Final Thoughts
Python is one of the best booming languages most businesses have been using recently. Along with Python, you can learn the unit test. The above-mentioned are the points you can consider why learning unit testing is necessary for Python.
0 notes