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
File details
Details for the file ros-code-modules-2.0.0.24.tar.gz
.
File metadata
- Download URL: ros-code-modules-2.0.0.24.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.3.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f609654a3905150717e97c66a3b9f6e44171905c885bd9eeb5f0051fae04440c |
|
MD5 | 041175ce67063298421609633609be09 |
|
BLAKE2b-256 | b97971fc097b04eca620ff8264553af7ca74960f46156519c5d0a04b5595a2d9 |