Comments (7)
Does python allow variables or keywords to have -
in them ?
from librouteros.
Hyphen is used as the subtraction operator, impossible to pass as kwargs
from librouteros.
Is there any way to bypass this issue ?
I tried
security_profiles.add(**{authentication-types ='wpa-psk, wpa2-psk',
eap-methods='',
management-protection='allowed',
mode='dynamic-keys',
name='name',
supplicant-identity='',
wpa-pre-shared-key='pass',
wpa2-pre-shared-key='pass'
})
based on https://stackoverflow.com/questions/24121279/python-keyword-arguments-with-hyphen but I get an error:
^
SyntaxError: invalid syntax
from librouteros.
You have add SyntaxError
from librouteros.
I don't know if it will work, but as Python basics.
try:
security_profiles.add(**{'authentication-types' : 'wpa-psk, wpa2-psk',
'eap-methods' : '',
'management-protection' : 'allowed',
...
Its common pass a dict instead of kwargs, if there's problems of syntaxis like that.
...but api must be compatible
from librouteros.
@trojek If impossible to call add method as a dict like update... you can do a trick:
can you add a security profile only with a name ?
Then....update this new entry with dict like documentation
from librouteros.
Solution provied by @gil-obradors works.
I don't know if it will work, but as Python basics.
try:
security_profiles.add(**{'authentication-types' : 'wpa-psk, wpa2-psk', 'eap-methods' : '', 'management-protection' : 'allowed', ...
Its common pass a dict instead of kwargs, if there's problems of syntaxis like that.
...but api must be compatible
from librouteros.
Related Issues (20)
- How to use set method? HOT 3
- Add membership operator for query HOT 1
- Add count method for query
- Use prepared docker image for CI HOT 1
- API incompatibility and print method HOT 3
- Dependabot couldn't authenticate with https://pypi.org/simple/
- How to use max-limit= in this api HOT 5
- Arbitrary command implementation HOT 1
- Arbitrary command implementation HOT 1
- Am i doing it right? or its a bug HOT 7
- Bug Query Logical operators Or HOT 3
- Unicode in DHCP comments HOT 2
- RouterOS 7 and wifiwave2 instead of wireless HOT 3
- Licensing question HOT 9
- OSPF passive checkbox HOT 2
- Use poetry-bumpversion
- Add REST API support
- remove/optional automatic type conversion HOT 9
- I need to save the result of a query in a variable HOT 1
- Be able to "filter()" without specifying props in "select()" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from librouteros.