Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

Thursday 17 June 2021

How to make a text in python colorfull.





#how to make a text in python colorfull. 
#clcoding
print("\033[92mIf you like this post, Upvote it")    
print("\033[96mIf you like this post, Upvote it")    
print("\033[93mIf you like this post, Upvote it")    
print("\033[95mIf you like this post, Upvote it")    
print("\033[1mIf you like this post, Upvote it")    
print("\033[4mIf you like this post, Upvote it")    
print("\033[94mIf you like this post, Upvote it")  


Join us: https://t.me/jupyter_python Like us: https://www.facebook.com/pirawenpython

How to use class and method without creating object




#How to use class and method without creating object

#clcoding

class fruit:

    def is_sweet():

        return True
    
if fruit.is_sweet():
        print("Yes")
else:
        print("No")




Join us: https://t.me/jupyter_python

How do you find which string largest between two strings?



#HOW TO WHICH STRING IS LARGEST BETWEEN TWO STRINGS


#clcoding

str1 = 'Clcoding'

str2 = 'ClcodingPython'

max(str1,str2)





#HOW TO WHICH STRING IS LARGEST BETWEEN TWO STRINGS

#clcoding

str1 = 'Clcoding'

str2 = 'ClcodingPython'

if str1>str2:

    print(str1,'is the largest string')

else:

    print(str2,'is the largest string')




Join us: https://t.me/jupyter_python Like us: https://www.facebook.com/pirawenpython

Sunday 23 May 2021

Sunday 2 May 2021

Conversion of Hex, Oct, Bin numbers from integer using python


Code: 

#Convert into HEX
print('{:X}'.format(199))

#Convert into OCT
print('{:o}'.format(199))

#Convert into Binary
print('{:b}'.format(199))

#Convert into Grey
print('{:g}'.format(199))





Join us: https://t.me/jupyter_python

Friday 23 April 2021

Print Color text in Python

Code: 

#clcoding
print("\033[1;37;48m Python \n")
print("\033[1;36;48m Python \n")
print("\033[1;35;48m Python \n")
print("\033[1;34;48m Python \n")
print("\033[1;33;48m Python \n")
print("\033[1;32;48m Python \n")
print("\033[1;31;48m Python \n")








Join us: https://t.me/jupyter_python

Friday 13 November 2020

Webscrapping of matlabcoding.com website using python with complete code

Webscrapping of matlabcoding.com website t get the latest post published by the website.  In this code bs4 is used. 

Using BeautifulSoup and Telegram, All the new post are updated in our telegram channel. 

for any doubt please do comment. 

Complete python code: 

import requests from bs4 import BeautifulSoup page = requests.get("https://www.matlabcoding.com") soup = BeautifulSoup(page.content, 'html.parser') x = soup.find('div',id="content-wrapper") y = x.find('div',class_="post-outer") z = y.find('a',href=True) msg = z['href'] import telegram chat_id =-1001454266592 token_id = '1428056219:AAHN7iwCdMC9tNKjH-3HK2Y0Hx8uloMqSAk' def send(msg,chat_id=chat_id,token=token_id): bot = telegram.Bot(token=token_id) bot.sendMessage(chat_id=chat_id,text=msg) send(f"New Matlab udate on matlabcoding.com : {msg}")







Telegram: https://t.me/clcoding_python

Thursday 5 November 2020

Sunday 1 November 2020

Python Code for CORONA Updates on Telegram





#Python Code for CORONA Updates on Telegram
from bs4 import BeautifulSoup 
import requests  
import pandas as pd 
x=[] 
x1=[] 
source=requests.get('https://www.worldometers.info/coronavirus/country/india/').text 
soup=BeautifulSoup(source,'lxml') 
z=soup.find_all('div',id='maincounter-wrap') 
z1=soup.find_all('div',class_='maincounter-number') 
 
for k in z: 
    y=k.h1.text 
    x.append(y) 
 
for i in z1: 
    y1=i.span.text 
    x1.append(y1) 
     
df=pd.DataFrame(x1,x,['Number']) 
df.head() 

import telegram
chat_id = 957639882
token_id = '1339570026:AAE39zN86JK6mxgAGpkJo876Mq75IQW5WZU'
def send(msg,chat_id=chat_id,token=token_id):
    bot = telegram.Bot(token=token_id)
    bot.sendMessage(chat_id=chat_id,text=msg)
    
send(f" Todays's Corona Update:\n{df}")


Telegram: https://t.me/clcoding_python

Sunday 31 May 2020

User defined function | Python | part 2

Saturday 30 May 2020

User defined function | Python | part 1



Friday 29 May 2020

Logistic Regression in python (part02) | python crash course08

Logistic Regression in python (part02) :

Hello friends, in the previous post we see input data processing methods. In this post we are going to see How create an Array and How to split data into train,test model. Let's start:
We have about forty-Two thousand and odd record. If we use this entire data for model building, we will not left with any data for testings. So generally, we split the entire data set into two part, say 60/40 percentage. We use 60% of the data for model building and the rest for testing the accuracy in prediction of our created model. You may use a different splitting ratios as per your requirements.

