thanks a lot:
p = subprocess.Popen(('someprog.exe', str(i))
p.wait()
*Ronaldo Bahia*
+55 11 3280 6971
+55 11 963 622 581
*Materiais gratuitos para o RH:*
- ROI - Melhorando Indicadores no RH
See:
https://stackoverflow.com/questions/8953119/python-waiting-for-external-launched-process-finish
François
> On Aug 7, 2017, at 2:35 PM, Ronaldo Bahia wrote:
>
> How can I do that?
>
> Ronaldo Bahia
> +55 11 3280 6971
> +55 11 963 622 581
>
> Materiais
That’s a great idea. How do you do that programmatically?
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On
Behalf Of "? ? (roboslone)"
Sent: Monday, August 7, 2017 4:32 PM
To: django-users@googlegroups.com
Subject: Re: Django Python OSError No such
Turns out unoconv takes 2 seconds to perform the file conversion.
So after the file conversion, I had to set time.sleep(3) before upload a
file to S3.
And after 1 week I got this working using variables.
Thanks
*Ronaldo Bahia*
+55 11 3280 6971
+55 11 963 622 581
*Materiais gratuitos para o
I don't know why but if I set the string ("cv.pdf"), it process just fine.
If I use a variable instead, it doesn't.
Here is the working code:
# convert to PDF
env = os.environ.copy()
env['HOME'] = '/tmp'
subprocess.Popen(["unoconv","-f", "pdf", "-o", "cv.pdf","%s"
Well, yeah, you're using local path basically. And you should NEVER use
.split('/')[-1] to determine file basename, take a look at os.path module
instead.
But that's not the point. You should try to use absolute path, I believe it
would do the trick.
> On 4 Aug 2017, at 17:49, Ronaldo Bahia
the method is called in a def post() within a class view:
user_cv = CandidateCV.objects.get(user=request.user)
user_cv_file = str(user_cv.resume).split('/')[-1]
s3upload(user_cv_file)
The file is converted from doc to pdf in server project folder, where
manage.py is.
So probably there is no
Hi,
Are you sure s3file contains absolute path? I can't see where s3upload is being
called.
Also, you might wanna use os.remove instead of calling subprocess.
You also might wanna check out PEP-8 and Sphinx for your docstrings.
> On 2 Aug 2017, at 02:28, Ronaldo Bahia
Hi everyone, can you help me?
Thanks in advance
Thread:
https://stackoverflow.com/questions/45449102/django-python-oserror-no-such-file-or-directory-but-file-exists
Code:
down votefavorite
9 matches
Mail list logo