Thanks for your kind reply! Yes you are right I running two scripts. I got your point and you are right but my problem is to savde string which is coming from client script. How I can do this? here is my code:
client.py client.service.is_valid_user('121ABC',2) server.py def get_user(uid, vid): vertical_id = vid user_id = uid print user_id Now how can i save uid in user_id variable. I use print and it is showing perfectly in terminal. I just read that typecast is done by default in python/django. On Apr 1, 5:31 pm, bruno desthuilliers <bruno.desthuilli...@gmail.com> wrote: > On 1 avr, 16:12, sim <imasim...@gmail.com> wrote: > > > Hello, > > I am new to Python/Django and working on web services. > > I have two files client and server both running on different ports > > I assume you mean "two scripts" ? > > > and > > working as client server. Problem is this: When I send a string say > > '121ABC' from client as parameter to server file, it catch perfectly > > but when I assign to any veriable it raise this error " Server raised > > fault: 'invalid literal for int() with base 10: '211ABC' ' ". > > > Please help in this regard. If there is anything missing please let me > > know. > > As usual : *minimal* working code reproducing the behaviour, full > traceback, and eventually test data sets. > > Anyway: you say "when I assign to any veriable it raise this error", > but given the error message, it looks like you're doing something like > this: > > param = "121ABC" > var = int(param) > > Now please reread the error message and ask yourself whether "ABC" is > a meaningful textual representation of a base 10 integer ? Hint : no, > Python *won't* silently skip the non numeric characters here and try > to build the int from the remaining numeric characters. > > HTH -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.