A Python module/library containing lots of tools to simplify Python development.
Project description
Thank you for installing the modules of ROS Code.
The installation adds these (view unminified) files in a folder called ros
in your Python site-packages
directory.
You can use any commands exposed in that directory
Here's an example:
This is how you'd normally check if a number is a prime one.
You'd have to create a new function and add a docstring so Python will recognize it when a user executes the pydoc
command.
Then you'll need to ask for the user's input and execute the command.
def isprime(number):
"""
Check if a number is a prime number
number:
The number to check
"""
if number == 1:
return False
for i in range(2, int(number**0.5) + 1):
if number % i == 0:
return False
return True
if isprime(input("Enter a number to check for prime: ")):
print("It is prime!")
else:
print("It isn't prime!")
With ROS Code, you can simplify this task:
from ros.main import isprime
if isprime(input("Enter a number to check for prime: ")):
print("It is prime!")
else:
print("It isn't prime!")
You can find more tasks which you can simplify related to maths, strings and more here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for ros-code-modules-2.0.0.18.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf44d93daa56da77e65d68c424abfba1762f89eedae327773f8c59b4dcf103f1 |
|
MD5 | 80935ed4e45554a23332f2c519434a46 |
|
BLAKE2b-256 | 0e8cfb9f9647e7be8c7f3323a2f0c3c7f35ce45257cb07ba31b837089935a712 |