Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

File creation in python docker issue

Featured Replies

Hey guys, so I'm having a bit of an issue here.

Made a discord bot in python, creates file in location where script is, a simple .csv file.

But, here's the issue and I can't quite figure out a fix for it.

 

In summary - my bot creates a file but I've no idea where the flip it's being created xD 

 

image.thumb.png.017f1e0c2a1c7f75aed3e9c9ecbfdb03.png


This is the docker info.

 

1990434767_image(2).png.799e918e2d1f53e815f7e984d1ff3121.png

This is the unraid directory 

 

and 429762422_image(1).thumb.png.aca2a8a6e3283d4214e54db690176585.png

 

this is what the console for the docker shows me.


but the problem is... erhm, well yas you can see. I can't see the file anywhere in the explorer... 
I need to be able to backup the file and sometimes manually edit it also need access for it so i can open it with excel. 

 

What am I doing wrong? and how can I resolve this issue?

Thanks!

Edited by vkmicro

Solved by vkmicro

  • vkmicro changed the title to File creation in python docker issue

I don't use that but your appdata is mapped to app in the container, which is a folder you can see in your screenshot, but you haven't created the file in that folder. Only mapped folders can be accessed outside a container 

  • Author

File should be auto-created by a python script.

File creation code

 

try:
  with open('users.csv', 'r') as csvfile:
    pass
except FileNotFoundError:
  with open('users.csv', 'w', newline='') as csvfile:
    writer = csv.writer(csvfile)

 

Nothing in that code to make me think file will be created in the app folder.

  • Author
  • Solution

You're right! 

I resolved the issue at last. 
The issue was with how I had the shell script set up and how it was calling my script

old

image.png.f216d05f5fd2c1620db44d23d35b3767.png

 

new
image.png.98eaff01ff3531425529ce780e373382.png

Edited by vkmicro

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.