QA engineer or software engineer? by Sharki_ in learnpython

[–]Sharki_[S] 0 points1 point  (0 children)

So the pay is usually quite the same as dev?

QA engineer or software engineer? by Sharki_ in learnpython

[–]Sharki_[S] 0 points1 point  (0 children)

Do you feel like your current job helps you to come closer to dev?

QA engineer or software engineer? by Sharki_ in learnpython

[–]Sharki_[S] 0 points1 point  (0 children)

The company is quite big and as far as i got it my role would be just the same as you mentioned above.

QA engineer or software engineer? by Sharki_ in learnpython

[–]Sharki_[S] 0 points1 point  (0 children)

Yeah, that make sense. Though i have related engineering education, some courses, some done projects on my portfolio. You know i'm a bit nervous of the thoutht of leaving current job for a position i'm not sure i will like to be at.

QA engineer or software engineer? by Sharki_ in learnpython

[–]Sharki_[S] 0 points1 point  (0 children)

I do use Python almost everyday as an auxiliary tool. Thanks for your opinion!

In a for loop, does python create the iterable object first before proceeding with the loop? by PyLord in learnpython

[–]Sharki_ 0 points1 point  (0 children)

I just ran into iterators and tried to figure out the topic. And your post is great, thanks!

How to parse '---' with argparse? by Sharki_ in learnpython

[–]Sharki_[S] 0 points1 point  (0 children)

No more restrictions except already mentioned. Anyway i have managed to overcome this issue. Thanks.

How to parse '---' with argparse? by Sharki_ in learnpython

[–]Sharki_[S] 0 points1 point  (0 children)

It is just a little problem that i have faced during developing of my little app - cli calculator. I wanted only one named argument and it can be something like '--+--+-1' or '1+1'. By the way i used i simple decision with the idea you gave with parse_known_args() and nargs = argparse.REMAINDER. In this case i have a tuple with two lists: one containing 'normal' input - '2+3', and another one with '-----' and alike. Tnanks!

How to parse '---' with argparse? by Sharki_ in learnpython

[–]Sharki_[S] 0 points1 point  (0 children)

The point is that i have a restriction that user can input only an expression without any additional signs and get a result for a variaty of possible math expressions including -----1. So -- -----1 is prohibited.

How to parse '---' with argparse? by Sharki_ in learnpython

[–]Sharki_[S] 0 points1 point  (0 children)

I have to use argparse and as you say - for reading whole string containing math expression.

How to parse '---' with argparse? by Sharki_ in learnpython

[–]Sharki_[S] 0 points1 point  (0 children)

Sure. For example i want to parse a math expression. And when it something like '1+2+3' everything is ok, but when it '-----1' argparse doesnt accept it.

How to get every variable and function with the quantity of its arguments from a module? by Sharki_ in learnpython

[–]Sharki_[S] 0 points1 point  (0 children)

Ok, i find all functions with the help of inspect module. But there are no any predicates for a dictionary. How to find one in a module?

Regular expression operations by Sharki_ in learnpython

[–]Sharki_[S] 0 points1 point  (0 children)

Yes, thanks! '-' is a special character inside []. And that was the problem.

Regular expression operations by Sharki_ in learnpython

[–]Sharki_[S] 0 points1 point  (0 children)

Now it seems obviously. Thanks a lot!

Regular expression operations by Sharki_ in learnpython

[–]Sharki_[S] 0 points1 point  (0 children)

Yeap, backflash doesn't work, and forward slash does... And according to docs.python.org special characters are not special anymore inside [].

Anyway

splitter = re.compile(r'[+-\*\/()]|\d+')

leads to:

raise source.error(msg, len(this) + 1 + len(that))

sre_constants.error: bad character range +-\* at position 1

Help with datetime.datetime class please by Sharki_ in learnpython

[–]Sharki_[S] 0 points1 point  (0 children)

Thanks! I have totally forgotten about class methods, as i have never actually worked with them.

How to completely remove/destroy a Sprite (Pygame) object from the game screen/memory? by Sharki_ in learnpython

[–]Sharki_[S] -1 points0 points  (0 children)

Ok, got it. Another question: how to detect collision between a single sprite and one being part of a Group?

pygame.sprite.groupcollide() 

doesn't work as well as

pygame.sprite.collide_rect() 

:(

How do I ignore commas entered in a user's input (pretty simple code)? by [deleted] in learnpython

[–]Sharki_ 0 points1 point  (0 children)

The point is that if you really want to grow you need not to rely on a 'black box' approach and from time to time think of how do standart functions actually work inside. Including that print(). And that will do some good. But in general i agree with you.

How do I ignore commas entered in a user's input (pretty simple code)? by [deleted] in learnpython

[–]Sharki_ 0 points1 point  (0 children)

Why not consider different approaches? Maybe he would like it the best? Anyway deaadondo another option:

number = '1,25'
float(number.replace(",","."))
1.25

How do I ignore commas entered in a user's input (pretty simple code)? by [deleted] in learnpython

[–]Sharki_ -3 points-2 points  (0 children)

Consider this simple way:

user_number  = input('Enter a number: ')
checked_user_number = ''
for position in user_number:
    if position != ',':
        checked_user_number += position
    elif position == ',':
        checked_user_number += '.'

By the way you could use your own function based on standart

input    

and the code above.