Re: convert script awk in python

2021-03-26 Thread Pankaj Jangid
cept: > pass > print(s) > === > > > I don't want to cram this into a python -c " " line, if it even is > possible; how do you handle indentation levels and loops?? > I agree. Perhaps we need a ‘awk’ module/package. I see that there is one in PyPI but

Re: How to implement logging for an imported module?

2021-03-07 Thread Pankaj Jangid
foo') >> logger.addHandler(ch) >> logger.setLevel(logging.DEBUG) -- Regards, Pankaj Jangid -- https://mail.python.org/mailman/listinfo/python-list

Re: How to uninstall python 2 package specifically?

2020-12-29 Thread Pankaj Jangid
Chris Green writes: > I have two (or maybe even three) versions of Click installed:- > > /usr/local/lib/python2.7/dist-packages/click > /usr/local/lib/python3.7/dist-packages/click > /usr/lib/python3/dist-packages/click > > I run [x]ubuntu. > > How can I uninstall those extra versions of click (w

[HN] How to Make Python Wait

2019-12-20 Thread Pankaj Jangid
https://news.ycombinator.com/item?id=21834408 -- https://mail.python.org/mailman/listinfo/python-list

Re: Developers are advised to purge these malicious packages

2019-12-05 Thread Pankaj Jangid
Christian Heimes writes: > On 04/12/2019 18.59, David Lowry-Duda wrote: >> I notice that "python3-dateutil" is in over 4000 github repositories >> [1]. That sounds like a disaster. >> >> [1]: https://github.com/search?q=python3-dateutil&type=Code > > At least the first pages are packaging files

Developers are advised to purge these malicious packages

2019-12-04 Thread Pankaj Jangid
second is "jeIlyfish" (the first L is an I), which mimicked the "jellyfish" library. ``` https://www.zdnet.com/article/two-malicious-python-libraries-removed-from-pypi/ Regards, -- Pankaj Jangid -- https://mail.python.org/mailman/listinfo/python-list

Re: tab replace to space 4

2019-11-28 Thread Pankaj Jangid
4 within python > code. if there is solution in google i am very sorry. In Emacs, use "M-x untabify". And "M-x tabify" if you want to do the reverse. Regards, -- Pankaj Jangid -- https://mail.python.org/mailman/listinfo/python-list

Re: Unable to retrieve data from Juypter notebook

2019-11-27 Thread Pankaj Jangid
> Any help is appreciated.. Could you please elaborate a little bit? I didn't get from where you want to retrieve data? Is this somewhere hosted? Or you want to see raw files from your own Jupyter notebook running on your own machine. Regards, -- Pankaj Jangid -- https://mail.python.org

Re: Can we use Python for hacking?

2019-11-12 Thread Pankaj Jangid
>> Someone requested my answer to the question: "Can we use Python for >> hacking?" > Sigh. I suppose it's a lost battle to reclaim that word. So true. I still remember the ESR article that I used to share twenty years ago. -- Pankaj Jangid -- https://mail.pyth

Re: Using Makefiles in Python projects

2019-11-09 Thread Pankaj Jangid
that Data Science, Machine Learning etc. fields have helped in proliferation of Python lately. And the above mentioned libraries have great role. We should make it even more easier to manage mixed native projects portably. GNU Make is the way to go. Thanks for raising this. Regards, -- Pankaj Jangid -- https://mail.python.org/mailman/listinfo/python-list

Re: Pip not available

2019-11-05 Thread Pankaj Jangid
ion, however, now this problem pops up. > [image: image.png] > Can you help me with this? > python3 -m pip install -- Pankaj Jangid -- https://mail.python.org/mailman/listinfo/python-list

Re: python -m pip install and pip install

2019-10-11 Thread Pankaj Jangid
;. >> >> You can't upgrade pip using "pip install --upgrade pip". >> > > Only a consideration on Windows. Other platforms are absolutely fine > upgrading pip either way. > Oh! I wasn't aware of this Windows thing. Thanks. -- Pankaj Jangid -- https://mail.python.org/mailman/listinfo/python-list

Re: python -m pip install and pip install

2019-10-10 Thread Pankaj Jangid
Michael Torrie writes: > On 10/10/19 1:21 AM, Pankaj Jangid wrote: >> So the scripts will just work fine if you simply use ~import pip~ >> and work with it. >> >> Suppose you were writing bash scripts around python programs. Then >> what will be the beha

Re: python -m pip install and pip install

2019-10-10 Thread Pankaj Jangid
Hongyi Zhao writes: > Hongyi Zhao 于2019年10月8日周二 下午4:53写道: >> >> Cameron Simpson 于2019年10月8日周二 下午12:25写道: >> > >> > On 08Oct2019 02:49, Hongyi Zhao wrote: >> > >On Tue, 08 Oct 2019 06:28:05 +0530, Pankaj Jangid wrote: >> > >> A v

Re: python -m pip install and pip install

2019-10-07 Thread Pankaj Jangid
e corresponding PYTHONPATH. -- Regards Pankaj -- https://mail.python.org/mailman/listinfo/python-list

Re: Obtain the file's path.

2019-09-18 Thread Pankaj Jangid
> unless you use it from another directory. > Somewhat related to the OP's question. So what is a good strategy in an application? I am now inclined to use relative path and working directory both. And when there is change of runtime context just change the working directory and assemble

Re: kmeans clustering

2019-09-16 Thread Pankaj Jangid
change if you add a new example and re-run K-means. On the other hand if you don't want to change the cluster compositions and just want to find a cluster for a new example then it is not K-means. In that case it is Knearest classifier. -- Pankaj Jangid -- https://mail.python.org/mailman/listinfo/python-list

Re: phyton

2019-09-10 Thread Pankaj Jangid
inhahe writes: > On Tue, Sep 10, 2019 at 8:41 AM Pankaj Jangid > wrote: > >> You can do something like this ;-) >> >> >> import math >> >> def add_vat(a, b): >> return math.ceil(100*(a * 0.57 + sum([ord(c) for c in list(b)]) * >>

Re: phyton

2019-09-10 Thread Pankaj Jangid
ow')) > > Outcome: > > 122.21 > 110.09 > You can do something like this ;-) import math def add_vat(a, b): return math.ceil(100*(a * 0.57 + sum([ord(c) for c in list(b)]) * 0.15538))/100 print(add_vat(101, 'high')) print(add_vat(101, 'low')) -- Pankaj Jangid -- https://mail.python.org/mailman/listinfo/python-list

Re: local variable 'p' referenced before assignment

2019-09-08 Thread Pankaj Jangid
Coming with a baggage of other languages. :-) I should have searched it. Thanks a lot for sharing this. Regards. -- Pankaj Jangid -- https://mail.python.org/mailman/listinfo/python-list

local variable 'p' referenced before assignment

2019-09-08 Thread Pankaj Jangid
= 1 if m > p: q = m# Changed 'p' to 'q' visit() print(p) -- Pankaj Jangid -- https://mail.python.org/mailman/listinfo/python-list

Re: How to only read words within brackets/ parentheses (in .txt file) using Python

2019-09-05 Thread pankaj . jangid
t; The main idea is to read only these portions of the .txt file (i.e. Those > within parentheses): > This should work for the outer parenthesis: import re p = re.compile(r"\((.+)\)", re.VERBOSE) with open('filename','r') as fd: lines = fd.readlines() f

Re: Hi how do I import files inside a txt file?

2019-09-02 Thread Pankaj Jangid
example that you gave, you have written contents of "list_of_devices.txt" as test1,test2 Take care to read them as comma separated. Or if you have control then write them on separate lines. Regards. -- Pankaj Jangid -- https://mail.python.org/mailman/listinfo/python-list

Re: Python unit test framework to fire 1000 unique concurrent requests

2019-08-28 Thread Pankaj Jangid
in parallel > 3. Verify Response headers of each URL requests > 4. Login to remote machine ( to which requests is fired) and verify logs > 1st is a load testing. You can use something like Apache JMeter. For other advanced validations use Desktop version of vREST - https://desktop.vrest.io

Re: Using the same data for both validation and prediction in Keras

2019-08-26 Thread Pankaj Jangid
for validation and testing. -- Pankaj Jangid -- https://mail.python.org/mailman/listinfo/python-list

Re: python requests get from API and post to another API and remote u'

2019-08-20 Thread Pankaj Jangid
ess": > "10.10.10.230/30"} This could be python version issue at your end. But I am thinking why this is getting rejected by Postman as well. Try with vREST. -- Pankaj Jangid -- https://mail.python.org/mailman/listinfo/python-list

Re: Meanwhile Norwegian trolls created ...

2019-08-17 Thread Pankaj Jangid
d it would behave more meaningfully. -- Pankaj Planet Earth. -- https://mail.python.org/mailman/listinfo/python-list

Re: Your IDE's?

2019-08-16 Thread Pankaj Jangid
pect of a programmer's editor like > Vim or GNU Emacs. I also use Emacs for all my coding requirements. Atom will probably be abandonded now. Github is now acquired by Microsoft and hence their is no point for them to run two similar projects. The community might fork it though.

Re: why does memory consumption keep growing?

2017-10-05 Thread Pankaj L Ahire
On Thu, Oct 5, 2017 at 17:07 Fetchinson . via Python-list < python-list@python.org> wrote: > Hi folks, > > I have a rather simple program which cycles through a bunch of files, > does some operation on them, and then quits. There are 500 files > involved and each operation takes about 5-10 MB of m

Looking for Python Engineering Manager or Python experts for world's leading Artificial Intelligence Company in San Francisco,CA

2016-06-13 Thread pankaj
open. Appreciate any help. Thanks so much, Pankaj Director Best Practices Openmind Technologies Inc Cell 510-396-0878. -- https://mail.python.org/mailman/listinfo/python-list

Re: OOP for System Administrator

2015-04-06 Thread pankaj sharma
Yes Michael, your guess is right. I once was a Java Programmer :) Thanks for the advice and link. Regards, -- https://mail.python.org/mailman/listinfo/python-list

OOP for System Administrator

2015-04-04 Thread pankaj sharma
questions is Do I need to learn Object oriented Python in order to be good at python scripting. I know basics of OOP but personally didn't like it much. Thanks Pankaj -- https://mail.python.org/mailman/listinfo/python-list

exp_continue

2010-03-19 Thread Pankaj
I am using pexpect module in python I would like to know how I can use exp_continue here. what is the alternative of exp_continue of perl/tcl in pexpect. -- http://mail.python.org/mailman/listinfo/python-list

exp_internal in pexpect

2010-03-03 Thread Pankaj
how to enable expect log in pexpect ? (similar as exp_internal in expect) -- http://mail.python.org/mailman/listinfo/python-list

timeout restart in pexpect

2010-03-02 Thread Pankaj
I am using pexpect to automate some procedures. My procedures are time cosuming, some messages coming out from that, in failure cases it will not output anything. So I would like to give small timeout value but when some message is received, it should restart the timeout, similar like "restart_ti

Re: symbolic links, aliases, cls clear

2006-04-04 Thread Pankaj
its true for the processes, gone to the system mode and from there the process is not considering the shell variable any more. In case of deamons also it is the same case. For Phython programs, I am not sure , may they are also nohops, so might be not accessing the shell variables. But i think you

Re: Calling C++ function from python script

2006-01-28 Thread Pankaj
One small thing was incorrect there. gcc -c TestCase.c TestCase_wrap.c -I /usr/include/python2.2/ This include path is required for Python.h file -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling C++ function from python script

2006-01-28 Thread Pankaj
See, i tell u, nothing is difficult in this world. I achieved the thing which i was asking for. Thanks for the advice. I used this paper: http://www.swig.org/tutorial.html for creating python modules from C code. Which is what i needed. In order to interface both things, we need convert atleas

Re: Calling C++ function from python script

2006-01-28 Thread Pankaj
The examples given are too complicated. So, if it can be explained using my sample example. Would be thankful for that. /* 1.c File **/ func( char a[10] ) { int i; for( i =0; i < 10; i++) printf("\n array element is: %c", a[i]); } /* 1.py File **/ f = o

Re: Calling C++ function from python script

2006-01-28 Thread Pankaj
In my case, i want to use python script as parent script and call C++ function from within the python script. If this is the case, then what am i doing? 1. extending 2. embedding. ? Ravi Teja wrote: > Pankaj wrote: > > The module which i am creating is like > > > > Part A

Calling C++ function from python script

2006-01-28 Thread Pankaj
present in C++ How should i do that? Kindly suggest some ways. Regards Pankaj -- http://mail.python.org/mailman/listinfo/python-list

Re: Backreferences in python ?

2006-01-23 Thread Pankaj
I got my answer if ( m != None ) : subStrPattern1_hasInitialization = m.group(1) subStrPattern2_hasRestTillEnd = m.group(2) str = subStrPattern1_hasInitialization + subStrPattern2_hasRestTillEnd strToReplace = "for(" + pattern + str This gave me my soluti

Re: Backreferences in python ?

2006-01-23 Thread Pankaj
My tries have with re have not yielded results:: { strToFind = 'for*;*' ## Converting int to string, i.e. line no. to string lineNoClone = lineno pattern = "printf(\"" + str( lineNoClone) + "\")," regObj = re.compile( strToFind) m = regObj.searc

Backreferences in python ?

2006-01-23 Thread Pankaj
I have something like below in perl and i am searching for equivalent in python: ::: Perl ::: *** while( ) { line = $_; pattern = "printf\( \"$lineNo \" \),"; line =~ s/"for(.*)\((*.)\;(.*)/for$1\($pattern$2\;$3/g; } This is used to search for :for ( i = 0; i < 1

Re: Executing python script in non-interactive mode on cygwin (windows)

2006-01-23 Thread Pankaj
Thanks it was my mistake -- http://mail.python.org/mailman/listinfo/python-list

Executing python script in non-interactive mode on cygwin (windows)

2006-01-23 Thread Pankaj
ave "python 1.py" hoping that it will exeucte and give me output, but nothing was printed Does python not support teh non-interactive mode of execution I have the manuals and they dont' specify this thing anywhere. they tell use "python -c filename" Please he

Accesing Global variables in multiple Requests (Apache 2.0)

2005-09-26 Thread Pankaj Gupta
configuration ? Sincere Thanks, Pankaj -- http://mail.python.org/mailman/listinfo/python-list

Accesing Global variables in python

2005-09-26 Thread Pankaj
configuration ? Sincere Thanks, Pankaj -- http://mail.python.org/mailman/listinfo/python-list

['ext.IsDOMString', 'ext.SplitQName']

2004-12-22 Thread Jindal, Pankaj
py py2exe --includes xml.sax.drivers2.drv_pyexpat I am getting the same Warning. Please, can anybody help me out.. I will be highly obliged. Thanks and regards Pankaj Jindal Aeroflex E-Newsletter Subscribe now