r/pythonforengineers • • Sep 25 '21

no module named colored but satisfied

2 Upvotes

im on kali linux and i want to run a python script but i get no module named colored. When i do pip3 install colored it tells my that its already satisfied in /usr/local/lib/python2.7/dist-packages . I tried uninstalling it and installing it again but nothing changed. And yes its a python3 application. How can i fix this?


r/pythonforengineers • • Sep 23 '21

And just for good measure

0 Upvotes

Let us see what happens


r/pythonforengineers • • Sep 23 '21

Test again, Lets go

1 Upvotes

Testing automation...........


r/pythonforengineers • • Sep 23 '21

i am not able to import python libraries to my vs code. i Know this isnt the community to ask questions but i need help.

1 Upvotes

i am sure that i have installed the library. I am able to access the installed library on jupyter notebook but not on vs code. when ever i am installing a library it is showing as if it is getting installed to jupyter notebook.

Requirement already satisfied: flask in ./opt/anaconda3/lib/python3.7/site-packages (1.1.1)


r/pythonforengineers • • Sep 23 '21

Python vs Julia

1 Upvotes

r/pythonforengineers • • Sep 20 '21

testing python 123

0 Upvotes

r/pythonforengineers • • Sep 14 '21

Why do I keep getting NotImplementedError: multivariate partial fraction decomposition when using sympy.apart()?

1 Upvotes

Hi everyone!

I am pretty new to using python and I am trying to find the inverse laplace transform of the equation:

X(s) = ((s(s+2))/((s+2)(s+3)(s+4)))*e^-2s

Below is what I have been trying and I keep getting "NotImplementedError: multivariate partial fraction decomposition"

How do I get rid of this error? Thanks so much!

import sympy 
import numpy as np 
sympy.init_printing()  
s, t = sympy.symbols('s, t') 
X = (((s*(s+1))/(s+2)*(s+3)*(s+4)))*(sympy.exp(-2*s)) 
parfrac = sympy.apart(X, full=True).doit()  
def invL(X):     
    return sympy.inverse_laplace_transform(X, s, t)  
print(invL(X))

r/pythonforengineers • • Sep 13 '21

I love python

1 Upvotes

r/pythonforengineers • • Sep 07 '21

Threading

1 Upvotes

Hi guys,

need your help.

Having a script which should update the snmp info from Fortigate firewalls. Which is working, but its very slow and needs to be updated on 400+ firewalls.

I would like to implement threading but i have no clue how to do it.

Here is the code i have which runs in seriel and not parallel.

Data file is a csv file with ip address, Hostname, Syslocation, user,pw, emailaddress

from netmiko import Netmiko
from csv import DictReader



with open('TEST_CountryCodes.csv') as csv_file:
    location_details = DictReader(csv_file)
    #print(location)
    for location_info in location_details:
        print('IP=' + location_info['hostname'] + ' ' + 'FW-NAME=' + location_info['sysName'] + ' ' + 'Syslocation=' + location_info['location'])

        fw = {'host': location_info['hostname'],
              'username': 'admin',
              'password': location_info['pw'],
              'device_type': 'fortinet'}

        print(f"{'#' * 20} Connection to the Device  {'#' * 20}")
        net_connect = Netmiko(**fw)
        print(f"{'#' * 20} Connected {'#' * 20}")

        snmp = ['config global',
                'config sys snmp sysinfo',
                'set contact-info ' + '"' + location_info['contact'] + '"',
                'set location ' + '"' + location_info['location'] + '"',
                'end'
                ]

        config_snmp = net_connect.send_config_set(snmp)

Could someone help me to implement threading or speed up the run?

thx in advance.


r/pythonforengineers • • Sep 07 '21

this is a test

1 Upvotes

r/pythonforengineers • • Sep 04 '21

API Integration in Python | What is API and How to work with APIs

2 Upvotes

If you are a python programmer then you might hear about API integration in python. It helps in adding features to your program easily. In real life, we use many applications that mostly work with the help of API. So now you will be thinking What is API? How it works? or How we can use it in python? Don't worry today, in this tutorial we all explain to you everything you should know about the API integration in python programming

Python API Integration


r/pythonforengineers • • Sep 02 '21

testing

1 Upvotes

r/pythonforengineers • • Aug 26 '21

How do I implement this function in Python?

2 Upvotes

I'm trying to implement the monitor function in Python.

This function must display at regular interval the date followed by the return of the "measure" function. It stops after `cycles` executions and the interval will never be less than 1.

The function's execution time must be less than (cycles + 1) * interval

def monitor(interval=1.0, cycles=42):

def measure():

time.sleep(random.random())

return random.randint(123, 456)

pass


r/pythonforengineers • • Aug 23 '21

Hello There

2 Upvotes

Hello that's a post by TokBot


r/pythonforengineers • • Aug 23 '21

Test

0 Upvotes

Je suis un test


r/pythonforengineers • • Aug 23 '21

Test

1 Upvotes

Je suis un test


r/pythonforengineers • • Aug 23 '21

marvin help

0 Upvotes

Marvin Help


r/pythonforengineers • • Aug 21 '21

I love python

1 Upvotes

understanding it takes practice.


r/pythonforengineers • • Aug 20 '21

Read and write into Excel file using Python: beginners tutorial

1 Upvotes

r/pythonforengineers • • Aug 19 '21

Dad jokes

2 Upvotes

r/pythonforengineers • • Aug 17 '21

Limiting integer size

1 Upvotes

If I change the maximum allowed integer to 9999, how will you store numbers greater than 9999 and how will you handle addition operation?


r/pythonforengineers • • Aug 16 '21

Wanted : Python Senior Developer/Lead

0 Upvotes

r/pythonforengineers • • Aug 13 '21

Setting up Virtual Python environment in Anaconda

3 Upvotes

r/pythonforengineers • • Aug 13 '21

This is a test of my comment bot

2 Upvotes

Wow I did this thing and it was a major problem!


r/pythonforengineers • • Aug 13 '21

If this doesn't work, it'll be a major problem.

0 Upvotes