Creating Feature Array:

Before we spliting the data, we separate out the data into two array X and Y. The X arrays contain all the feature that we want to analyzed and Y arrays is a single dimensional arrays of boolean value that is the outputs of the prediction. To understand this, let us run some codes.
 Execute the following Python statements to create the X array −
In [06]: X = data.iloc[:,1:]
To examine the content of X use head to print a few initial record. The following screen show the contents of the X arrays.
In [07]: X.head ()
Initial Records
The arrays has several row and column.
Next, we will be create output array containing “y” value.

Creating Outputs Array:

To create an array for the predicted values columns, use the following Python statements−
In [08]: Y = data.iloc[:,0]
Examine its content by calling head. The screen outputs below show the results −
In [09]: Y.head()
Out[09]: 0   0
1    0
2    1
3    0
4    1
Name: y, dtype: int64
Now, splits the data using the following commands −
In [10]: X_train, X_test, Y_train, Y_test = train_test_split(X, Y)
This will be create the four array called X_train, Y_train, X_test, and Y_test. As before, you may examine the content of these array by using the head commands. We will use X_train and Y_train array for training our models and X_test and Y_test array for testing and validating.
Next Step to built Classifier We will see this into it in the next chapter.
                                                        BEST OF LUCK!!!!

Wednesday 27 May 2020

Professional Python® Frameworks: Web 2.0 Programming with Django® and TurbogearsTM (Programmer to Programmer) Paperback – 16 October 2007 by Dana Moore (Author), Raymond Budd (Author), William Wright (Author)

As two of the leading MVC web frameworks for Python, Django and TurboGears allow you to develop and launch sites in a fraction of the time compared to traditional techniques and they provide greater stability, scalability, and management than alternatives. Packed with examples, this book will help you discover a new methodology for designing, coding, testing, and deploying rich web applications.

A team of expert authors shows you the power of MVC frameworks and the capabilities of the TurboGears and Django packages. The Django chapters show you how to automate production of common web development tasks, portal creation, and content management, so you can focus on higher–level application issues and design. The TurboGears chapters illustrate how to rapidly create modern, highly interactive Web 2.0 applications. For both frameworks, you′ll create useful applications that exemplify common Web 2.0 design paradigms and their solutions. Ultimately, you′ll leverage your Python skills using Django and TurboGears and go from novice to RIA expert.

What you will learn from this book

∗ How you can use frameworks to save you time and frustration in the development cycle


The elements, differences, and similarities of the TurboGears and Django frameworks


Advanced capabilities of both frameworks and how they easily solve issues common to web applications


Approaches to simplifying your client side JavaScript(r) with MochiKit, a Pythonic JavaScript library


How to pair TurboGears with Flash for even more possibilities

Who this book is for

This book is for Python developers who want to learn rapid Web 2.0 development techniques using frameworks and incorporating a model–view–controller architecture.

Wrox Professional guides are planned and written by working programmers to meet the real–world needs of programmers, developers, and IT professionals. Focused and relevant, they address the issues technology professionals face every day. They provide examples, practical solutions, and expert education in new technologies, all designed to help programmers do a better job.

Buy: Professional Python® Frameworks: Web 2.0 Programming with Django® and TurbogearsTM (Programmer to Programmer) Paperback – 16 October 2007 by Dana Moore (Author), Raymond Budd (Author), William Wright (Author)

PDF Download:
 

Color Transforms | Image Handling | Python

Check this link to explore more: https://pillow.readthedocs.io/en/3.1.... Python for beginners: https://www.youtube.com/watch?v=egq7Z...




Telegram: https://t.me/clcoding_python https://www.facebook.com/pirawenpython/ https://www.facebook.com/groups/pirawenpython/

Popular Posts

Categories

AI (27) Android (24) AngularJS (1) Assembly Language (2) aws (17) Azure (7) BI (10) book (4) Books (113) C (77) C# (12) C++ (82) Course (60) Coursera (176) coursewra (1) Cybersecurity (22) data management (11) Data Science (85) Data Strucures (6) Deep Learning (9) Django (6) Downloads (3) edx (2) Engineering (14) Excel (13) Factorial (1) Finance (5) flutter (1) FPL (17) Google (18) Hadoop (3) HTML&CSS (46) IBM (25) IoT (1) IS (25) Java (92) Leet Code (4) Machine Learning (43) Meta (18) MICHIGAN (4) microsoft (3) Pandas (3) PHP (20) Projects (29) Python (726) Python Coding Challenge (170) Questions (2) R (70) React (6) Scripting (1) security (3) Selenium Webdriver (2) Software (17) SQL (40) UX Research (1) web application (8)

Followers

Person climbing a staircase. Learn Data Science from Scratch: online program with 21 courses