element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Rpi python problems
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 4 replies
  • Subscribers 676 subscribers
  • Views 499 views
  • Users 0 members are here
Related

Rpi python problems

realringer
realringer over 9 years ago

Hi,

Im currently working on a raspberry pi zero timelapse project. The idea is to have a rpi zero with a cameramodule conected to it. Also conected is a wifi module wich takes up the one usb port. I want to avoid getting a usb hub.

 

I got a button connected which is runned by a program. when the button is pressed it runs my main program.

My main concists of a loop which takes a picture every few minutes and uploads it to my dropbox acc wia the wifi connection.

 

The problem lies in when i dont have a screen or are shh into the pi. I have done some reserch and figured out that the comand im using to upload to dropbox and deleating the image does not work without the shell. I have tried to fix this but havent figured it out jet. Is there an other option for uploading it and deleating the image. Im locking for a option that does not require a shell but still works fine with my code. its a python progam.

 

Thx in advance!!

Christofer.image

  • Sign in to reply
  • Cancel
Parents
  • royleith
    0 royleith over 9 years ago

    I've always used the old os module. However, this link seems to have the answer,

     

    http://sharats.me/the-ever-useful-and-neat-subprocess-module.html

     

    You are using shell=true. It's used to get the enhanced features of the shell such as pipes. It does not look as though you are using shell features so use the shell=false mode.

     

    BTW the correct usage of shell=true is to use a string of the required shell command,

     

    call('ls -l', shell=True)

     

    It looks as though the syntax you are using is actually that of shell=false which requires a list of the program and arguments.

     

    call(['ls', '-l'])

     

    So, try

     

    call ([photofile])

    call ([photerm])

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • royleith
    0 royleith over 9 years ago

    I've always used the old os module. However, this link seems to have the answer,

     

    http://sharats.me/the-ever-useful-and-neat-subprocess-module.html

     

    You are using shell=true. It's used to get the enhanced features of the shell such as pipes. It does not look as though you are using shell features so use the shell=false mode.

     

    BTW the correct usage of shell=true is to use a string of the required shell command,

     

    call('ls -l', shell=True)

     

    It looks as though the syntax you are using is actually that of shell=false which requires a list of the program and arguments.

     

    call(['ls', '-l'])

     

    So, try

     

    call ([photofile])

    call ([photerm])

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • realringer
    0 realringer over 9 years ago in reply to royleith

    When i first encountered this problem i thought it had to do with the  shell=True . I therefore tried

    shell=False  aparently i was on the right track. But i didnt read the documentation and therefore it probebly were some faults. I got a errormessage when i tried it and moved on with other tries to fix it.

    Thanks for the link and im going to take a look at it when i get my rpi working again. I might just get my pi 3 and get the dropbox stuff sorted out tomorrow. Before i get into the ssh stuff and setting up the network again on the zero.

    Thanks again

     

    Christofer

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube